Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
BroadcastCommunity.qnx.com will be offline from May 31 6:00pm until June 2 12:00AM for upcoming system upgrades. For more information please go to https://community.qnx.com/sf/discussion/do/listPosts/projects.bazaar/discussion.bazaar.topc28418
Forum Topic - Endianness conversion .. done automatically?: Page 1 of 4 (4 Items)
   
Endianness conversion .. done automatically?  
Hi guys,

when using QNet to communicate between CPUs of differing endianness,
which endianness conversions are done automatically and which must I do myself?

As an example:
I want to send a proprietary message to the server. I build that message:
	reg_msg.io_msg_hdr.type = _IO_MSG;
	reg_msg.io_msg_hdr.combine_len = ...;
	reg_msg.io_msg_hdr.mgrid = _IOMGR_IO_...;
	reg_msg.io_msg_hdr.subtype = ...;
Those values are all uint16, so they need conversion.
This means that the Framework will convert these values, otherwise I couldn't check for the type on the destination CPU 
- correct? What about mgrid and subtype, are those converted as well?


What about registering and sending Pulses...?
I initialize the pulse using SIGEV_PULSE_INIT() and send it to the Server using MsgSend() with a special message type 
(proprietary). The pulse code will be the same on both CPUs, as it is 8 bits, so no problems with the endianness here.
What about the pulse value? Will it be swapped by the MsgDeliverEvent()? Usually it doesn't matter because the value has
 been set by the client before sending the event to the server. But in  our case we need to modify the value in the 
server. Will it be automatically endianness swapped when sending the pulse to the client?

Thanks & Greetings,
 Marc