Skip to content

Commit

Permalink
Merge pull request #4 from ACRIOS-Systems/feature/add_rst
Browse files Browse the repository at this point in the history
Added RST request
  • Loading branch information
Hadatko committed Dec 5, 2023
2 parents 2d980c7 + 1d9a8ae commit 33f88d5
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 3 deletions.
15 changes: 14 additions & 1 deletion lang/cpp/src/messages/CFG.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// File lang/cpp/src/messages/CFG.cpp
// Auto-generated by pyUBX generateCPP.py v0.2 on 2023-06-07T13:38:14.189260
// Auto-generated by pyUBX generateCPP.py v0.2 on 2023-12-05T08:08:36.118865
// See https://github.com/mayeranalytics/pyUBX
// DO NOT MODIFY THIS FILE!

Expand Down Expand Up @@ -328,6 +328,19 @@ std::string ubx::CFG::RATE::getDescription(void) const {
}
uint8_t* ubx::CFG::RATE::getDataStartAddress(void) const { return (uint8_t*)&data; }
uint16_t ubx::CFG::RATE::getDataSize(void) const { return sizeof(data); }
uint8_t ubx::CFG::RST::getClassId(void) const { return ubx::CFG::classID; }
uint8_t ubx::CFG::RST::getMessageId(void) const { return messageID; }
const std::string &ubx::CFG::RST::getClassName(void) const { return classIDName; }
std::string ubx::CFG::RST::getMessageName(void) const { return std::string("RST"); };
std::string ubx::CFG::RST::getDescription(void) const {
std::stringstream ret;
ret << "{\"classId\":" << std::to_string(getClassId()) << ",\"messageId\":" << std::to_string(getMessageId()) << ",\"classIdName\":\"" << getClassName() << "\",\"messageIdName\":\"" << getMessageName() << "\"";
ret << ", \"navBbrMask\":" << std::to_string(data.navBbrMask) << ", \"resetMode\":" << std::to_string(data.resetMode) << ", \"reserved1\":" << "0";
ret << "}";
return ret.str();
}
uint8_t* ubx::CFG::RST::getDataStartAddress(void) const { return (uint8_t*)&data; }
uint16_t ubx::CFG::RST::getDataSize(void) const { return sizeof(data); }
uint8_t ubx::CFG::RXM::getClassId(void) const { return ubx::CFG::classID; }
uint8_t ubx::CFG::RXM::getMessageId(void) const { return messageID; }
const std::string &ubx::CFG::RXM::getClassName(void) const { return classIDName; }
Expand Down
48 changes: 47 additions & 1 deletion lang/cpp/src/messages/CFG.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// File lang/cpp/src/messages/CFG.hpp
// Auto-generated by pyUBX generateCPP.py v0.2 on 2023-06-07T13:38:14.187228
// Auto-generated by pyUBX generateCPP.py v0.2 on 2023-12-05T08:10:39.084429
// See https://github.com/mayeranalytics/pyUBX
// DO NOT MODIFY THIS FILE!

Expand Down Expand Up @@ -724,6 +724,52 @@ struct __attribute__((packed)) RATE : public SerializeCommon
} data;
};

/* 32.10.29.1 Reset receiver / Clear backup data structures
*
* Do not expect this message to be acknowledged by the receiver.
* • Newer FW version will not acknowledge this message at all.
* • Older FW version will acknowledge this message but the acknowledge may not
* be sent completely before the receiver is reset.
* Notes:
* • If Galileo is enabled, UBX-CFG-RST Controlled GNSS start must be followed by
* UBX-CFG-CFG to save current configuration to BBR and then by UBX-CFG-RST
* with resetMode set to Hardware reset.
* • If Galileo is enabled, use resetMode Hardware reset instead of Controlled
* software reset or Controlled software reset (GNSS only).
*/
struct __attribute__((packed)) RST : public SerializeCommon
{
virtual uint8_t getClassId(void) const override;
virtual uint8_t getMessageId(void) const override;
virtual const std::string &getClassName(void) const override;
virtual std::string getMessageName(void) const override;
virtual std::string getDescription(void) const override;
virtual uint8_t* getDataStartAddress(void) const override;
virtual uint16_t getDataSize(void) const override;

static constexpr uint8_t messageID = 4;

struct __attribute__((packed)) _data {
uint16_t navBbrMask;
uint8_t resetMode;
uint8_t reserved1;

enum _navBbrMask_allowed{
allowed_navBbrMask_HOT_START=0,
allowed_navBbrMask_WARM_START=1,
allowed_navBbrMask_COLD_START=65535,
};
enum _resetMode_allowed{
allowed_resetMode_HW=0,
allowed_resetMode_SW=1,
allowed_resetMode_SW_GNSS_ONLY=2,
allowed_resetMode_HW_AFTER_SHUTDOWN=3,
allowed_resetMode_STOP=8,
allowed_resetMode_START=9,
};
} data;
};

/* §31.11.27 RXM configuration.
*
* For a detailed description see section 'Power Management'.
Expand Down
7 changes: 6 additions & 1 deletion lang/cpp/src/parseUbxMessage.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// File lang/cpp/src/parseUbxMessage.cpp
// Auto-generated by pyUBX generateCPP.py v0.2 on 2023-06-07T13:38:14.201552
// Auto-generated by pyUBX generateCPP.py v0.2 on 2023-12-05T08:08:36.125575
// See https://github.com/mayeranalytics/pyUBX
// DO NOT MODIFY THIS FILE!
#include <cstring>
Expand Down Expand Up @@ -100,6 +100,11 @@ std::shared_ptr<SerializeCommon> ParseUbxMessage::createUbx(const uint8_t *buf,
ret = shared_ptr<CFG::RATE>(new CFG::RATE);
break;
}
case CFG::RST::messageID: // Message CFG-RST
{
ret = shared_ptr<CFG::RST>(new CFG::RST);
break;
}
case CFG::RXM::messageID: // Message CFG-RXM
{
ret = shared_ptr<CFG::RXM>(new CFG::RXM);
Expand Down
34 changes: 34 additions & 0 deletions ubx/UBX/CFG.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,40 @@ class Fields:
5: "NavIC time"
})

class RST:
u"""32.10.29.1 Reset receiver / Clear backup data structures
Do not expect this message to be acknowledged by the receiver.
• Newer FW version will not acknowledge this message at all.
• Older FW version will acknowledge this message but the acknowledge may not
be sent completely before the receiver is reset.
Notes:
• If Galileo is enabled, UBX-CFG-RST Controlled GNSS start must be followed by
UBX-CFG-CFG to save current configuration to BBR and then by UBX-CFG-RST
with resetMode set to Hardware reset.
• If Galileo is enabled, use resetMode Hardware reset instead of Controlled
software reset or Controlled software reset (GNSS only).
"""

_id = 0x04

class Fields:
navBbrMask = X2(1, allowed={
0:"HOT_START",
1:"WARM_START",
0xFFFF: "COLD_START"
})
resetMode = U1(2, allowed={
0:"HW",
1:"SW",
2:"SW_GNSS_ONLY",
3: "HW_AFTER_SHUTDOWN",
8: "STOP",
9: "START",
})
reserved1 = U1(3) # reserved


@addGet
class RXM:
u"""§31.11.27 RXM configuration.
Expand Down

0 comments on commit 33f88d5

Please sign in to comment.