Fix LoRa binary send

This commit is contained in:
Theo Arends 2024-03-01 18:07:10 +01:00
parent 715ca102c7
commit d394eef7c8
4 changed files with 5 additions and 5 deletions

View File

@ -51,7 +51,7 @@ struct {
bool (* Config)(void);
bool (* Available)(void);
int (* Receive)(char*);
bool (* Send)(char*, uint32_t);
bool (* Send)(uint8_t*, uint32_t);
float rssi;
float snr;
float frequency; // 868.0 MHz

View File

@ -70,7 +70,7 @@ int LoraReceiveSx126x(char* data) {
return packet_size;
}
bool LoraSendSx126x(char* data, uint32_t len) {
bool LoraSendSx126x(uint8_t* data, uint32_t len) {
Lora.sendFlag = true;
#ifdef USE_LORA_DEBUG
AddLog(LOG_LEVEL_DEBUG, PSTR("LOR: Len %d, Send %*_H"), len, len + 2, data);

View File

@ -82,10 +82,10 @@ int LoraReceiveSx127x(char* data) {
return packet_size;
}
bool LoraSendSx127x(char* data, uint32_t len) {
bool LoraSendSx127x(uint8_t* data, uint32_t len) {
// Lora.sendFlag = true;
LoRa.beginPacket(Lora.implicit_header); // start packet
LoRa.write((uint8_t*)data, len); // send message
LoRa.write(data, len); // send message
LoRa.endPacket(); // finish packet and send it
LoRa.receive(); // go back into receive mode
return true;

View File

@ -182,7 +182,7 @@ void CmndLoraSend(void) {
len = 0;
}
if (len) {
Lora.Send(data, len);
Lora.Send((uint8_t*)data, len);
}
ResponseCmndDone();
}