I need to send a value saved in a variable. When trying to pass this in my payload it keeps referencing to the initial value of mydata, which is unsuccessful test.
static uint8_t *mydatapnt;
uint8_t *strdata = "Successfull test";
static uint8_t mydata [] = "Incorrect test";
void send(){
if (LMIC.opmode & OP_TXRXPEND) {
Serial.println(F("OP_TXRXPEND, not sending"));
} else {
// Prepare upstream data transmission at the next possible time.
LMIC_setTxData2(1, mydata, sizeof(mydata)-1, 0);
Serial.println(F("Packet queued"));
/
}
void setup(){
*mydata = mydatapnt;
}
void loop(){
*mydatapnt = strdata;
Serial.println(*mydatapnt + "");
}
What exactly am I doing wrong? I should receive "successfull test". You can find the full code project here