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 (* Config)(void);
bool (* Available)(void); bool (* Available)(void);
int (* Receive)(char*); int (* Receive)(char*);
bool (* Send)(char*, uint32_t); bool (* Send)(uint8_t*, uint32_t);
float rssi; float rssi;
float snr; float snr;
float frequency; // 868.0 MHz float frequency; // 868.0 MHz

View File

@ -70,7 +70,7 @@ int LoraReceiveSx126x(char* data) {
return packet_size; return packet_size;
} }
bool LoraSendSx126x(char* data, uint32_t len) { bool LoraSendSx126x(uint8_t* data, uint32_t len) {
Lora.sendFlag = true; Lora.sendFlag = true;
#ifdef USE_LORA_DEBUG #ifdef USE_LORA_DEBUG
AddLog(LOG_LEVEL_DEBUG, PSTR("LOR: Len %d, Send %*_H"), len, len + 2, data); 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; return packet_size;
} }
bool LoraSendSx127x(char* data, uint32_t len) { bool LoraSendSx127x(uint8_t* data, uint32_t len) {
// Lora.sendFlag = true; // Lora.sendFlag = true;
LoRa.beginPacket(Lora.implicit_header); // start packet 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.endPacket(); // finish packet and send it
LoRa.receive(); // go back into receive mode LoRa.receive(); // go back into receive mode
return true; return true;

View File

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