你好,看了你的IRbaby 源码,对于红外nec编码我不是很熟,详细见peripherals.c的ir_send{
...
while (j < len) {
items[i].level0 = 1;
items[i].duration0 = data[j];
items[i].level1 = 0;
items[i].duration1 = data[j + 1];
i++;
j += 2;
}
....
}。目前我知道
一、NEC协议特征:
8位地址和8位命令长度
每次传输两遍地址(用户码)和命令(按键值)
通过脉冲串之间的时间间隔来实现信号的调制(PPM)
38Khz载波
每位的周期为1.12ms(低电平)或者2.25ms(高电平)
irext 返回回来的数据如下:
"entity": [
7730,
7670,
1100,
1140,
1100,
1140,
1100,
1140,
2210,
2240,
1100,
1140,
2210,
2240,
1100,
1140,
2210,
2240,
2210,
2240,
2210,
2240,
2210,
2240,
1100,
1140,
2210,
2240,
1100,
1140,
2210,
2240,
1100,
1140,
2210,
2240,
1100,
1140,
1100,
1140,
1100,
1140,
1100,
1140,
1100,
1140,
1100,
1140,
1100,
1140,
1100,
1140,
1100,
1140,
1100,
1140,
2210,
2240,
1100,
1140,
1100,
1140,
1100,
1140,
2210,
2240,
1100,
1140,
1100,
1140,
1100,
1140,
1100,
1140,
1100,
1140,
1100,
1140,
1100,
1140,
1100,
1140,
1100,
1140,
1100,
1140,
1100,
1140,
1100,
1140,
1100,
1140,
1100,
1140,
1100,
1140,
1100,
1140,
1100,
1140,
1100,
1140,
1100,
1140,
1100,
1140,
2210,
2240,
2210,
2240,
1100,
1140,
1100,
1140,
1100,
1140,
1100,
1140,
1100,
1140,
1100,
1140,
1100,
1140,
1100,
1140,
1100,
1140,
1100,
1140,
1100,
1140
]
请问这返回来的数据哪个是8位地址和8位命令长度? |