Random header image... Refresh for more!

Serialization FTW!

NXC has a basic serializer.

Flatten(obj) gives you a “string” representation of the item you pass it.

UnflattenVar(str, obj) will take the “string” and turn it into an object.

I put “string” in quotes, because it’s really just bytes, so you’re not getting a text representation of the object, it’s just moving a byte array around.  Still, it’s very useful.  It’s letting me pass a small packet to the NXT with one Bluetooth message, instead of three.

0 comments

There are no comments yet...

Kick things off by filling out the form below.

Leave a Comment