Skip to content

Commit

Permalink
update mag from Vector3.1.0 to Vector3.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
PonomarevDA committed May 2, 2024
1 parent a131afb commit f26aacb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions Udral/magnetometer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 5 additions & 5 deletions Udral/magnetometer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_

0 comments on commit f26aacb

Please sign in to comment.