mcci-catena/arduino-lmic

Use buffer for MAC responses

Closed this issue · 0 comments

Current version of scan_mac_cmds() sets up bitmaps and "ans" fields as it scans the mac commands. Then buildDataFrame() uses the bits and the answers to create reply fields. But this means:

  1. responses are not guaranteed to be in same order as requests
  2. it's hard to have multiple responses to repeated requests.

Solution is to create a dedicated buffer for mac responses. It looks pretty easy; build it in scan_mac_cmds(), then prepend to the buffer in buildDataFrame(). We can then rip out all the flags and so forth; net size will be almost a wash.