This post is directly related to an earlier post I made
Sending C structs through TCP in C#
My next problem is receiving the appropriate response from the equipment. The documentation gives me the following code for the returned struct.
typedef struct{
/*This value represents if the API request to modify has been a success or not*/
return_t ret_val;
/*Error code indicating error details*/
error_t err_code;
/*Response object for GET type action*/
U8 payload[0];
}MsgResp;
My question is, how do I get the raw byte stream received over TCP into this struct? Again, my instinct tell me something to do with memcpy, but I don't know how this translates to C#.
I am also confused about the types return_t and error_t, so any insight into those would also be helpful.