@@ -90,8 +90,10 @@ bool mgos_bt_gattc_connect(const struct mgos_bt_addr *addr) {
90
90
char buf [MGOS_BT_ADDR_STR_LEN ];
91
91
uint8_t * a = (uint8_t * ) addr -> addr ;
92
92
if (esp32_bt_is_scanning ()) return false;
93
- esp_err_t err = esp_ble_gattc_open (s_gattc_if , a , true);
94
- LOG (LL_DEBUG , ("CONNECT %s: %d" , esp32_bt_addr_to_str (a , buf ), err ));
93
+ esp_err_t err = esp_ble_gattc_open (s_gattc_if , a , addr -> type - 1 , true);
94
+ LOG (LL_DEBUG ,
95
+ ("CONNECT %s: %d" ,
96
+ mgos_bt_addr_to_str (addr , MGOS_BT_ADDR_STRINGIFY_TYPE , buf ), err ));
95
97
return err == ESP_OK ;
96
98
}
97
99
@@ -182,10 +184,10 @@ static void esp32_bt_gattc_ev(esp_gattc_cb_event_t ev, esp_gatt_if_t iface,
182
184
di .chr = * (struct mgos_bt_uuid * ) & el .uuid ;
183
185
di .handle = el .char_handle ;
184
186
di .prop = el .properties ;
185
- LOG (LL_DEBUG ,
186
- ( " discovery: %s %s %s %hhx" , mgos_bt_addr_to_str (& di .addr , buf1 ),
187
- mgos_bt_uuid_to_str (& di .svc , buf2 ),
188
- mgos_bt_uuid_to_str (& di .chr , buf3 ), di .prop ));
187
+ LOG (LL_DEBUG , ( " discovery: %s %s %s %hhx" ,
188
+ mgos_bt_addr_to_str (& di .addr , 1 , buf1 ),
189
+ mgos_bt_uuid_to_str (& di .svc , buf2 ),
190
+ mgos_bt_uuid_to_str (& di .chr , buf3 ), di .prop ));
189
191
mgos_event_trigger_schedule (MGOS_BT_GATTC_EVENT_DISCOVERY_RESULT , & di ,
190
192
sizeof (di ));
191
193
count = 1 ;
@@ -373,7 +375,7 @@ static void esp32_bt_gattc_ev(esp_gattc_cb_event_t ev, esp_gatt_if_t iface,
373
375
esp32_bt_addr_to_str (p -> remote_bda , buf )));
374
376
break ;
375
377
}
376
- case ESP_GATTC_READ_MUTIPLE_EVT : {
378
+ case ESP_GATTC_READ_MULTIPLE_EVT : {
377
379
const struct gattc_read_char_evt_param * p = & ep -> read ;
378
380
enum cs_log_level ll = ll_from_status (p -> status );
379
381
LOG (ll , ("READ_MUTIPLE st %d cid %u h %u val_len %u" , p -> status ,
0 commit comments