📄 readpacketterminator.m
字号:
function cksum = ReadPacketTerminator(gps)
% ReadPacketTerminator Read the three byte sequence terminating a packet
global pid_dle_byte;
global pid_etx_byte;
% Read checksum byte. If it is equal to DLE, read (and discard) the
% following DLE.
cksum = fread(gps, 1);
if (pid_dle_byte == cksum)
d = fread(gps, 1);
if (pid_dle_byte ~= d)
error(['CKSUM == DLE, but DLE not repeated.']);
end
end
% Read the DLE and ETX that terminate this packet
byte = fread(gps, 1);
if (pid_dle_byte ~= byte)
ExpectedDataError(byte, pid_dle_byte);
end
byte = fread(gps, 1);
if (byte ~= pid_etx_byte)
ExpectedDataError(byte, pid_etx_byte);
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -