mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-27 04:36:31 +00:00
Fix LoRa binary send
This commit is contained in:
parent
715ca102c7
commit
d394eef7c8
@ -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
|
||||||
|
@ -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);
|
||||||
|
@ -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;
|
||||||
|
@ -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();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user