@@ -263,7 +263,7 @@ static void esp32_bt_gattc_ev(esp_gattc_cb_event_t ev, esp_gatt_if_t gattc_if,
263
263
const struct gattc_search_res_evt_param * p = & ep -> search_res ;
264
264
LOG (LL_DEBUG ,
265
265
("SEARCH_RES cid %u svc %s %d" , p -> conn_id ,
266
- mgos_bt_uuid_to_str (& p -> srvc_id .uuid , buf ), p -> srvc_id .inst_id ));
266
+ esp32_bt_uuid_to_str (& p -> srvc_id .uuid , buf ), p -> srvc_id .inst_id ));
267
267
struct esp32_gattc_connection_entry * ce =
268
268
find_connection_by_esp_conn_id (p -> conn_id );
269
269
if (ce == NULL ) break ;
@@ -496,8 +496,8 @@ static void esp32_bt_gattc_ev(esp_gattc_cb_event_t ev, esp_gatt_if_t gattc_if,
496
496
if (count == 1 ) {
497
497
LOG (LL_DEBUG ,
498
498
("%s %s -> CCCD handle %u" ,
499
- mgos_bt_uuid_to_str (& sc -> svc_uuid , buf ),
500
- mgos_bt_uuid_to_str (& sc -> char_uuid , buf2 ), cccd .handle ));
499
+ esp32_bt_uuid_to_str (& sc -> svc_uuid , buf ),
500
+ esp32_bt_uuid_to_str (& sc -> char_uuid , buf2 ), cccd .handle ));
501
501
uint8_t notify_en [2 ] = {0x01 , 0x00 };
502
502
sc -> cccd_handle = cccd .handle ;
503
503
status = esp_ble_gattc_write_char_descr (
@@ -510,8 +510,8 @@ static void esp32_bt_gattc_ev(esp_gattc_cb_event_t ev, esp_gatt_if_t gattc_if,
510
510
}
511
511
} else {
512
512
LOG (LL_ERROR ,
513
- ("No CCCD for %s %s" , mgos_bt_uuid_to_str (& sc -> svc_uuid , buf ),
514
- mgos_bt_uuid_to_str (& sc -> char_uuid , buf2 )));
513
+ ("No CCCD for %s %s" , esp32_bt_uuid_to_str (& sc -> svc_uuid , buf ),
514
+ esp32_bt_uuid_to_str (& sc -> char_uuid , buf2 )));
515
515
sc -> success = false;
516
516
}
517
517
}
@@ -748,13 +748,13 @@ struct esp32_gattc_list_chars_ctx {
748
748
static void lc_done_mgos_cb (void * arg ) {
749
749
struct esp32_gattc_list_chars_ctx * lc_ctx =
750
750
(struct esp32_gattc_list_chars_ctx * ) arg ;
751
- lc_ctx -> cb (lc_ctx -> conn_id , & lc_ctx -> svc_id , lc_ctx -> num_res , lc_ctx -> res ,
752
- lc_ctx -> cb_arg );
751
+ lc_ctx -> cb (lc_ctx -> conn_id , ( struct mgos_bt_uuid * ) & lc_ctx -> svc_id ,
752
+ lc_ctx -> num_res , lc_ctx -> res , lc_ctx -> cb_arg );
753
753
free (lc_ctx -> res );
754
754
free (lc_ctx );
755
755
}
756
756
757
- void mgos_bt_gattc_list_chars (int conn_id , const esp_bt_uuid_t * svc_id ,
757
+ void mgos_bt_gattc_list_chars (int conn_id , const struct mgos_bt_uuid * svc_id ,
758
758
mgos_bt_gattc_list_chars_cb_t cb , void * cb_arg ) {
759
759
esp_gattc_char_elem_t * char_res = NULL ;
760
760
struct esp32_gattc_list_chars_ctx * lc_ctx = calloc (1 , sizeof (* lc_ctx ));
@@ -842,8 +842,8 @@ static esp_gatt_status_t esp32_gattc_get_char_handle(
842
842
clean : {
843
843
enum cs_log_level ll = (res == ESP_GATT_OK ? LL_DEBUG : LL_ERROR );
844
844
char buf1 [BT_UUID_STR_LEN ], buf2 [BT_UUID_STR_LEN ];
845
- LOG (ll , ("%s %s -> %u" , mgos_bt_uuid_to_str (svc_id , buf1 ),
846
- mgos_bt_uuid_to_str (char_id , buf2 ), * handle ));
845
+ LOG (ll , ("%s %s -> %u" , esp32_bt_uuid_to_str (svc_id , buf1 ),
846
+ esp32_bt_uuid_to_str (char_id , buf2 ), * handle ));
847
847
}
848
848
return res ;
849
849
}
@@ -861,8 +861,8 @@ static void read_done_mgos_cb(void *arg) {
861
861
free (rc );
862
862
}
863
863
864
- void mgos_bt_gattc_read_char (int conn_id , const esp_bt_uuid_t * svc_uuid ,
865
- const esp_bt_uuid_t * char_uuid ,
864
+ void mgos_bt_gattc_read_char (int conn_id , const struct mgos_bt_uuid * svc_uuid ,
865
+ const struct mgos_bt_uuid * char_uuid ,
866
866
esp_gatt_auth_req_t auth_req ,
867
867
mgos_bt_gattc_read_char_cb_t cb , void * cb_arg ) {
868
868
struct esp32_gattc_read_char_ctx * rc = calloc (1 , sizeof (* rc ));
@@ -877,7 +877,8 @@ void mgos_bt_gattc_read_char(int conn_id, const esp_bt_uuid_t *svc_uuid,
877
877
rc -> cb_arg = cb_arg ;
878
878
struct esp32_gattc_connection_entry * ce = NULL ;
879
879
esp_gatt_status_t st = esp32_gattc_get_char_handle (
880
- conn_id , svc_uuid , char_uuid , & ce , & rc -> handle );
880
+ conn_id , (esp_bt_uuid_t * ) svc_uuid , (esp_bt_uuid_t * ) char_uuid , & ce ,
881
+ & rc -> handle );
881
882
if (st != ESP_GATT_OK ) {
882
883
rc -> value_len = -1 ;
883
884
goto clean ;
@@ -903,8 +904,8 @@ static void write_done_mgos_cb(void *arg) {
903
904
free (wc );
904
905
}
905
906
906
- void mgos_bt_gattc_write_char (int conn_id , const esp_bt_uuid_t * svc_uuid ,
907
- const esp_bt_uuid_t * char_uuid ,
907
+ void mgos_bt_gattc_write_char (int conn_id , const struct mgos_bt_uuid * svc_uuid ,
908
+ const struct mgos_bt_uuid * char_uuid ,
908
909
bool response_required ,
909
910
esp_gatt_auth_req_t auth_req ,
910
911
const struct mg_str value ,
@@ -921,7 +922,8 @@ void mgos_bt_gattc_write_char(int conn_id, const esp_bt_uuid_t *svc_uuid,
921
922
wc -> cb_arg = cb_arg ;
922
923
struct esp32_gattc_connection_entry * ce ;
923
924
esp_gatt_status_t st = esp32_gattc_get_char_handle (
924
- conn_id , svc_uuid , char_uuid , & ce , & wc -> handle );
925
+ conn_id , (esp_bt_uuid_t * ) svc_uuid , (esp_bt_uuid_t * ) char_uuid , & ce ,
926
+ & wc -> handle );
925
927
if (st != ESP_GATT_OK ) {
926
928
wc -> success = false;
927
929
goto clean ;
@@ -967,8 +969,8 @@ static void subscribe_mgos_cb(void *arg) {
967
969
if (!sc -> success ) free (sc );
968
970
}
969
971
970
- void mgos_bt_gattc_subscribe (int conn_id , const esp_bt_uuid_t * svc_uuid ,
971
- const esp_bt_uuid_t * char_uuid ,
972
+ void mgos_bt_gattc_subscribe (int conn_id , const struct mgos_bt_uuid * svc_uuid ,
973
+ const struct mgos_bt_uuid * char_uuid ,
972
974
mgos_bt_gattc_subscribe_cb_t cb , void * cb_arg ) {
973
975
struct esp32_gattc_subscribe_ctx * sc = calloc (1 , sizeof (* sc ));
974
976
if (sc == NULL ) {
@@ -982,7 +984,8 @@ void mgos_bt_gattc_subscribe(int conn_id, const esp_bt_uuid_t *svc_uuid,
982
984
sc -> cb_arg = cb_arg ;
983
985
struct esp32_gattc_connection_entry * ce ;
984
986
esp_gatt_status_t st = esp32_gattc_get_char_handle (
985
- conn_id , svc_uuid , char_uuid , & ce , & sc -> handle );
987
+ conn_id , (esp_bt_uuid_t * ) svc_uuid , (esp_bt_uuid_t * ) char_uuid , & ce ,
988
+ & sc -> handle );
986
989
if (st != ESP_GATT_OK ) {
987
990
sc -> success = false;
988
991
goto clean ;
0 commit comments