send_data_to - using multiple structs?

Posted By: TehV

send_data_to - using multiple structs? - 02/14/15 23:10

So, the example shows how I can send custom data by defining and transferring a struct using send_data_to. However, I'm not entirely sure if I'm limited to a single type of struct or if I can use multiple different structs depending on what I need to transfer and figure out what it was on the receiving end.

In other words, I'm wondering if I can do something similar to what you can do with strings in EVENT_STRING to figure out which string was updated (event_type == EVENT_STRING && str == mystring).

It would be really useful for me if I didn't have to create a one-fits-all struct to cover everything I need if most of the time a smaller struct would do the job just as well.

Is this possible and what would be the best way to go about doing this?
Posted By: Ch40zzC0d3r

Re: send_data_to - using multiple structs? - 02/15/15 01:10

When you send a struct, you simply send the bytes from a startaddress till an offset to this startaddress.
So just make your own messaging system and say the first byte will decide afterwards which event type / struct is used. Thats it
© 2024 lite-C Forums