mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-27 12:46:34 +00:00
Merge pull request #17184 from fightforlife/development_eb3ble_retries
BLE eQ3 - allow to set retries at runtime
This commit is contained in:
commit
1098ec2098
@ -32,6 +32,7 @@ trv 001A22092EE0 settemp 22.5
|
|||||||
|
|
||||||
trvperiod n - set polling period in seconds (default teleperiod at boot)
|
trvperiod n - set polling period in seconds (default teleperiod at boot)
|
||||||
trvonlyaliased *0/1 - only hear devices with BLEAlias set
|
trvonlyaliased *0/1 - only hear devices with BLEAlias set
|
||||||
|
trvretries n - set the number of retries (default 4 at boot)
|
||||||
trvMatchPrefix 0/*1 - if set, then it will add trvs to the seen list which have mac starting with :
|
trvMatchPrefix 0/*1 - if set, then it will add trvs to the seen list which have mac starting with :
|
||||||
macs in macprefixes, currently only 001a22
|
macs in macprefixes, currently only 001a22
|
||||||
Note: anything with BLEAlias starting "EQ3" will be added to the seen list.
|
Note: anything with BLEAlias starting "EQ3" will be added to the seen list.
|
||||||
@ -147,6 +148,7 @@ namespace EQ3_ESP32 {
|
|||||||
|
|
||||||
void CmndTrv(void);
|
void CmndTrv(void);
|
||||||
void CmndTrvPeriod(void);
|
void CmndTrvPeriod(void);
|
||||||
|
void CmndTrvRetries(void);
|
||||||
void CmndTrvOnlyAliased(void);
|
void CmndTrvOnlyAliased(void);
|
||||||
void CmndTrvMatchPrefix(void);
|
void CmndTrvMatchPrefix(void);
|
||||||
void CmndTrvMinRSSI(void);
|
void CmndTrvMinRSSI(void);
|
||||||
@ -155,6 +157,7 @@ void CmndTrvHideFailedPoll(void);
|
|||||||
const char kEQ3_Commands[] PROGMEM = D_CMND_EQ3"|"
|
const char kEQ3_Commands[] PROGMEM = D_CMND_EQ3"|"
|
||||||
"|"
|
"|"
|
||||||
"period|"
|
"period|"
|
||||||
|
"retries|"
|
||||||
"onlyaliased|"
|
"onlyaliased|"
|
||||||
"MatchPrefix|"
|
"MatchPrefix|"
|
||||||
"MinRSSI|"
|
"MinRSSI|"
|
||||||
@ -163,6 +166,7 @@ const char kEQ3_Commands[] PROGMEM = D_CMND_EQ3"|"
|
|||||||
void (*const EQ3_Commands[])(void) PROGMEM = {
|
void (*const EQ3_Commands[])(void) PROGMEM = {
|
||||||
&CmndTrv,
|
&CmndTrv,
|
||||||
&CmndTrvPeriod,
|
&CmndTrvPeriod,
|
||||||
|
&CmndTrvRetries,
|
||||||
&CmndTrvOnlyAliased,
|
&CmndTrvOnlyAliased,
|
||||||
&CmndTrvMatchPrefix,
|
&CmndTrvMatchPrefix,
|
||||||
&CmndTrvMinRSSI,
|
&CmndTrvMinRSSI,
|
||||||
@ -234,6 +238,7 @@ eq3_device_tag EQ3Devices[EQ3_NUM_DEVICESLOTS];
|
|||||||
SemaphoreHandle_t EQ3mutex = nullptr;
|
SemaphoreHandle_t EQ3mutex = nullptr;
|
||||||
|
|
||||||
int EQ3Period = 300;
|
int EQ3Period = 300;
|
||||||
|
int EQ3Retries = 4;
|
||||||
uint8_t EQ3OnlyAliased = 0;
|
uint8_t EQ3OnlyAliased = 0;
|
||||||
uint8_t EQ3MatchPrefix = 1;
|
uint8_t EQ3MatchPrefix = 1;
|
||||||
uint8_t opInProgress = 0;
|
uint8_t opInProgress = 0;
|
||||||
@ -365,7 +370,7 @@ int EQ3DoOp(){
|
|||||||
if (!opInProgress){
|
if (!opInProgress){
|
||||||
if (opQueue.size()){
|
if (opQueue.size()){
|
||||||
op_t* op = opQueue[0];
|
op_t* op = opQueue[0];
|
||||||
if (EQ3Operation(op->addr, op->towrite, op->writelen, op->cmdtype, 4)){
|
if (EQ3Operation(op->addr, op->towrite, op->writelen, op->cmdtype, EQ3Retries)){
|
||||||
opQueue.pop_front();
|
opQueue.pop_front();
|
||||||
opInProgress = 1;
|
opInProgress = 1;
|
||||||
AddLog(LOG_LEVEL_DEBUG, PSTR("EQ3 %s:Op dequeued len now %d"), addrStr(op->addr, (op->cmdtype & 0x80)), opQueue.size());
|
AddLog(LOG_LEVEL_DEBUG, PSTR("EQ3 %s:Op dequeued len now %d"), addrStr(op->addr, (op->cmdtype & 0x80)), opQueue.size());
|
||||||
@ -1488,6 +1493,13 @@ void CmndTrvPeriod(void) {
|
|||||||
ResponseCmndNumber(EQ3Period);
|
ResponseCmndNumber(EQ3Period);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CmndTrvRetries(void) {
|
||||||
|
if (XdrvMailbox.data_len > 0) {
|
||||||
|
EQ3Retries = XdrvMailbox.payload;
|
||||||
|
}
|
||||||
|
ResponseCmndNumber(EQ3Retries);
|
||||||
|
}
|
||||||
|
|
||||||
void CmndTrvOnlyAliased(void){
|
void CmndTrvOnlyAliased(void){
|
||||||
if (XdrvMailbox.data_len > 0) {
|
if (XdrvMailbox.data_len > 0) {
|
||||||
EQ3OnlyAliased = XdrvMailbox.payload;
|
EQ3OnlyAliased = XdrvMailbox.payload;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user