@ -61,7 +61,7 @@ recv_topics = [s.short_name for idx, s in enumerate(spec) if scope[idx] == MsgSc
@@ -61,7 +61,7 @@ recv_topics = [s.short_name for idx, s in enumerate(spec) if scope[idx] == MsgSc
#include <ctime>
#include <pthread.h>
#include <microcdr/microC dr.h>
#include <microcdr/microc dr.h>
#include <px4_time.h>
#include <uORB/uORB.h>
@ -90,13 +90,10 @@ void* send(void* /*unused*/)
@@ -90,13 +90,10 @@ void* send(void* /*unused*/)
orb_set_interval(fds[@(idx)], _options.update_time_ms);
@[end for]@
// m icroBuffer to serialized using the user defined buffer
struct microBuffer m icroBufferWriter;
// M icroBuffer to serialized using the user defined buffer
MicroBuffer M icroBufferWriter;
header_length=transport_node->get_header_length();
initStaticAlignedBuffer(&data_buffer[header_length], BUFFER_SIZE-header_length, µBufferWriter);
// microCDR structs for managing the microBuffer
struct microCDR microCDRWriter;
initMicroCDR(µCDRWriter, µBufferWriter);
init_micro_buffer(&MicroBufferWriter, (uint8_t*)&data_buffer[header_length], BUFFER_SIZE - header_length);
struct timespec begin;
px4_clock_gettime(CLOCK_REALTIME, &begin);
@ -113,7 +110,7 @@ void* send(void* /*unused*/)
@@ -113,7 +110,7 @@ void* send(void* /*unused*/)
// copy raw data into local buffer
if (orb_copy(ORB_ID(@(topic)), fds[@(idx)], &data) == 0) {
/* payload is shifted by header length to make room for header*/
serialize_@(topic)(&data, &data_buffer[header_length], &length, µCDRWriter );
serialize_@(topic)(&MicroBufferWriter, & data, &data_buffer[header_length], &length);
if (0 < (read = transport_node->write((char)@(message_id(topic)), data_buffer, length)))
{
@ -167,12 +164,9 @@ void micrortps_start_topics(struct timespec &begin, int &total_read, uint32_t &r
@@ -167,12 +164,9 @@ void micrortps_start_topics(struct timespec &begin, int &total_read, uint32_t &r
orb_advert_t @(topic)_pub = nullptr;
@[end for]@
// microBuffer to deserialized using the user defined buffer
struct microBuffer microBufferReader;
initDeserializedAlignedBuffer(data_buffer, BUFFER_SIZE, µBufferReader);
// microCDR structs for managing the microBuffer
struct microCDR microCDRReader;
initMicroCDR(µCDRReader, µBufferReader);
// MicroBuffer to deserialized using the user defined buffer
MicroBuffer MicroBufferReader;
init_micro_buffer(&MicroBufferReader, (uint8_t*)data_buffer, BUFFER_SIZE);
@[end if]@
px4_clock_gettime(CLOCK_REALTIME, &begin);
@ -195,7 +189,7 @@ void micrortps_start_topics(struct timespec &begin, int &total_read, uint32_t &r
@@ -195,7 +189,7 @@ void micrortps_start_topics(struct timespec &begin, int &total_read, uint32_t &r
@[for topic in recv_topics]@
case @(message_id(topic)):
{
deserialize_@(topic)(&@(topic)_data, data_buffer, µCDRRead er);
deserialize_@(topic)(&MicroBufferReader, & @(topic)_data, data_buffer);
if (!@(topic)_pub) {
@(topic)_pub = orb_advertise(ORB_ID(@(topic)), &@(topic)_data);
} else {