-
Notifications
You must be signed in to change notification settings - Fork 0
/
iq_acquire.proto
93 lines (81 loc) · 3.54 KB
/
iq_acquire.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
syntax = "proto3";
package zb.sensor.IQ; //c++:对应于zb::sensor::IQ命名空间
option java_multiple_files = true;
option java_package = "com.zb.sensor.IQ";
option java_outer_classname = "IQProto";
import "sensor.proto";
//时间触发参数
message TimeTriggerParams{
//触发类型
enum TimeTriggerType{
NONE = 0;
ABS_TIME = 0x2; //绝对时间
REL_TIME = 0x4; //相对时间
}
TimeTriggerType trigger_type = 1; //触发类型
Timestamp trigger_time = 2; //触发时刻
uint32 sweep_interval = 3; //扫描间隔,单位ms 大于500ms
uint32 segment_interval = 4; //频点间隔,单位ms 大于100ms
}
//幅度触发参数
message LevelTriggerParams{
//触发类型
enum LevelTriggerType{
NONE = 0;
LEVEL = 0x8; //幅度触发
RISING = 0x10; //上升沿触发
FALLING = 0x18; //下降沿触发
}
LevelTriggerType trigger_type = 1; //触发类型
float trigger_value = 2; //触发电平dBm(或升降幅度dB)
}
//IQ扫描参数
message IQSweepParams{
uint32 num_sweeps = 1; //扫描次数[0,max_uint32]
uint32 num_blocks = 2; //每个频点的扫描块个数[0,max_uint32]
uint32 num_transfer_samples = 3; //每个扫描块的采集点数[512,1024,2048]
bool header_only = 4; //是否只传header,在任务只存储而不关注实时结果时可以设置为true
TimeTriggerParams time_trigger_params = 5; //时间触发参数,可选项
repeated IQSegmentParams segment_params = 6; //要采集的频点
}
//IQ扫描的单频点参数
message IQSegmentParams{
double center_freq = 1; //中心频率,单位Hz[20MHz,6GHz]
double sample_rate = 2; //采样率,单位Hz[56M, 28M, 14M, 7M, 3.5M, 1.75M, 0.875M...]
int32 attenuation_gain = 3; //增益衰减[-30,20]
int32 antenna = 4; //天线选择[0,1]
LevelTriggerParams level_trigger_params = 5;//幅度触发参数,可选项
}
//启动IQ扫描的请求
message StartIQRequest{
repeated NodeDevice task_runner = 1; //任务执行单元
IQSweepParams sweep_params = 2; //扫描参数
}
//IQ扫描结果头
message IQResultHeader{
uint64 sequence_number = 1; //顺序号
uint64 segment_index = 2; //频点索引
uint64 sweep_index = 3; //扫描次数索引
double center_frequency = 4; //中心频率,单位Hz
double sample_rate = 5; //采样率,单位Hz
double scale_to_volts = 6; //电压比例尺,具体请参照文档换算
Timestamp time_stamp = 7; //时间戳
Position position = 8; //采集时所处的位置
}
//IQ结果
message IQResult{
NodeDevice result_from = 1; //结果来源
IQResultHeader header = 2; //结果头
repeated float data = 3; //IQ数据,I和Q值交叉排列,数组大小为 num_transfer_samples * 2
}
//IQ扫描API
service IQService
{
rpc Start(StartIQRequest) returns (TaskAccount) {} //启动任务
rpc GetResult(TaskId) returns (stream IQResult) {} //获取任务结果
rpc Stop(TaskId) returns (NodeReply) {} //停止任务
//advanced API
//record IQ sweep result
rpc RecordOn(TaskAccount) returns (NodeReply) {} //开启节点端的记录
rpc RecordOff(TaskAccount) returns (NodeReply) {} //关闭节点端的记录
}