eProsima / Micro-XRCE-DDS-Agent

Micro XRCE-DDS Agent respository. Looking for commercial support? Contact info@eprosima.com
Apache License 2.0
110 stars 77 forks source link

Cross Endian between XRCE-DDS Agent and XRCE-DDS Client #355

Closed kimsos0723 closed 10 months ago

kimsos0723 commented 10 months ago

hi, I try to porting on PowerPC t2080rdb the XRCE-Client I configured the Client to Big-endian and running SubscribeHelloWorld on ppc So result like-below

image

but the Agent read Xtype String length as Little-endian, even if submessage Header flag is 0x04

Did I do something wrong?

pablogs9 commented 10 months ago

Could you share a replicator?

kimsos0723 commented 10 months ago

I can't understand what replicator means. but I just changed the Client's and CDR's CMakeList CONFIG_BIG_ENDIANNESS options on

pablogs9 commented 10 months ago

Is correctly set the endianness flag on the ucdrBuffer structure?

void on_topic(
        uxrSession* session,
        uxrObjectId object_id,
        uint16_t request_id,
        uxrStreamId stream_id,
        struct ucdrBuffer* ub,
        uint16_t length,
        void* args)
{
    // Check this
    printf("ENDIANESS: %d\n", ub->endianness);

    (void) session; (void) object_id; (void) request_id; (void) stream_id; (void) length;

    HelloWorld topic;
    HelloWorld_deserialize_topic(ub, &topic);

.....
}
kimsos0723 commented 10 months ago

Here's what the client sees as the received message

image
kimsos0723 commented 10 months ago

The length of a string of type Xtype seems to be misread as a little-endian in the agent.

pablogs9 commented 10 months ago

Here's what the client sees as the received message image

Sorry, but I cannot retrieve enough information from this.

Some fixes were applied here: https://github.com/eProsima/Micro-XRCE-DDS-Agent/pull/336, could you confirm that using the binary creation API it works properly?

kimsos0723 commented 10 months ago

Oh, something changed, When I built the agent in the develop bench. ~The previous error condition has passed but raised seg fault in Agent~

It works from v2.4.2 ~It is the same with little-endian subscriber~

image

thank you for your dedication