Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MI32 legacy: fix compilation with Bluetooth 5 #22506

Merged
merged 1 commit into from
Nov 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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