Files
DataRouter/datarouter_config_template.h

51 lines
1.6 KiB
C

/**
* @file datarouter_config_template.h
* @brief 数据路由配置模板 —— 复制此文件到项目目录并修改
*
* 使用方法:
* 1. 将此文件复制到你的项目目录,重命名为 datarouter_config.h
* 2. 修改下面的 DR_SEND_CAPABILITIES 和 DR_RECV_CAPABILITIES
* 3. 编译时添加 -I /path/to/your/project
* 4. 库将自动使用你的配置,无需修改库源代码
*
* 格式说明:
* 发送能力:DR_SEND(标识符, "描述")
* 接收能力:DR_RECV(标识符, "描述")
*
* 标识符只能包含字母、数字、下划线。
* 描述为字符串字面量。
*
* 示例配置:
* // 传感器设备:只需发送
* #define DR_SEND_CAPABILITIES \
* DR_SEND(sensor, "Sensor data report")
* #define DR_RECV_CAPABILITIES
*
* // 遥控设备:只需接收
* #define DR_SEND_CAPABILITIES
* #define DR_RECV_CAPABILITIES \
* DR_RECV(command, "Remote command")
*
* // 网关设备:同时收发
* #define DR_SEND_CAPABILITIES \
* DR_SEND(status, "Status report")
* #define DR_RECV_CAPABILITIES \
* DR_RECV(config, "Configuration update")
*/
#ifndef DR_CONFIG_H
#define DR_CONFIG_H
/* ========== 在此声明你的发送能力 ========== */
#define DR_SEND_CAPABILITIES \
DR_SEND(sensor, "Sensor data report") \
DR_SEND(status, "Device status report")
/* ========== 在此声明你的接收能力 ========== */
#define DR_RECV_CAPABILITIES \
DR_RECV(rtcm, "RTCM correction data") \
DR_RECV(command, "Remote control command")
#endif /* DR_CONFIG_H */