Skip to content

Commit

Permalink
fix compilation with BLE 5 (arendst#22506)
Browse files Browse the repository at this point in the history
  • Loading branch information
Staars authored Nov 17, 2024
1 parent 7615b3c commit 873bd3f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tasmota/tasmota_xsns_sensor/xsns_62_esp32_mi.ino
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,7 @@ extern "C" {
success = true;
break;
case 232: // set adv params via bytes() descriptor of size 5,
#ifndef CONFIG_BT_NIMBLE_EXT_ADV
if(MI32.conCtx->buffer[0] == 5){
uint16_t itvl_min = MI32.conCtx->buffer[2] + (MI32.conCtx->buffer[3] << 8);
uint16_t itvl_max = MI32.conCtx->buffer[4] + (MI32.conCtx->buffer[5] << 8);
Expand All @@ -763,6 +764,7 @@ extern "C" {
AddLog(LOG_LEVEL_DEBUG,PSTR("BLE: adv params: type: %u, min: %u, max: %u"),MI32.conCtx->buffer[1], (uint16_t)(itvl_min * 0.625), (uint16_t)(itvl_max * 0.625)) ;
success = true;
}
#endif //CONFIG_BT_NIMBLE_EXT_ADV
break;
case 233:
int ret = ble_svc_gap_device_name_set((const char*)MI32.conCtx->buffer + 1);
Expand Down Expand Up @@ -1995,19 +1997,23 @@ void MI32parseBTHomePacket(char * _buf, uint32_t length, uint8_t addr[6], int RS
idx += 3;
break;
case 0x0b:
// power ??
// power in W
idx += 4;
break;
case 0x0c:
//voltage
idx += 3;
break;
case 0x10:
// binary power on/off??
// power on/off
idx += 2;
break;
case 0x11:
// opening closed=0/open=1
idx += 2;
break;
default:
AddLog(LOG_LEVEL_INFO,PSTR("M32: unknown BTHome data type: %u, discard rest of data buffer!"),_buf[idx]);
AddLog(LOG_LEVEL_INFO,PSTR("M32: unknown BTHome data type: %x, discard rest of data buffer!"),_buf[idx]);
AddLogBuffer(LOG_LEVEL_DEBUG,(uint8_t*)_buf,length);
idx = length; // "break"
break;
Expand Down

0 comments on commit 873bd3f

Please sign in to comment.