Describe the bug
Sender: Arduino Nano programmed with Arduino IDE (library installed via the Library manager).
Receiver; ESP32-S3 based touch-screen (this one) (library installed by adding "PowerBroker2/SerialTransfer" in platformio.ini)
Library version used: 3.1.5
txObj and rxObj don't work. This line:
transfer.txObj(val, sizeof(val));
fails to copy data into the buffer.
It's the same problem on the ESP32-S3 side.
It seems that txObj writes zeros to txBuff.
Verified by reading packet.txBuff immediately after txObj. All bytes were 0x00.
Same for rxBuff and rxObj.
To Reproduce
Simply try to send and receive a primitive-type integer, such as:
uint32_t val = 42;
Expected behavior
rxObj should be stuffed with the received data on the receiver end.
Workaround
I used memcpy on both sides to get the data to flow:
On the sender side:
memcpy(m_transfer.packet.txBuff, &val, sizeof(val));
m_transfer.sendData(sizeof(val));
On the receiver side:
uint8_t result = m_transfer.available();
if (result)
{
uint32_t val;
memcpy(&val, m_transfer.packet.rxBuff, sizeof(val));
Serial.println(val);
}
Describe the bug
Sender: Arduino Nano programmed with Arduino IDE (library installed via the Library manager).
Receiver; ESP32-S3 based touch-screen (this one) (library installed by adding "PowerBroker2/SerialTransfer" in platformio.ini)
Library version used: 3.1.5
txObj and rxObj don't work. This line:
transfer.txObj(val, sizeof(val));fails to copy data into the buffer.
It's the same problem on the ESP32-S3 side.
It seems that txObj writes zeros to txBuff.
Verified by reading packet.txBuff immediately after txObj. All bytes were 0x00.
Same for rxBuff and rxObj.
To Reproduce
Simply try to send and receive a primitive-type integer, such as:
uint32_t val = 42;Expected behavior
rxObj should be stuffed with the received data on the receiver end.
Workaround
I used memcpy on both sides to get the data to flow:
On the sender side:
On the receiver side: