diff --git a/Udral/magnetometer.cpp b/Udral/magnetometer.cpp index 4189e37..ef52f64 100644 --- a/Udral/magnetometer.cpp +++ b/Udral/magnetometer.cpp @@ -4,15 +4,15 @@ #include "magnetometer.hpp" -namespace cyphal { +namespace cyphal::udral { -void MagneticFieldPublisher::publish(const uavcan_si_sample_magnetic_field_strength_Vector3_1_0& msg) { - static uint8_t buffer[uavcan_si_sample_magnetic_field_strength_Vector3_1_0_EXTENT_BYTES_]; - size_t buffer_size = uavcan_si_sample_magnetic_field_strength_Vector3_1_0_EXTENT_BYTES_; - int32_t result = uavcan_si_sample_magnetic_field_strength_Vector3_1_0_serialize_(&msg, buffer, &buffer_size); +void MagneticFieldPublisher::publish(const uavcan_si_sample_magnetic_field_strength_Vector3_1_1& msg) { + static uint8_t buffer[uavcan_si_sample_magnetic_field_strength_Vector3_1_1_EXTENT_BYTES_]; + size_t buffer_size = uavcan_si_sample_magnetic_field_strength_Vector3_1_1_EXTENT_BYTES_; + int32_t result = uavcan_si_sample_magnetic_field_strength_Vector3_1_1_serialize_(&msg, buffer, &buffer_size); if (NUNAVUT_SUCCESS == result) { push(buffer_size, buffer); } } -} // namespace cyphal +} // namespace cyphal::udral diff --git a/Udral/magnetometer.hpp b/Udral/magnetometer.hpp index a92fb52..66408f6 100644 --- a/Udral/magnetometer.hpp +++ b/Udral/magnetometer.hpp @@ -6,15 +6,15 @@ #define UDRAL_MAGNETOMETER_HPP_ #include "cyphal.hpp" -#include "uavcan/si/sample/magnetic_field_strength/Vector3_1_0.h" +#include "uavcan/si/sample/magnetic_field_strength/Vector3_1_1.h" -namespace cyphal { +namespace cyphal::udral { struct MagneticFieldPublisher: public CyphalPublisher { - MagneticFieldPublisher(Cyphal* driver_, CanardPortID port_id) : CyphalPublisher(driver_, port_id) {}; - void publish(const uavcan_si_sample_magnetic_field_strength_Vector3_1_0& msg); + MagneticFieldPublisher() : CyphalPublisher(Cyphal::get_instance(), 65535) {} + void publish(const uavcan_si_sample_magnetic_field_strength_Vector3_1_1& msg); }; -} // namespace cyphal +} // namespace cyphal::udral #endif // UDRAL_MAGNETOMETER_HPP_