Hi,

I'm trying to write raw data thorugh TCPSocket. I have a struct like (Modbus protocol):
Qt Code:
  1. //Modbus header
  2. typedef struct MB_Request
  3. {
  4. uchar function_code;
  5. quint16 start_adr;
  6. quint16 quantity_regs;
  7. };
  8.  
  9. //Modbus/TCP header, containing the Modbus header
  10. typedef struct MBAP_Header
  11. {
  12. quint16 transaction_id;
  13. quint16 protocol_id;
  14. quint16 len;
  15. uchar unit_id;
  16. };
  17.  
  18. typedef struct MB_Message
  19. {
  20. MBAP_Header mb_hdr;
  21. MB_Request mb_req;
  22. };
To copy to clipboard, switch view to plain text mode 

What I don't know is how to send a variable (MB_Message type) as raw data. The documentation show that the data have to be stored as "char *". How have I to do this?

Thanks,