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.

74 lines
1.7 KiB

2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
  1. #pragma once
  2. #include <fstream>
  3. #include <functional>
  4. #include <iostream>
  5. #include <list>
  6. #include <map>
  7. #include <memory>
  8. #include <mutex>
  9. #include <set>
  10. #include <sstream>
  11. #include <string>
  12. #include <vector>
  13. //
  14. #include "i_xsync_udp.hpp"
  15. #include "xsync_errcode.hpp"
  16. #include "xsync_regs.hpp"
  17. namespace xsync {
  18. using namespace std;
  19. #pragma pack(1)
  20. typedef struct {
  21. uint16_t type;
  22. uint16_t index;
  23. uint16_t cmd;
  24. uint16_t ndata;
  25. uint32_t data[]; // first is always checksum
  26. } iflytop_xsync_packet_header_t;
  27. typedef struct {
  28. uint32_t eventid;
  29. uint32_t data[];
  30. } iflytop_xsync_event_report_packet_t;
  31. #pragma pack()
  32. typedef enum {
  33. ktimecode_report_event = 0,
  34. kxsync_work_state_report_event = 1,
  35. } iflytop_event_type_t;
  36. typedef enum {
  37. kxsync_packet_type_none = 0,
  38. kxsync_packet_type_reg_read = 1,
  39. kxsync_packet_type_reg_write = 2,
  40. kxsync_packet_type_reg_read_regs = 3,
  41. kxsync_packet_type_timecode_report = 4,
  42. } xsync_protocol_cmd_t;
  43. typedef enum {
  44. kxsync_packet_type_cmd = 0,
  45. kxsync_packet_type_receipt = 1,
  46. kxsync_packet_type_report = 2,
  47. } xsync_protocol_packet_type_t;
  48. typedef enum {
  49. kxsync_device_type_none = 0,
  50. kxsync_device_type_xsync = 1,
  51. kxsync_device_type_puck_station = 2,
  52. kxsync_device_type_encoder = 3,
  53. } xsync_device_type_t;
  54. typedef enum {
  55. xsync_stm32_action_none = 0, //
  56. xsync_stm32_action_generator_new_mac = 1, //
  57. xsync_stm32_action_factory_reset = 2, //
  58. xsync_stm32_action_reboot = 3, //
  59. xsync_stm32_action_storage_cfg = 4, //
  60. } xsync_stm32_action_t;
  61. typedef enum {
  62. obtaining_ip_mode_type_static = 0,
  63. obtaining_ip_mode_type_dhcp = 1,
  64. } obtaining_ip_mode_t;
  65. } // namespace xsync