Skip to content

Commit 8bc735e

Browse files
Added CfgVALDEL, CfgVALGET & CfgVALSET messages (#218)
* Added CfgVALDEL, CfgVALGET & CfgVALSET messages Co-authored-by: Brandon <[email protected]>
1 parent 6fe76fd commit 8bc735e

File tree

8 files changed

+205
-0
lines changed

8 files changed

+205
-0
lines changed

ublox_msgs/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ set(msg_files
4242
"msg/CfgSBAS.msg"
4343
"msg/CfgTMODE3.msg"
4444
"msg/CfgUSB.msg"
45+
"msg/CfgVALDEL.msg"
46+
"msg/CfgVALGET.msg"
47+
"msg/CfgVALSET.msg"
48+
"msg/CfgVALSETCfgdata.msg"
4549
"msg/EsfINS.msg"
4650
"msg/EsfMEAS.msg"
4751
"msg/EsfRAWBlock.msg"

ublox_msgs/include/ublox_msgs/serialization.hpp

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -894,6 +894,120 @@ struct UbloxSerializer<ublox_msgs::msg::CfgTMODE3_<ContainerAllocator> > {
894894
}
895895
};
896896

897+
///
898+
/// @brief Serializes the CfgVALDEL message which has a repeated block.
899+
///
900+
template <typename ContainerAllocator>
901+
struct UbloxSerializer<ublox_msgs::msg::CfgVALDEL_<ContainerAllocator> > {
902+
inline static void read(const uint8_t *data, uint32_t count,
903+
ublox_msgs::msg::CfgVALDEL_<ContainerAllocator> &m) {
904+
UbloxIStream stream(const_cast<uint8_t *>(data), count);
905+
stream.next(m.version);
906+
stream.next(m.layers);
907+
stream.next(m.reserved0[0]);
908+
stream.next(m.reserved0[1]);
909+
for (std::size_t i = 0; i < m.keys.size(); ++i) {
910+
deserialize(stream, m.keys[i]);
911+
}
912+
}
913+
914+
inline static uint32_t serializedLength(const ublox_msgs::msg::CfgVALDEL_<ContainerAllocator> &m) {
915+
return 4 + 4 * m.keys.size();
916+
}
917+
918+
inline static void write(const uint8_t *data, uint32_t count,
919+
const ublox_msgs::msg::CfgVALDEL_<ContainerAllocator> &m) {
920+
UbloxOStream stream(const_cast<uint8_t *>(data), count);
921+
stream.next(m.version);
922+
stream.next(m.layers);
923+
stream.next(m.reserved0[0]);
924+
stream.next(m.reserved0[1]);
925+
for (std::size_t i = 0; i < m.keys.size(); ++i) {
926+
serialize(stream, m.keys[i]);
927+
}
928+
}
929+
};
930+
931+
///
932+
/// @brief Serializes the CfgVALGET message which has a repeated block.
933+
///
934+
template <typename ContainerAllocator>
935+
struct UbloxSerializer<ublox_msgs::msg::CfgVALGET_<ContainerAllocator> > {
936+
inline static void read(const uint8_t *data, uint32_t count,
937+
ublox_msgs::msg::CfgVALGET_<ContainerAllocator> &m) {
938+
UbloxIStream stream(const_cast<uint8_t *>(data), count);
939+
stream.next(m.version);
940+
stream.next(m.layers);
941+
stream.next(m.position);
942+
uint8_t data_size = (count - 4) / 4;
943+
m.keys.resize(data_size);
944+
// the key and values are all together in the keys array
945+
for (std::size_t i = 0; i < data_size; ++i) {
946+
deserialize(stream, m.keys[i]);
947+
}
948+
}
949+
950+
inline static uint32_t serializedLength(const ublox_msgs::msg::CfgVALGET_<ContainerAllocator> &m) {
951+
return 4 + 4 * m.keys.size();
952+
}
953+
954+
inline static void write(const uint8_t *data, uint32_t count,
955+
const ublox_msgs::msg::CfgVALGET_<ContainerAllocator> &m) {
956+
UbloxOStream stream(const_cast<uint8_t *>(data), count);
957+
stream.next(m.version);
958+
stream.next(m.layers);
959+
stream.next(m.position);
960+
for (std::size_t i = 0; i < m.keys.size(); ++i) {
961+
serialize(stream, m.keys[i]);
962+
}
963+
}
964+
};
965+
966+
///
967+
/// @brief Serializes the CfgVALSET message which has a repeated block.
968+
///
969+
template <typename ContainerAllocator>
970+
struct UbloxSerializer<ublox_msgs::msg::CfgVALSET_<ContainerAllocator> > {
971+
inline static void read(const uint8_t *data, uint32_t count,
972+
ublox_msgs::msg::CfgVALSET_<ContainerAllocator> &m) {
973+
UbloxIStream stream(const_cast<uint8_t *>(data), count);
974+
stream.next(m.version);
975+
stream.next(m.layers);
976+
stream.next(m.reserved0[0]);
977+
stream.next(m.reserved0[1]);
978+
for (std::size_t i = 0; i < m.cfgdata.size(); ++i) {
979+
deserialize(stream, m.cfgdata[i].key);
980+
for (std::size_t j = 0; j < m.cfgdata[i].data.size(); ++j) {
981+
deserialize(stream, m.cfgdata[i].data[j]);
982+
}
983+
}
984+
}
985+
986+
inline static uint32_t serializedLength(const ublox_msgs::msg::CfgVALSET_<ContainerAllocator> &m) {
987+
int data_size = 0;
988+
for (std::size_t i = 0; i < m.cfgdata.size(); ++i) {
989+
data_size += m.cfgdata[i].data.size();
990+
data_size += 4;
991+
}
992+
return 4 + data_size;
993+
}
994+
995+
inline static void write(const uint8_t *data, uint32_t count,
996+
const ublox_msgs::msg::CfgVALSET_<ContainerAllocator> &m) {
997+
UbloxOStream stream(const_cast<uint8_t *>(data), count);
998+
stream.next(m.version);
999+
stream.next(m.layers);
1000+
stream.next(m.reserved0[0]);
1001+
stream.next(m.reserved0[1]);
1002+
for (std::size_t i = 0; i < m.cfgdata.size(); ++i) {
1003+
serialize(stream, m.cfgdata[i].key);
1004+
for (std::size_t j = 0; j < m.cfgdata[i].data.size(); ++j) {
1005+
serialize(stream, m.cfgdata[i].data[j]);
1006+
}
1007+
}
1008+
}
1009+
};
1010+
8971011
template <typename ContainerAllocator>
8981012
struct UbloxSerializer<ublox_msgs::msg::EsfINS_<ContainerAllocator> > {
8991013
inline static void read(const uint8_t *data, uint32_t count,

ublox_msgs/include/ublox_msgs/ublox_msgs.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@
8585
#include <ublox_msgs/msg/cfg_sbas.hpp>
8686
#include <ublox_msgs/msg/cfg_tmode3.hpp>
8787
#include <ublox_msgs/msg/cfg_usb.hpp>
88+
#include <ublox_msgs/msg/cfg_valdel.hpp>
89+
#include <ublox_msgs/msg/cfg_valget.hpp>
90+
#include <ublox_msgs/msg/cfg_valset.hpp>
91+
#include <ublox_msgs/msg/cfg_valset_cfgdata.hpp>
8892

8993
#include <ublox_msgs/msg/upd_sos.hpp>
9094
#include <ublox_msgs/msg/upd_sos_ack.hpp>
@@ -223,6 +227,9 @@ namespace Message {
223227
static const uint8_t SBAS = ublox_msgs::msg::CfgSBAS::MESSAGE_ID;
224228
static const uint8_t TMODE3 = ublox_msgs::msg::CfgTMODE3::MESSAGE_ID;
225229
static const uint8_t USB = ublox_msgs::msg::CfgUSB::MESSAGE_ID;
230+
static const uint8_t VALDEL = ublox_msgs::msg::CfgVALDEL::MESSAGE_ID;
231+
static const uint8_t VALGET = ublox_msgs::msg::CfgVALGET::MESSAGE_ID;
232+
static const uint8_t VALSET = ublox_msgs::msg::CfgVALSET::MESSAGE_ID;
226233
} // namespace CFG
227234

228235
namespace UPD {

ublox_msgs/msg/CfgVALDEL.msg

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# CFG-VALDEL (0x06 0x8c)
2+
# Delete configuration item values
3+
#
4+
# This message is used to delete saved configurations to effectively revert the items values to
5+
# defaults. Maximum of 64 Key IDs.
6+
#
7+
8+
uint8 CLASS_ID = 6
9+
uint8 MESSAGE_ID = 140
10+
11+
uint8 version # Message Version (0x00 for this version)
12+
13+
uint8 layers # Bit mask: the layers where the configuration should be applied
14+
uint8 LAYER_BBR = 1 # BBR layer
15+
uint8 LAYER_FLASH = 2 # Flash Layer
16+
17+
uint8[2] reserved0
18+
19+
# Start of repeated block
20+
uint32[] keys # Configuration key IDs of configuration items to be retrieved
21+
# End of repeated block

ublox_msgs/msg/CfgVALGET.msg

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# CFG-VALGET (0x06 0x8b)
2+
# Get configuration items
3+
#
4+
# This message is used to get configuration values by providing a list of configuration key IDs,
5+
# which identify the configuration items to retrieve. Maximum of 64 Key IDs.
6+
#
7+
8+
uint8 CLASS_ID = 6
9+
uint8 MESSAGE_ID = 139
10+
11+
uint8 version # Message Version (0x00 for this version)
12+
13+
uint8 layers # The layer which the configuration items should be retrieved
14+
uint8 LAYER_RAM = 0 # RAM layer
15+
uint8 LAYER_BBR = 1 # BBR layer
16+
uint8 LAYER_FLASH = 2 # Flash Layer
17+
uint8 LAYER_DEFAULT = 7 # Default Layer
18+
19+
uint16 position # Skip this many key values before constructing output message
20+
21+
# Start of repeated block
22+
uint32[] keys # Configuration key IDs of configuration items to be retrieved
23+
# End of repeated block

ublox_msgs/msg/CfgVALSET.msg

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# CFG-VALSET (0x06 0x8a)
2+
# Set configuration item values
3+
#
4+
# This message is used to set a configuration by providing configuration data ( a list of
5+
# key and value pairs), which identify the configuration items to change, and their new values.
6+
# Maximum of 64 Key IDs.
7+
#
8+
9+
uint8 CLASS_ID = 6
10+
uint8 MESSAGE_ID = 138
11+
12+
uint8 version # Message Version (0x00 for this version)
13+
14+
uint8 layers # Bit mask: the layers where the configuration should be applied
15+
uint8 LAYER_RAM = 1 # RAM layer
16+
uint8 LAYER_BBR = 2 # BBR layer
17+
uint8 LAYER_FLASH = 4 # Flash Layer
18+
19+
uint8[2] reserved0
20+
21+
# Start of repeated block
22+
CfgVALSETCfgdata[] cfgdata # Configuration data (key and value pairs)
23+
# End of repeated block
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# See Cfg-VALSET
2+
#
3+
4+
uint32 key # Key for configuration item being changed
5+
6+
uint8[] data # Data for configuration item being changed,
7+
# array can be of length 1 - 8 (i.e. 1 - 8 bytes long)

ublox_msgs/src/ublox_msgs.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,12 @@ DECLARE_UBLOX_MESSAGE(ublox_msgs::Class::CFG, ublox_msgs::Message::CFG::TMODE3,
160160
ublox_msgs, CfgTMODE3)
161161
DECLARE_UBLOX_MESSAGE(ublox_msgs::Class::CFG, ublox_msgs::Message::CFG::USB,
162162
ublox_msgs, CfgUSB)
163+
DECLARE_UBLOX_MESSAGE(ublox_msgs::Class::CFG, ublox_msgs::Message::CFG::VALDEL,
164+
ublox_msgs, CfgVALDEL);
165+
DECLARE_UBLOX_MESSAGE(ublox_msgs::Class::CFG, ublox_msgs::Message::CFG::VALGET,
166+
ublox_msgs, CfgVALGET);
167+
DECLARE_UBLOX_MESSAGE(ublox_msgs::Class::CFG, ublox_msgs::Message::CFG::VALSET,
168+
ublox_msgs, CfgVALSET);
163169

164170
DECLARE_UBLOX_MESSAGE(ublox_msgs::Class::UPD, ublox_msgs::Message::UPD::SOS,
165171
ublox_msgs, UpdSOS)

0 commit comments

Comments
 (0)