| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- /*
- * Copyright (c) 2006-2021, RT-Thread Development Team
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Change Logs:
- * Date Author Notes
- * 2025-12-15 RuoFeng the first version
- */
- #ifndef APPLICATIONS_PROTOCOL_GB_H_
- #define APPLICATIONS_PROTOCOL_GB_H_
- /*********************↓ define ↓************************/
- /*********************↑ define ↑************************/
- /**
- *
- *
- *
- *
- * */
- /*********************↓ include ↓************************/
- // #include <main.h>
- #include <rtthread.h>
- #include "cJSON.h"
- /*********************↑ include ↑************************/
- /**
- *
- *
- *
- *
- * */
- /*********************↓ extern ↓************************/
- #ifdef __cplusplus
- extern "C" {
- #endif
- /*********************↑ extern ↑************************/
- /**
- *
- *
- *
- *
- * */
- /********************↓ declaration ↓***********************/
- /**
- * @brief 生成OB帧(观测数据)
- * @return cJSON对象,需要调用者释放
- */
- cJSON* generate_ob_frame(char issupp);
- /**
- * @brief 生成ME帧(元数据)
- * @param firmware 固件版本
- * @return cJSON对象,需要调用者释放
- */
- cJSON* generate_me_frame(void);
- /**
- * @brief 生成ST帧(状态数据)
- * @return cJSON对象,需要调用者释放
- */
- cJSON* generate_st_frame(void);
- /**
- * @brief 更新传感器状态和质控码
- */
- void update_sensor_status(void);
- /**
- * @brief 获取当前协议版本
- * @return 协议版本字符串
- */
- const char* get_protocol_version(void);
- /**
- * @brief 获取设备类型编码
- * @return 设备类型编码字符串
- */
- const char* get_device_type(void);
- /**
- * @brief 获取数据字典标识
- * @return 数据字典标识字符串
- */
- const char* get_data_dict(void);
- /********************↑ declaration ↑***********************/
- /**
- *
- *
- *
- *
- * */
- /*********************↓ global variables ↓************************/
- #ifndef FALSE
- #define FALSE 0
- #endif
- #ifndef TRUE
- #define TRUE 1
- #endif
- /*********************↑ global variables ↑************************/
- /**
- *
- *
- *
- *
- * */
- #ifdef __cplusplus
- }
- #endif
- #endif /* APPLICATIONS_PROTOCOL_GB_H_ */
|