I'm trying to implement a custom ntag215 emulator with the bulk of it in C, but I'm having an issue passing the received data to my C function.
Here's the function signature:
// int processRx(int, int)
int processRx(int rxLen, unsigned char *rx)
I've tried this since it was the same general code that I used to point the C code to my storage array, but accessing rx[0] from the C code just reads 0
NRF.on('NFCrx', function(rx) {
var rxAddr = E.getAddressOf(rx);
if (!rxAddr) throw new Error("RX not a flat string");
var txLen = ntag.processRx(rx.length, rxAddr);
console.log(rx);
console.log(txLen);
}
the console logs the full expected rx array, but the C function doesn't see the expected values, I'm assuming it's something related to a data type mismatch between the javascript and c code.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I'm trying to implement a custom ntag215 emulator with the bulk of it in C, but I'm having an issue passing the received data to my C function.
Here's the function signature:
I've tried this since it was the same general code that I used to point the C code to my storage array, but accessing rx[0] from the C code just reads 0
the console logs the full expected rx array, but the C function doesn't see the expected values, I'm assuming it's something related to a data type mismatch between the javascript and c code.