Some LoRa-stuff

This commit is contained in:
Marcel Peterkau 2023-04-12 22:47:17 +02:00
parent 53928a93b0
commit 4d0a9918ce
4 changed files with 48 additions and 36 deletions

View File

@ -274,7 +274,7 @@ bool LoRa_E220::begin(){
this->serialDef.stream->setTimeout(100); this->serialDef.stream->setTimeout(100);
Status status = setMode(MODE_0_NORMAL); Status status = setMode(MODE_0_NORMAL);
return status==E220_SUCCESS; return status;
} }
/* /*

View File

@ -15,6 +15,8 @@ typedef enum DTCNums_e
DTC_FLASHFS_ERROR, DTC_FLASHFS_ERROR,
DTC_FLASHFS_VERSION_ERROR, DTC_FLASHFS_VERSION_ERROR,
DTC_EEPROM_CFG_SANITY, DTC_EEPROM_CFG_SANITY,
DTC_NO_LORA_FOUND,
DTC_NO_BATMNON_FOUND,
DTC_LAST_DTC DTC_LAST_DTC
} DTCNums_t; } DTCNums_t;

View File

@ -5,11 +5,15 @@ LoRa_E220 e220ttl(GPIO_LORA_TX, GPIO_LORA_RX, GPIO_LORA_AUX, 3, 4); // Arduino R
void printParameters(struct Configuration configuration); void printParameters(struct Configuration configuration);
void printModuleInformation(struct ModuleInformation moduleInformation); void printModuleInformation(struct ModuleInformation moduleInformation);
void InitLoRa(void (*MPinHelper)(int, int)) bool InitLoRa(void (*MPinHelper)(int, int))
{ {
e220ttl.setMPins = MPinHelper; bool returnval;
e220ttl.begin();
e220ttl.setMPins = MPinHelper;
returnval = e220ttl.begin();
if (returnval == true)
{
ResponseStructContainer c; ResponseStructContainer c;
c = e220ttl.getConfiguration(); c = e220ttl.getConfiguration();
// It's important get configuration pointer before all other operation // It's important get configuration pointer before all other operation
@ -52,6 +56,12 @@ void InitLoRa(void (*MPinHelper)(int, int))
printParameters(configuration); printParameters(configuration);
} }
else
{
MaintainDTC(DTC_NO_LORA_FOUND, DTC_WARN, true);
}
return returnval;
}
void LoRa_Process() void LoRa_Process()
{ {

View File

@ -14,7 +14,7 @@
#define FREQUENCY_868 #define FREQUENCY_868
void InitLoRa(void (*MPinHelper)(int, int)); bool InitLoRa(void (*MPinHelper)(int, int));
void LoRa_Process(); void LoRa_Process();
void sendStatus_LoRa(); void sendStatus_LoRa();