Host.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2021-12-01 19813 the first version
  9. */
  10. #ifndef APPLICATIONS_HOST_HOST_H_
  11. #define APPLICATIONS_HOST_HOST_H_
  12. #include "loar.h"
  13. #include "stm32g0xx_hal.h"
  14. #include "gprs.h"
  15. #include "at_client.h"
  16. #include <easyflash.h>
  17. #include "wwdg.h"
  18. uint8_t Host_Service(void);
  19. uint8_t Matching_service(void);
  20. uint8_t Pairing_response(void);
  21. uint8_t slave_check(uint16_t time_point);
  22. void Time_fine_tuning(uint8_t type, uint8_t value ,uint8_t address);
  23. extern void format_uartbuf(uint8_t uart);
  24. void RTC_time_synchronization(uint8_t address);
  25. uint16_t slave_json_format(char *buff , uint8_t address);
  26. uint8_t Data_fill(void);
  27. void LED_buling(uint16_t speed , uint8_t excute_time);
  28. void him_page1(uint8_t type);
  29. void use_match_cfg(uint8_t Type);
  30. void log_w_slave(uint8_t addr);
  31. uint8_t send_s_fw(uint8_t addr);
  32. uint8_t send_s_fw_process(void);
  33. void reply_fw(uint8_t packet , uint8_t part);
  34. //存放配对的从机信息 从0开始
  35. typedef struct
  36. {
  37. uint8_t ID[4]; //存放从机的ID
  38. uint8_t Address; //存放从机地址
  39. // uint8_t Sstate ; //存放从机在线标志
  40. // uint8_t Svbat ; //存放从机电量信息
  41. } Loar_Device;
  42. //存放从机上报的数据 从1开始
  43. typedef struct
  44. {
  45. uint8_t Address; //存放从机地址
  46. char eValue[MAX_SENSOR_NUM][7]; //传感器字符串形式数据
  47. char imei[15]; //imei
  48. char volt[5]; //电压
  49. uint8_t saved; //数据是否填充标记位
  50. char CSQ[4]; //信号质量
  51. char SNR[4]; //本次接收的信噪比
  52. char Version[4]; //从机版本号
  53. uint8_t ver; //版本号数字版
  54. } Loar_Device_Data;
  55. #endif /* APPLICATIONS_HOST_HOST_H_ */