从中找出数据的头,然后读取数据
if (readeddatabuffer.count >= 20)
{
int removecount = 0;
for (int i = 0; i < readeddatabuffer.count - 18; ++i)
{
// 14 7b节点
if (readeddatabuffer[i] == 0xfd & readeddatabuffer[i + 4] == 0x28 & readeddatabuffer[i + 5] == 0x7b)
{
byte[] data = new byte[20];
/*节点*/
int data31, data32;
double v3, t3;
data31 = readeddatabuffer[i + 12];//高八位
data32 = readeddatabuffer[i + 13];//低八位
v3 = (data31 * 256 + data32);//电压值
t3 = -39.66 + 0.01 * v3 + 0.026;
tcure = t3;
wendu = t3.tostring();
}
removecount++;
}
}