resolved: activating/deactivating peripherals

This commit is contained in:
2025-11-01 12:23:22 +01:00
parent cb5c5b688e
commit abcc3e0b5e
17 changed files with 559 additions and 1904 deletions

View File

@@ -0,0 +1,19 @@
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
typedef struct {
char* serialNumber;
char* description;
int isOpen;
} FTDIPeripheralC;
int get_peripherals_number();
void get_ftdi_devices(FTDIPeripheralC* devices, int count);
void free_ftdi_device(FTDIPeripheralC* device);
#ifdef __cplusplus
}
#endif

View File

@@ -1,15 +1,30 @@
// Declare the C++ function from the shared library
#include <stdint.h>
typedef enum {
DMX_OK,
DMX_CHANNEL_TOO_LOW_ERROR,
DMX_CHANNEL_TOO_HIGH_ERROR,
DMX_VALUE_TOO_LOW_ERROR,
DMX_VALUE_TOO_HIGH_ERROR,
DMX_OPEN_ERROR,
DMX_SET_BAUDRATE_ERROR,
DMX_SET_DATA_CHARACTERISTICS_ERROR,
DMX_SET_FLOW_ERROR,
DMX_UNKNOWN_ERROR
} DMXError;
typedef void DMXDevice;
extern DMXDevice* dmx_create();
extern void* dmx_destroy(DMXDevice* dev);
extern bool dmx_connect(DMXDevice* dev);
extern DMXError dmx_connect(DMXDevice* dev, char* serialNumber);
extern void dmx_activate(DMXDevice* dev);
extern DMXError dmx_activate(DMXDevice* dev);
extern void dmx_deactivate(DMXDevice* dev);
extern DMXError dmx_deactivate(DMXDevice* dev);
extern void dmx_setValue(DMXDevice* dev, int channel, int value);
extern DMXError dmx_setValue(DMXDevice* dev, uint16_t channel, uint8_t value);