File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ struct ble_hs_cfg;
5353struct ble_gatt_register_ctxt ;
5454
5555void gatt_svr_register_cb (struct ble_gatt_register_ctxt * ctxt , void * arg );
56+ //init gatt server
5657int gatt_svr_init (void );
5758
5859#ifdef __cplusplus
Original file line number Diff line number Diff line change @@ -110,8 +110,8 @@ blehr_advertise(void)
110110 fields .tx_pwr_lvl_is_present = 1 ;
111111 fields .tx_pwr_lvl = BLE_HS_ADV_TX_PWR_LVL_AUTO ;
112112
113- fields .name = (uint8_t * )device_name ;
114- fields .name_len = strlen (device_name );
113+ fields .name = (uint8_t * )CONFIG_BT_NIMBLE_SVC_GAP_DEVICE_NAME ;
114+ fields .name_len = strlen (CONFIG_BT_NIMBLE_SVC_GAP_DEVICE_NAME );
115115 fields .name_is_complete = 1 ;
116116
117117 fields .num_uuids16 = 1 ;
@@ -129,7 +129,9 @@ blehr_advertise(void)
129129
130130 /* Begin advertising */
131131 memset (& adv_params , 0 , sizeof (adv_params ));
132+ //undirected-connectable
132133 adv_params .conn_mode = BLE_GAP_CONN_MODE_UND ;
134+ //general-discoverable
133135 adv_params .disc_mode = BLE_GAP_DISC_MODE_GEN ;
134136 rc = ble_gap_adv_start (blehr_addr_type , NULL , BLE_HS_FOREVER ,
135137 & adv_params , blehr_gap_event , NULL );
You can’t perform that action at this time.
0 commit comments