added Doxygen config for icsneo
Signed-off-by: David Rebbe <drebbe@intrepidcs.com>
parent
24d2f84dbb
commit
351e462167
|
|
@ -15,3 +15,4 @@ third-party/concurrentqueue/tests
|
||||||
examples/csharp/bin
|
examples/csharp/bin
|
||||||
examples/csharp/obj
|
examples/csharp/obj
|
||||||
test/system
|
test/system
|
||||||
|
.venv
|
||||||
|
|
@ -7,6 +7,7 @@ import subprocess
|
||||||
|
|
||||||
subprocess.call('cd ..; doxygen docs/icsneocpp/Doxyfile', shell=True)
|
subprocess.call('cd ..; doxygen docs/icsneocpp/Doxyfile', shell=True)
|
||||||
subprocess.call('cd ..; doxygen docs/icsneoc/Doxyfile', shell=True)
|
subprocess.call('cd ..; doxygen docs/icsneoc/Doxyfile', shell=True)
|
||||||
|
subprocess.call('cd ..; doxygen docs/icsneo/Doxyfile', shell=True)
|
||||||
|
|
||||||
# -- Project information -----------------------------------------------------
|
# -- Project information -----------------------------------------------------
|
||||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
|
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
|
||||||
|
|
@ -26,6 +27,7 @@ exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
|
||||||
breathe_projects = {
|
breathe_projects = {
|
||||||
'icsneocpp': 'icsneocpp/doxygen/xml',
|
'icsneocpp': 'icsneocpp/doxygen/xml',
|
||||||
'icsneoc': 'icsneoc/doxygen/xml',
|
'icsneoc': 'icsneoc/doxygen/xml',
|
||||||
|
'icsneo': 'icsneoc/doxygen/xml',
|
||||||
}
|
}
|
||||||
|
|
||||||
breathe_default_project = 'icsneocpp'
|
breathe_default_project = 'icsneocpp'
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,8 @@
|
||||||
|
=====
|
||||||
|
C API
|
||||||
|
=====
|
||||||
|
|
||||||
|
.. doxygenfile:: icsneo.h
|
||||||
|
:project: icsneo
|
||||||
|
.. doxygenfile:: icsneotypes.h
|
||||||
|
:project: icsneo
|
||||||
|
|
@ -0,0 +1,43 @@
|
||||||
|
==========
|
||||||
|
C Examples
|
||||||
|
==========
|
||||||
|
|
||||||
|
A variety of examples can be found within ``examples/c``, see below for an
|
||||||
|
example that uses the polling API to receive CAN frames.
|
||||||
|
|
||||||
|
.. code-block:: c
|
||||||
|
|
||||||
|
size_t deviceCount = 10; // Pre-set to the size of your buffer before the icsneo_findAllDevices() call
|
||||||
|
neodevice_t devices[10];
|
||||||
|
icsneo_findAllDevices(devices, &deviceCount);
|
||||||
|
printf("We found %ull devices\n", deviceCount);
|
||||||
|
for(size_t i = 0; i < deviceCount; i++) {
|
||||||
|
neodevice_t* myDevice = &devices[i];
|
||||||
|
char desc[ICSNEO_DEVICETYPE_LONGEST_DESCRIPTION];
|
||||||
|
size_t sz = ICSNEO_DEVICETYPE_LONGEST_DESCRIPTION;
|
||||||
|
icsneo_describeDevice(myDevice, desc, &sz);
|
||||||
|
printf("Found %s\n", desc); // "Found neoVI FIRE 2 CY2345"
|
||||||
|
}
|
||||||
|
neodevice_t* myDevice = &devices[0];
|
||||||
|
if(!icsneo_openDevice(myDevice)) {
|
||||||
|
neoevent_t error;
|
||||||
|
if(icsneo_getLastError(&error))
|
||||||
|
printf("Error! %s\n", error.description);
|
||||||
|
}
|
||||||
|
icsneo_goOnline(myDevice); // Start receiving messages
|
||||||
|
icsneo_enableMessagePolling(myDevice); // Allow the use of icsneo_getMessages() later
|
||||||
|
sleep(5);
|
||||||
|
neomessage_t messages[50];
|
||||||
|
size_t messageCount = 50;
|
||||||
|
icsneo_getMessages(myDevice, messages, &messageCount, 0 /* non-blocking */);
|
||||||
|
printf("We got %ull messages!\n", messageCount);
|
||||||
|
for(size_t i = 0; i < messageCount; i++) {
|
||||||
|
if(messages[i].type == ICSNEO_NETWORK_TYPE_CAN) {
|
||||||
|
// A message of type CAN should be interperated a neomessage_can_t, so we can cast safely
|
||||||
|
neomessage_can_t* canmsg = (neomessage_can_t*)&messages[i];
|
||||||
|
// canmsg->arbid is valid here
|
||||||
|
// canmsg->data is an uint8_t*, you can check canmsg->length for the length of the payload
|
||||||
|
// canmsg->timestamp is the time recorded by the hardware in nanoseconds since (1/1/2007 12:00:00 GMT)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
icsneo_closeDevice(myDevice);
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
icsneo
|
||||||
|
=======
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 2
|
||||||
|
|
||||||
|
installation
|
||||||
|
examples
|
||||||
|
api
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
============
|
||||||
|
Installation
|
||||||
|
============
|
||||||
|
|
||||||
|
The installation steps for the C API are the same as the C++ API as the C API is
|
||||||
|
a wrapper for the C++ library. The ``LIBICSNEO_BUILD_ICSNEO`` CMake option is
|
||||||
|
default ``ON`` but note that the C API depends on this flag to build.
|
||||||
|
|
@ -13,3 +13,4 @@ communication library. The source code for libicsneo can be found on GitHub:
|
||||||
icsneocpp/index
|
icsneocpp/index
|
||||||
icsneopy/index
|
icsneopy/index
|
||||||
icsneoc/index
|
icsneoc/index
|
||||||
|
icsneo/index
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue