Added icsneoOpenDevice.
parent
bb322ad190
commit
4e901676d2
|
|
@ -5,6 +5,7 @@
|
||||||
//Basic Functions
|
//Basic Functions
|
||||||
FINDNEODEVICES icsneoFindNeoDevices;
|
FINDNEODEVICES icsneoFindNeoDevices;
|
||||||
OPENNEODEVICE icsneoOpenNeoDevice;
|
OPENNEODEVICE icsneoOpenNeoDevice;
|
||||||
|
OPENDEVICE icsneoOpenDevice;
|
||||||
CLOSEPORT icsneoClosePort;
|
CLOSEPORT icsneoClosePort;
|
||||||
FREEOBJECT icsneoFreeObject;
|
FREEOBJECT icsneoFreeObject;
|
||||||
////OPENPORTEX icsneoOpenPortEx;
|
////OPENPORTEX icsneoOpenPortEx;
|
||||||
|
|
@ -137,6 +138,7 @@ bool LoadDLLAPI(HINSTANCE &hAPIDLL)
|
||||||
|
|
||||||
icsneoFindNeoDevices = (FINDNEODEVICES) GetProcAddress(hAPIDLL, "icsneoFindNeoDevices");
|
icsneoFindNeoDevices = (FINDNEODEVICES) GetProcAddress(hAPIDLL, "icsneoFindNeoDevices");
|
||||||
icsneoOpenNeoDevice = (OPENNEODEVICE) GetProcAddress(hAPIDLL, "icsneoOpenNeoDevice");
|
icsneoOpenNeoDevice = (OPENNEODEVICE) GetProcAddress(hAPIDLL, "icsneoOpenNeoDevice");
|
||||||
|
icsneoOpenDevice = (OPENDEVICE) GetProcAddress(hAPIDLL, "icsneoOpenDevice");
|
||||||
icsneoClosePort = (CLOSEPORT) GetProcAddress(hAPIDLL, "icsneoClosePort");
|
icsneoClosePort = (CLOSEPORT) GetProcAddress(hAPIDLL, "icsneoClosePort");
|
||||||
icsneoFreeObject = (FREEOBJECT) GetProcAddress(hAPIDLL, "icsneoFreeObject");
|
icsneoFreeObject = (FREEOBJECT) GetProcAddress(hAPIDLL, "icsneoFreeObject");
|
||||||
//// icsneoOpenPortEx = (OPENPORTEX) GetProcAddress(hAPIDLL, "icsneoOpenPortEx");
|
//// icsneoOpenPortEx = (OPENPORTEX) GetProcAddress(hAPIDLL, "icsneoOpenPortEx");
|
||||||
|
|
@ -204,7 +206,7 @@ bool LoadDLLAPI(HINSTANCE &hAPIDLL)
|
||||||
|
|
||||||
icsneoEnableDOIPLine = (ENABLEDOIPACTIVATIONLINE)GetProcAddress(hAPIDLL, "icsneoEnableDOIPLine");
|
icsneoEnableDOIPLine = (ENABLEDOIPACTIVATIONLINE)GetProcAddress(hAPIDLL, "icsneoEnableDOIPLine");
|
||||||
|
|
||||||
if(!icsneoFindNeoDevices || !icsneoOpenNeoDevice || !icsneoClosePort || !icsneoFreeObject ||
|
if(!icsneoFindNeoDevices || !icsneoOpenNeoDevice || !icsneoOpenDevice || !icsneoClosePort || !icsneoFreeObject ||
|
||||||
!icsneoTxMessages || !icsneoGetMessages || !icsneoWaitForRxMessagesWithTimeOut ||
|
!icsneoTxMessages || !icsneoGetMessages || !icsneoWaitForRxMessagesWithTimeOut ||
|
||||||
!icsneoGetTimeStampForMsg || !icsneoEnableNetworkRXQueue || !icsneoGetISO15765Status || !icsneoTxMessagesEx ||
|
!icsneoGetTimeStampForMsg || !icsneoEnableNetworkRXQueue || !icsneoGetISO15765Status || !icsneoTxMessagesEx ||
|
||||||
!icsneoSetISO15765RxParameters || !icsneoGetConfiguration || !icsneoSendConfiguration ||
|
!icsneoSetISO15765RxParameters || !icsneoGetConfiguration || !icsneoSendConfiguration ||
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ void UnloadDLLAPI(HINSTANCE &hAPIDLL);
|
||||||
//Basic Functions
|
//Basic Functions
|
||||||
typedef int (__stdcall *FINDNEODEVICES)(unsigned long DeviceTypes, NeoDevice *pNeoDevice, int *pNumDevices);
|
typedef int (__stdcall *FINDNEODEVICES)(unsigned long DeviceTypes, NeoDevice *pNeoDevice, int *pNumDevices);
|
||||||
typedef int (__stdcall *OPENNEODEVICE)(NeoDevice *pNeoDevice, void * hObject, unsigned char *bNetworkIDs, int bConfigRead, int bSyncToPC);
|
typedef int (__stdcall *OPENNEODEVICE)(NeoDevice *pNeoDevice, void * hObject, unsigned char *bNetworkIDs, int bConfigRead, int bSyncToPC);
|
||||||
|
typedef int (__stdcall *OPENDEVICE)(NeoDeviceEx* pNeoDeviceEx, void** hObject, unsigned char* bNetworkIDs, int bConfigRead, int iOptions, OptionsOpenNeoEx* stOptionsOpenNeoEx, unsigned long reserved);
|
||||||
typedef int (__stdcall *CLOSEPORT)(void * hObject, int *pNumberOfErrors);
|
typedef int (__stdcall *CLOSEPORT)(void * hObject, int *pNumberOfErrors);
|
||||||
typedef void (__stdcall *FREEOBJECT)(void * hObject);
|
typedef void (__stdcall *FREEOBJECT)(void * hObject);
|
||||||
typedef int (__stdcall *OPENPORTEX)(void * lPortNumber, int lPortType, int lDriverType, int lIPAddressMSB, int lIPAddressLSBOrBaudRate,
|
typedef int (__stdcall *OPENPORTEX)(void * lPortNumber, int lPortType, int lDriverType, int lIPAddressMSB, int lIPAddressLSBOrBaudRate,
|
||||||
|
|
@ -115,6 +116,7 @@ typedef int (__stdcall *SCRIPTWRITEISO15765TXMESSAGE)(void * hObject, unsigned
|
||||||
//Basic Functions
|
//Basic Functions
|
||||||
extern FINDNEODEVICES icsneoFindNeoDevices;
|
extern FINDNEODEVICES icsneoFindNeoDevices;
|
||||||
extern OPENNEODEVICE icsneoOpenNeoDevice;
|
extern OPENNEODEVICE icsneoOpenNeoDevice;
|
||||||
|
extern OPENDEVICE icsneoOpenDevice;
|
||||||
extern CLOSEPORT icsneoClosePort;
|
extern CLOSEPORT icsneoClosePort;
|
||||||
extern FREEOBJECT icsneoFreeObject;
|
extern FREEOBJECT icsneoFreeObject;
|
||||||
extern SERIALNUMBERTOSTRING icsneoSerialNumberToString;
|
extern SERIALNUMBERTOSTRING icsneoSerialNumberToString;
|
||||||
|
|
|
||||||
|
|
@ -169,6 +169,25 @@ int icsneoOpenNeoDevice(NeoDevice* pNeoDevice, void** hObject, unsigned char* bN
|
||||||
return icsneo_setPollingMessageLimit(device, 20000) && icsneo_enableMessagePolling(device) && icsneo_goOnline(device);
|
return icsneo_setPollingMessageLimit(device, 20000) && icsneo_enableMessagePolling(device) && icsneo_goOnline(device);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int icsneoOpenDevice(NeoDeviceEx* pNeoDeviceEx, void** hObject, unsigned char* bNetworkIDs, int bConfigRead, int iOptions, OptionsOpenNeoEx* stOptionsOpenNeoEx, unsigned long reserved) {
|
||||||
|
if(pNeoDeviceEx == nullptr || hObject == nullptr)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
neodevice_t* device;
|
||||||
|
try {
|
||||||
|
device = &neodevices.at(uint64_t(pNeoDeviceEx->neoDevice.Handle) << 32 | pNeoDeviceEx->neoDevice.SerialNumber);
|
||||||
|
} catch(std::out_of_range& e) {
|
||||||
|
(void)e; // Unused
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
*hObject = device;
|
||||||
|
if(!icsneo_openDevice(device))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return icsneo_setPollingMessageLimit(device, 20000) && icsneo_enableMessagePolling(device) && icsneo_goOnline(device);
|
||||||
|
}
|
||||||
|
|
||||||
int icsneoClosePort(void* hObject, int* pNumberOfErrors) {
|
int icsneoClosePort(void* hObject, int* pNumberOfErrors) {
|
||||||
if(!icsneoValidateHObject(hObject))
|
if(!icsneoValidateHObject(hObject))
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ extern "C" {
|
||||||
extern int DLLExport icsneoFindDevices(NeoDeviceEx* pNeoDeviceEx, int* pNumDevices, unsigned int* DeviceTypes, unsigned int numDeviceTypes,POptionsFindNeoEx* pOptionsNeoEx, unsigned int* reserved);
|
extern int DLLExport icsneoFindDevices(NeoDeviceEx* pNeoDeviceEx, int* pNumDevices, unsigned int* DeviceTypes, unsigned int numDeviceTypes,POptionsFindNeoEx* pOptionsNeoEx, unsigned int* reserved);
|
||||||
extern int DLLExport icsneoFindNeoDevices(unsigned long DeviceTypes, NeoDevice* pNeoDevice, int* pNumDevices);
|
extern int DLLExport icsneoFindNeoDevices(unsigned long DeviceTypes, NeoDevice* pNeoDevice, int* pNumDevices);
|
||||||
extern int DLLExport icsneoOpenNeoDevice(NeoDevice* pNeoDevice, void** hObject, unsigned char* bNetworkIDs, int bConfigRead, int bSyncToPC);
|
extern int DLLExport icsneoOpenNeoDevice(NeoDevice* pNeoDevice, void** hObject, unsigned char* bNetworkIDs, int bConfigRead, int bSyncToPC);
|
||||||
|
extern int DLLExport icsneoOpenDevice(NeoDeviceEx* pNeoDeviceEx, void** hObject, unsigned char* bNetworkIDs, int bConfigRead, int iOptions, OptionsOpenNeoEx* stOptionsOpenNeoEx, unsigned long reserved);
|
||||||
extern int DLLExport icsneoClosePort(void* hObject, int* pNumberOfErrors);
|
extern int DLLExport icsneoClosePort(void* hObject, int* pNumberOfErrors);
|
||||||
extern void DLLExport icsneoFreeObject(void* hObject);
|
extern void DLLExport icsneoFreeObject(void* hObject);
|
||||||
extern int DLLExport icsneoSerialNumberToString(unsigned long serial, char* data, unsigned long data_size);
|
extern int DLLExport icsneoSerialNumberToString(unsigned long serial, char* data, unsigned long data_size);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue