-
Notifications
You must be signed in to change notification settings - Fork 1
/
UbxMonMsg.h
52 lines (40 loc) · 1.31 KB
/
UbxMonMsg.h
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
#ifndef __AUBXLIB_MONMSG_H_
#define __AUBXLIB_MONMSG_H_
#include "Arduino.h"
/* ****************************************************************************
UBX MON class message definitions.
****************************************************************************/
/* ************************************************************************* */
struct UbxMonVerPayload {
byte swVersion[30] = { 0 };
byte hwVersion[10] = { 0 };
// byte romVersion[30] = { 0 };
};
class UbxMonVer: public UbxPacket {
public:
UbxMonVerPayload pl;
UbxMonVer () {
h.msgClsID = UBX_MON_VER;
h.length = 40; // MINIMUM!
};
UbxMonVer (byte* buffer, unsigned short len) {
h.msgClsID = UBX_MON_VER;
h.length = len - 8;
if (len >= 48) {
for (unsigned short bc = 6; bc < 36; bc++) {
pl.swVersion[bc - 6] = buffer[bc];
};
for (unsigned short bc = 36; bc < 46; bc++) {
pl.hwVersion[bc - 36] = buffer[bc];
};
}
// if (len >= 78) {
// for (unsigned short bc = 46; bc < 76; bc++) {
// pl.romVersion[bc - 46] = buffer[bc];
// };
// }
bufferToChecksum (buffer, len - 2, &checksum);
valid = isChecksumValid (buffer, 2, h.length + 4, checksum);
};
};
#endif