Skip to content

Commit eba8063

Browse files
committed
Add more support for UBX-RXM-PMP
1 parent 4cad56b commit eba8063

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

src/SparkFun_u-blox_GNSS_Arduino_Library.h

+11-1
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,8 @@ const uint8_t UBX_NAV_AOPSTATUS = 0x60; //AssistNow Autonomous status
375375
//Class: RXM
376376
//The following are used to configure the RXM UBX messages (receiver manager messages). Descriptions from UBX messages overview (ZED_F9P Interface Description Document page 36)
377377
const uint8_t UBX_RXM_MEASX = 0x14; //Satellite Measurements for RRLP
378-
const uint8_t UBX_RXM_PMREQ = 0x41; //Requests a Power Management task (two differenent packet sizes)
378+
const uint8_t UBX_RXM_PMREQ = 0x41; //Requests a Power Management task (two different packet sizes)
379+
const uint8_t UBX_RXM_PMP = 0x72; //PMP raw data (two different versions) (packet size for version 0x01 is variable)
379380
const uint8_t UBX_RXM_RAWX = 0x15; //Multi-GNSS Raw Measurement Data
380381
const uint8_t UBX_RXM_RLM = 0x59; //Galileo SAR Short-RLM report (two different packet sizes)
381382
const uint8_t UBX_RXM_RTCM = 0x32; //RTCM input status
@@ -1070,6 +1071,13 @@ class SFE_UBLOX_GNSS
10701071

10711072
// Receiver Manager Messages (RXM)
10721073

1074+
// Configure a callback for the UBX-RXM-PMP messages produced by the NEO-D9S
1075+
// Note: on the NEO-D9S, the UBX-RXM-PMP messages are enabled by default on all ports.
1076+
// You can disable them by calling (e.g.) setVal8(UBLOX_CFG_MSGOUT_UBX_RXM_PMP_I2C, 0)
1077+
// The NEO-D9S does not support UBX-CFG-MSG
1078+
bool setAutoRXMPMPcallback(void (*callbackPointer)(UBX_RXM_PMP_data_t), uint16_t maxWait = defaultMaxWait); // Callback is passed all of the data. Heavy on the stack. May cause problems on some platforms.
1079+
bool setAutoRXMPMPcallbackPtr(void (*callbackPointerPtr)(UBX_RXM_PMP_data_t *), uint16_t maxWait = defaultMaxWait); // Callback receives a pointer to the data, instead of _all_ the data. Much kinder on the stack!
1080+
10731081
bool getRXMSFRBX(uint16_t maxWait = defaultMaxWait); // RXM SFRBX
10741082
bool setAutoRXMSFRBX(bool enabled, uint16_t maxWait = defaultMaxWait); //Enable/disable automatic RXM SFRBX reports at the navigation frequency
10751083
bool setAutoRXMSFRBX(bool enabled, bool implicitUpdate, uint16_t maxWait = defaultMaxWait); //Enable/disable automatic RXM SFRBX reports at the navigation frequency, with implicitUpdate == false accessing stale data will not issue parsing of data in the rxbuffer of your interface, instead you have to call checkUblox when you want to perform an update
@@ -1385,6 +1393,7 @@ class SFE_UBLOX_GNSS
13851393
UBX_NAV_RELPOSNED_t *packetUBXNAVRELPOSNED = NULL; // Pointer to struct. RAM will be allocated for this if/when necessary
13861394
UBX_NAV_AOPSTATUS_t *packetUBXNAVAOPSTATUS = NULL; // Pointer to struct. RAM will be allocated for this if/when necessary
13871395

1396+
UBX_RXM_PMP_t *packetUBXRXMPMP = NULL; // Pointer to struct. RAM will be allocated for this if/when necessary
13881397
UBX_RXM_SFRBX_t *packetUBXRXMSFRBX = NULL; // Pointer to struct. RAM will be allocated for this if/when necessary
13891398
UBX_RXM_RAWX_t *packetUBXRXMRAWX = NULL; // Pointer to struct. RAM will be allocated for this if/when necessary
13901399

@@ -1472,6 +1481,7 @@ class SFE_UBLOX_GNSS
14721481
bool initPacketUBXNAVSAT(); // Allocate RAM for packetUBXNAVSAT and initialize it
14731482
bool initPacketUBXNAVRELPOSNED(); // Allocate RAM for packetUBXNAVRELPOSNED and initialize it
14741483
bool initPacketUBXNAVAOPSTATUS(); // Allocate RAM for packetUBXNAVAOPSTATUS and initialize it
1484+
bool initPacketUBXRXMPMP(bool usePtr = false); // Allocate RAM for packetUBXRXMPMP and initialize it
14751485
bool initPacketUBXRXMSFRBX(); // Allocate RAM for packetUBXRXMSFRBX and initialize it
14761486
bool initPacketUBXRXMRAWX(); // Allocate RAM for packetUBXRXMRAWX and initialize it
14771487
bool initPacketUBXCFGRATE(); // Allocate RAM for packetUBXCFGRATE and initialize it

src/u-blox_structs.h

+10-3
Original file line numberDiff line numberDiff line change
@@ -1464,21 +1464,27 @@ typedef struct
14641464
} UBX_RXM_RAWX_t;
14651465

14661466
// UBX-RXM-PMP (0x02 0x72): PMP raw data (D9 modules)
1467+
// There are two versions of this message but, fortunately, both have a max len of 528
14671468
const uint16_t UBX_RXM_PMP_MAX_LEN = 528;
14681469

14691470
typedef struct
14701471
{
1471-
uint8_t version; // Message version (0x00 for this version)
1472-
uint8_t reserved0[3]; // Reserved
1472+
uint8_t version; // Message version (0x00 / 0x01)
1473+
uint8_t reserved0; // Reserved
1474+
uint16_t numBytesUserData; // version 0x00: reserved0 ; version 0x01: Number of bytes the userData block has in this frame (0...504)
14731475
uint32_t timeTag; // Time since startup when frame started : ms
14741476
uint32_t uniqueWord[2]; // Received unique words
14751477
uint16_t serviceIdentifier; // Received service identifier
14761478
uint8_t spare; // Received spare data
14771479
uint8_t uniqueWordBitErrors; // Number of bit errors in both unique words
1478-
uint8_t userData[504]; // Received user data
1480+
1481+
// The position of fecBits, ebno and reserved1 depends on the message version
14791482
uint16_t fecBits; // Number of bits corrected by FEC (forward error correction)
14801483
uint8_t ebno; // Energy per bit to noise power spectral density ratio : 2^-3 dB
14811484
uint8_t reserved1; // Reserved
1485+
1486+
uint8_t userData[504]; // Received user data: version 0x00 : starts at byte 20 ; version 0x01 : starts at byte 24
1487+
14821488
} UBX_RXM_PMP_data_t;
14831489

14841490
typedef struct
@@ -1487,6 +1493,7 @@ typedef struct
14871493
UBX_RXM_PMP_data_t data;
14881494
bool moduleQueried;
14891495
void (*callbackPointer)(UBX_RXM_PMP_data_t);
1496+
void (*callbackPointerPtr)(UBX_RXM_PMP_data_t *);
14901497
UBX_RXM_PMP_data_t *callbackData;
14911498
} UBX_RXM_PMP_t;
14921499

0 commit comments

Comments
 (0)