40 lines
1.1 KiB
C
40 lines
1.1 KiB
C
/**
|
|
* @file datarouter_config.h
|
|
* @brief 数据路由默认配置
|
|
*
|
|
* 这是库内置的默认配置,提供示例能力声明。
|
|
* 用户可自定义此文件以实现自己的报文类型:
|
|
*
|
|
* 1. 复制当前文件到你的项目目录
|
|
* 2. 按需修改 DR_SEND_CAPABILITIES / DR_RECV_CAPABILITIES
|
|
* 3. 编译时添加 -I /path/to/your/config 覆盖库的默认配置
|
|
*
|
|
* 覆盖后库将使用你的版本,无需修改库源代码。
|
|
*/
|
|
|
|
#ifndef DR_CONFIG_H
|
|
#define DR_CONFIG_H
|
|
|
|
/**
|
|
* @def DR_SEND_CAPABILITIES
|
|
* @brief 发送能力列表
|
|
*
|
|
* 每行格式:DR_SEND(标识符, "描述")
|
|
* 每项生成:发送触发函数 dr_send_<id>(port, data, len)
|
|
*/
|
|
#define DR_SEND_CAPABILITIES \
|
|
DR_SEND(sensor, "Sensor data report") \
|
|
DR_SEND(status, "Device status report")
|
|
|
|
/**
|
|
* @def DR_RECV_CAPABILITIES
|
|
* @brief 接收能力列表
|
|
*
|
|
* 每行格式:DR_RECV(标识符, "描述")
|
|
* 每项生成:接收回调声明 dr_on_recv_<id>(port, data, len)
|
|
*/
|
|
#define DR_RECV_CAPABILITIES \
|
|
DR_RECV(rtcm, "RTCM correction data") \
|
|
DR_RECV(command, "Remote control command")
|
|
|
|
#endif /* DR_CONFIG_H */ |