📄 readprotocols.m
字号:
function protocols = ReadProtocols(gps)
% READPROTOCOLS Read the Protocol Capability Protocol data from the GPS
% Return a structure with two fields:
% tag: Character tag identifying protocol family
% id: Numeric protocol identifier (within family)
global pid_protocol_array pid_ack_byte;
protocols = [];
if (get(gps, 'BytesAvailable') > 0)
[id, sz] = ReadPacketHeader(gps);
if (id == pid_protocol_array)
for i=1:sz
protocols(i).tag = fread(gps, 1);
protocols(i).id = fread(gps, 1, 'int16');
end
end
cksum = ReadPacketTerminator(gps);
csum = ComputeChecksum(id, [protocols.tag protocols.id]);
WritePacket(gps, pid_ack_byte, 0);
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -