Structures in RLP?


since our code required more speed, we switched into RLP using Gus useful pointers, now something else, inside RLP I can’t seems to work with structures only native types, any ideas why? my structures are very simple containing a few bytes and few unsigned shorts


@ liran.shahar - Can you give an example of the problem you are having? I have used structures extensively in RLP and RLPlite without any issues. Or are you trying to pass structures from managed code to the RLP code? That would not work, but if that is the issue, we could provide a few pointers.

this is the case, i got an array of managed structures and data that comes from the CAN messages, i put it in a byte array and pass on to RLP code for some processing, I want to be able to fiddle with the data directly in the structures

any pointers will be appreciated.


@ liran.shahar - I suspect that MF does not support the necessary metadata to control the alignment of variables within a struct. If a struct was to be passed, that alignment in the managed world and C world must be identical.

as far as I know this code should work :


so I am not sure there is an issue there, but I can’t even test that before I manage to define a proper structure in the C RLP file, which currently keeps on giving me error, do you have a sample of RLP file that defines structures in it? I would appreciate that

after that I can check if the memory from the managed structure is “mapped” properly in the C code

@ liran.shahar - any book on C will show you how to define a struct. you can post your definition and error message.