LoraWan_app Send & receive Array

Hi to all,

Is there a way to send and receive an array using CubeCell V2?
Anyone has any clue?

Thanks

The short answer is “Yes”. The Factory_Test_AB01 example sketch plays ping-pong by sending/receiving an array of char.

Thanks for your reply UniquePete,

Is there anyway of sending an array of floats or even 2D array (ie data[i][j])?
If not, what is the most efficient way of doing something similar?

Thanks

Convert it to a one-dimensional array, and you can transfer it.

Hi Navi,

Do you have any example or sample code doing that?

Cheers,

I use the following data structure to ‘map’ a struct onto a one-dimensional array:

union PH_dataPacket {
  uint8_t packetByte[PH_packetSize];
  struct packetContent {
    uint32_t destinationMAC;        	// 4 bytes
    uint32_t sourceMAC;             	// 4 bytes
    uint32_t checksum;              	// 4 bytes
    uint16_t sequenceNumber;        	// 2 bytes
    uint8_t packetType;               // 1 byte
    uint8_t byteCount;              	// 1 byte
    PH_genericPayload packetPayload;	// max 48 bytes
  } content;
};

I use this in a range of simple LoRa applications involving communications between various Heltec boards, amongst others, that are described here. I’m still working through getting the code compatible with the new ESP32-S3 processor, but the CubeCell stuff should be OK as it is.