Is there a Spin equivalent of C structs?
Jeff Haas
Posts: 431
in Propeller 1
I'm considering a wireless, Prop-to-Prop project and would like to pass a bunch of info, by sending one packet. I've got this going in 'duino C but the Prop has obvious advantages.
A search of previous forum discussions didn't seem to turn anything up. Ideas?
A search of previous forum discussions didn't seem to turn anything up. Ideas?

Comments
You can perhaps create your packets in arrays and define some constants that are the offsets of items within the array.
typedef struct TestS { struct TestS *next; char *name; int size; short value; char flags; } TestT; TestT x; void sub1(void) { int i; i = x.next; i = x.name; i = x.size; i = x.value; i = x.flags; }to this Spin codeIf you have the code in C already, why don't you try to port it to PropellerGCC ?
Dave Hein's post shows a good example.
Parallax put out an appnote on this topic. Here's a link to the document and sample code.
Thanks for the appnote link.