Some LoRa-stuff
This commit is contained in:
parent
53928a93b0
commit
4d0a9918ce
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
@ -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()
|
||||||
{
|
{
|
||||||
|
@ -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();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user