You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
819 B
30 lines
819 B
#ifndef __HID_DRY_CONTACTS_HEADER__
|
|
#define __HID_DRY_CONTACTS_HEADER__
|
|
|
|
// Configuration
|
|
#define CMD_ON 0xFF
|
|
#define CMD_OFF 0xFD
|
|
#define CMD_SET_SERIAL 0xFA
|
|
|
|
#define HID_DCR_SERIIAL_LENGTH 5
|
|
|
|
// Struct for relay boards
|
|
typedef struct S_DC_BOARD
|
|
{
|
|
//+1 for the \0 string terminator
|
|
char serial[HID_DCR_SERIIAL_LENGTH + 1];
|
|
unsigned char relay_count;
|
|
unsigned char state;
|
|
char path[MAX_PATH_LEN];
|
|
} DC_BOARD;
|
|
|
|
// Public methods
|
|
int enumerate_relay_boards(const char * product, int verbose, int debug);
|
|
int operate_relay(const char * path, unsigned char relay, unsigned char state);
|
|
int set_serial(const char * path, char * newserial);
|
|
DC_BOARD * find_board(const char * serial);
|
|
int get_relay_board_count(void);
|
|
DC_BOARD * get_relay_boards(void);
|
|
void shutdown(void);
|
|
|
|
#endif
|