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.

28 lines
823 B

5 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 years ago
​
​
​
​
​
​
​
​
​
​
​
  1. #ifndef __HID_DRY_CONTACTS_HEADER__
  2. #define __HID_DRY_CONTACTS_HEADER__
  3. //Configuration
  4. #define CMD_ON 0xFF
  5. #define CMD_OFF 0xFD
  6. #define CMD_SET_SERIAL 0xFA
  7. #define HID_DCR_SERIIAL_LENGTH 5
  8. //Struct for relay boards
  9. typedef struct S_DC_BOARD{
  10. //+1 for the \0 string terminator
  11. char serial[HID_DCR_SERIIAL_LENGTH+1];
  12. unsigned char relay_count;
  13. unsigned char state;
  14. char path[MAX_PATH_LEN];
  15. } DC_BOARD;
  16. //Public methods
  17. int enumerate_relay_boards(const char *product, int verbose, int debug);
  18. int operate_relay(const char *path,unsigned char relay, unsigned char state);
  19. int set_serial(const char *path,char *newserial);
  20. DC_BOARD *find_board(const char *serial);
  21. int get_relay_board_count(void);
  22. DC_BOARD *get_relay_boards(void);
  23. void shutdown(void);
  24. #endif