Add device sharing support

This commit is contained in:
Kyle Schwarz
2022-12-13 11:46:32 -05:00
parent 78465e0f20
commit a9157c82e5
46 changed files with 1946 additions and 102 deletions
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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;
};
+2 -1
View File
@@ -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)