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

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  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. {
  11. //+1 for the \0 string terminator
  12. char serial[HID_DCR_SERIIAL_LENGTH + 1];
  13. unsigned char relay_count;
  14. unsigned char state;
  15. char path[MAX_PATH_LEN];
  16. } DC_BOARD;
  17. // Public methods
  18. int enumerate_relay_boards(const char * product, int verbose, int debug);
  19. int operate_relay(const char * path, unsigned char relay, unsigned char state);
  20. int set_serial(const char * path, char * newserial);
  21. DC_BOARD * find_board(const char * serial);
  22. int get_relay_board_count(void);
  23. DC_BOARD * get_relay_boards(void);
  24. void shutdown(void);
  25. #endif