CAN and CAN FD transmit implemented

This commit is contained in:
Paul Hollinsky
2018-10-18 17:39:37 -04:00
parent dd99f82324
commit d037709963
8 changed files with 213 additions and 82 deletions
+12
View File
@@ -56,6 +56,10 @@ extern bool DLLExport icsneo_settingsApplyDefaultsTemporary(const neodevice_t* d
extern bool DLLExport icsneo_setBaudrate(const neodevice_t* device, uint16_t netid, uint32_t newBaudrate);
extern bool DLLExport icsneo_transmit(const neodevice_t* device, const neomessage_t* message);
extern bool DLLExport icsneo_transmitMessages(const neodevice_t* device, const neomessage_t* messages, size_t count);
#ifdef __cplusplus
} // extern "C"
#endif
@@ -128,6 +132,12 @@ fn_icsneo_settingsApplyDefaultsTemporary icsneo_settingsApplyDefaultsTemporary;
typedef bool(*fn_icsneo_setBaudrate)(const neodevice_t* device, uint16_t netid, uint32_t newBaudrate);
fn_icsneo_setBaudrate icsneo_setBaudrate;
typedef bool(*fn_icsneo_transmit)(const neodevice_t* device, const neomessage_t* message);
fn_icsneo_transmit icsneo_transmit;
typedef bool(*fn_icsneo_transmitMessages)(const neodevice_t* device, const neomessage_t* messages, size_t count);
fn_icsneo_transmitMessages icsneo_transmitMessages;
#define ICSNEO_IMPORT(func) func = (fn_##func)icsneo_dynamicLibraryGetFunction(icsneo_libraryHandle, #func)
#define ICSNEO_IMPORTASSERT(func) if((ICSNEO_IMPORT(func)) == NULL) return 3
void* icsneo_libraryHandle = NULL;
@@ -164,6 +174,8 @@ int icsneo_init() {
ICSNEO_IMPORTASSERT(icsneo_settingsApplyDefaults);
ICSNEO_IMPORTASSERT(icsneo_settingsApplyDefaultsTemporary);
ICSNEO_IMPORTASSERT(icsneo_setBaudrate);
ICSNEO_IMPORTASSERT(icsneo_transmit);
ICSNEO_IMPORTASSERT(icsneo_transmitMessages);
icsneo_initialized = true;
return 0;