HI, i would like to get device name and print to uart, but when i try to print the device name i got error character.
Here my snipet code and uart result
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
const ble_gap_evt_adv_report_t *p_adv_report = &p_ble_evt->evt.gap_evt.params.adv_report;
const ble_data_t *data = &p_adv_report->data;
uint8_t *device_name = ble_advdata_parse(data->p_data, data->len, BLE_GAP_AD_TYPE_COMPLETE_LOCAL_NAME);
int8_t report = p_ble_evt->evt.gap_evt.params.adv_report.rssi;
if(data->len == 0)
{
}
else{
printf("%d, %s \r\n",report,device_name);
}