mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
Add device sharing support
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
|
||||
// Hold the length of the longest name, so that C applications can allocate memory accordingly
|
||||
// Currently the longest is "Intrepid Ethernet Evaluation Board"
|
||||
#define ICSNEO_DEVICETYPE_LONGEST_NAME (35 + 1) // Add 1 so that if someone forgets, they still have space for null terminator
|
||||
#define ICSNEO_DEVICETYPE_LONGEST_NAME (145 + 1) // Add 1 so that if someone forgets, they still have space for null terminator
|
||||
#define ICSNEO_DEVICETYPE_LONGEST_DESCRIPTION (ICSNEO_DEVICETYPE_LONGEST_NAME + 7) // 6 character serial, plus space
|
||||
|
||||
#ifndef __cplusplus
|
||||
|
||||
@@ -11,7 +11,7 @@ typedef std::function< std::unique_ptr<Driver>(device_eventhandler_t err, neodev
|
||||
class FoundDevice {
|
||||
public:
|
||||
neodevice_handle_t handle = 0;
|
||||
char serial[7] = {};
|
||||
deviceserial_t serial = {};
|
||||
uint16_t productId = 0;
|
||||
driver_factory_t makeDriver;
|
||||
};
|
||||
|
||||
@@ -18,6 +18,7 @@ typedef void* devicehandle_t;
|
||||
#endif
|
||||
|
||||
typedef int32_t neodevice_handle_t;
|
||||
typedef char deviceserial_t[7];
|
||||
|
||||
#pragma pack(push, 1)
|
||||
|
||||
@@ -31,7 +32,7 @@ typedef struct {
|
||||
devicehandle_t device; // Pointer back to the C++ device object
|
||||
neodevice_handle_t handle; // Handle for use by the underlying driver
|
||||
devicetype_t type;
|
||||
char serial[7];
|
||||
deviceserial_t serial;
|
||||
} neodevice_t;
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
Reference in New Issue
Block a user