-->
Page 1 of 1

nodemcu integer to multi byte conversion

PostPosted: Fri Apr 17, 2015 8:17 am
by wizhippo
Since nodemcu has not struct.pack support how would you convert an integer to its 16 or 32 bit byte array for binary data transfer?

I have found some lua code but they all depend on math functions that are not supported.

Any Ideas? I am missing something obvious?

Re: nodemcu integer to multi byte conversion

PostPosted: Sun Apr 19, 2015 9:02 am
by wizhippo
Found a good resource on how to handle this. https://svn.nmap.org/nmap/nselib/packet.lua

Re: nodemcu integer to multi byte conversion

PostPosted: Sun Apr 19, 2015 10:20 pm
by mikewen
wizhippo wrote:Found a good resource on how to handle this. https://svn.nmap.org/nmap/nselib/packet.lua


I doubt the packet.lua able to use on NodeMCU due to limited heap size.