renpan 发表于 2018-6-20 11:40:22

蓝牙主机on_descriptor_discovery_rsp不断重启

开发板:NRF52832
协议栈版本:132
使用从机串口例程和主机串口例程后想试试把从机代码换为蓝牙通知的例程,然后改了一下主机串口中对应的UUID设置发现程序在找到cccd后就莫名重启了,串口日志如下:

-----------------------------分割线----------------------------------------------
p_ble_evt->header.evt_id:1d

TYPE:7



extracted_uuid:1523

extracted_uuid TYPE:2
trueThe data length is: 18
11        7        9e        ca        dc        24        e        e5        a9        e0        93        f3        a3        b5        23        15        40        6e       
uuid present
Connecting tobc4cf1f
p_ble_evt->header.evt_id:10
Connected to target

Enter ble_db_discovery_start
: Starting discovery of service with UUID 0x1523 for Connection handle 0

收←◆
p_ble_evt->header.evt_id:30

Enter BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP
Found service UUID 0x1523
Service count:1
Found service UUID 0x1523
conn_handle:0

收←◆
p_ble_evt->header.evt_id:32

Enter BLE_GATTC_EVT_CHAR_DISC_RSP
char continue find, the primer ser UUID:0x1523
The number char prev found is 0
The number char being found is 1
not all char found.

收←◆
p_ble_evt->header.evt_id:32

Enter BLE_GATTC_EVT_CHAR_DISC_RSP
char continue find, the primer ser UUID:0x1523
The number char prev found is 1
The number char being found is 1
not all char found.

收←◆
p_ble_evt->header.evt_id:32

Enter BLE_GATTC_EVT_CHAR_DISC_RSP
char continue find, the primer ser UUID:0x1523
all char found-------.
1 char UUID is 1525
2 char UUID is 1524
**************************
raise_discov_complete:0

收←◆
p_ble_ev
收←◆Scan started

收←◆
p_ble_evt->header.evt_id:1d


-----------------------------分割线----------------------------------------------
红色部分是重启了,上面的打印信息插在代码如下位置:

    if (perform_desc_discov)
    {
            uint32_t i;
                for(i = 0; i < p_srv_being_discovered->char_count; i++)
                        printf("%d char UUID is %x\r\n",i+1,p_srv_being_discovered->charateristics.characteristic.uuid.uuid);
      bool raise_discov_complete;

      p_db_discovery->curr_char_ind = 0;

      err_code = descriptors_discover(p_db_discovery,
                                        &raise_discov_complete,
                                        p_ble_gattc_evt->conn_handle);
                printf("**************************\r\n");
                printf("raise_discov_complete:%x\r\n",raise_discov_complete);

      if (err_code != NRF_SUCCESS)
      {
              printf("descriptors found exception.\r\n");

页: [1]
查看完整版本: 蓝牙主机on_descriptor_discovery_rsp不断重启