#include <iostream>
#include <vector>
#define AGHAF_DYNAMIC_LIBRARY_INIT
void onMessageTx(uint64_t timestamp, uint8_t flags, uint16_t dataLen,
uint8_t const *data, void *userContext) {
(void)timestamp;
(void)flags;
(void)dataLen;
(void)data;
(void)userContext;
}
void onMessageRx(uint64_t timestamp, uint8_t flags, uint16_t dataLen,
uint8_t const *data, void *userContext) {
(void)timestamp;
(void)flags;
(void)dataLen;
(void)data;
(void)userContext;
}
void onSOM(uint64_t timestamp, void *userContext) {
(void)timestamp;
(void)userContext;
}
(void)timestamp;
(void)error;
(void)userContext;
}
(void)timestamp;
(void)error;
(void)userContext;
}
void on5BaudInit(uint64_t timestamp, uint8_t flags, uint16_t dataLen,
uint8_t const *data, void *userContext) {
(void)timestamp;
(void)flags;
(void)dataLen;
(void)data;
(void)userContext;
}
int main() {
#ifdef _WIN32
AGHAF_loadLibrary(AGHAF_DEFAULT_FILENAME);
#endif
uint32_t deviceInfoNumber = 0;
std::vector<uint8_t> dataToSend;
dataToSend.push_back(0x01);
dataToSend.size(), dataToSend.data());
} else {
std::cerr << "no KLine on this device" << '\n';
}
} else {
std::cerr << "device is used by another application" << '\n';
}
} else {
std::cerr << "no exxotest device connected" << '\n';
}
#ifdef _WIN32
AGHAF_unloadLibrary();
#endif
return 0;
}
@ AGHAF_STATUS_OK
The operation succeeded.
Definition: aghaf_global.h:121
#define AGHAF_KLine_MSG_EVENT_DATA
by this flag
Definition: aghaf_kline_enums.h:18
@ AGHAF_KLine_PARAM_BAUDRATE
Definition: aghaf_kline_enums.h:90
AGHAF_KLine_Error
List of possible errors in KLine.
Definition: aghaf_kline_enums.h:28
AGHAF_Status AGHAF_KLine_sendMessage(AGHAF_KLine kline, uint8_t flags, uint16_t dataLen, uint8_t const *data)
send data on the KLine
Definition: aghaf_kline.cpp:185
void AGHAF_KLine_setOnMsgTxCallback(AGHAF_KLine kline, AGHAF_KLine_onMsgTx callback, void *userContext)
set the callback called on a tx event
Definition: aghaf_kline.cpp:14
void AGHAF_KLine_setOn5BaudInitCallback(AGHAF_KLine kline, AGHAF_KLine_on5BaudInit callback, void *userContext)
set the callback called on a 5 baud init event
Definition: aghaf_kline.cpp:78
AGHAF_Status AGHAF_KLine_setParam(AGHAF_KLine kline, AGHAF_KLine_Param param, uint32_t value)
set a parameter from a KLine
Definition: aghaf_kline.cpp:171
void AGHAF_KLine_setOnRxErrorCallback(AGHAF_KLine kline, AGHAF_KLine_onRxError callback, void *userContext)
set the callback called on a reception error event
Definition: aghaf_kline.cpp:65
void AGHAF_KLine_setOnSomCallback(AGHAF_KLine kline, AGHAF_KLine_onSOM callback, void *userContext)
set the callback called on a SOM event
Definition: aghaf_kline.cpp:40
AGHAF_Status AGHAF_KLine_deactivate(AGHAF_KLine kline)
stop the communication with the KLine
Definition: aghaf_kline.cpp:131
uint8_t AGHAF_KLine_getCount(AGHAF_Device device)
return the number of KLines available on a device
Definition: aghaf_kline.cpp:111
void AGHAF_KLine_setOnMsgRxCallback(AGHAF_KLine kline, AGHAF_KLine_onMsgRx callback, void *userContext)
set the callback called on a rx event
Definition: aghaf_kline.cpp:27
void * AGHAF_KLine
handle on KLine
Definition: aghaf_kline.h:22
AGHAF_KLine AGHAF_KLine_get(AGHAF_Device device, uint8_t index)
return the KLine bus at the index specified
Definition: aghaf_kline.cpp:91
void AGHAF_KLine_setOnTxErrorCallback(AGHAF_KLine kline, AGHAF_KLine_onTxError callback, void *userContext)
set the callback called on a transmission error event
Definition: aghaf_kline.cpp:52
AGHAF_Status AGHAF_KLine_activate(AGHAF_KLine kline)
start the communication with the KLine
Definition: aghaf_kline.cpp:121
uint32_t AGHAF_getDeviceCount()
Return the number of devices onnected.
Definition: aghaf_global.cpp:105
AGHAF_Status AGHAF_getDeviceList(AGHAF_DeviceInfo **devices, uint32_t *size)
Provide the list of devices connected.
Definition: aghaf_global.cpp:117
AGHAF_Device AGHAF_getDeviceBySN(const char *productNumber, const char *serialNumber)
Return the handle on the specified device.
Definition: aghaf_global.cpp:145
void AGHAF_freeDeviceList(AGHAF_DeviceInfo *devices)
Free the memory allocated with AGHAF_getDeviceList.
Definition: aghaf_global.cpp:126
void * AGHAF_Device
handle on an exxotest device
Definition: aghaf_global.h:175
AGHAF_Status AGHAF_closeDevice(AGHAF_Device device)
close the device
Definition: aghaf_global.cpp:241
AGHAF_Status AGHAF_openDevice(AGHAF_Device device)
Open a device.
Definition: aghaf_global.cpp:231
structure containing the informtions about a device
Definition: aghaf_global.h:215