4 posts / 0 new
Last post
Jonas Freitas
Offline
Last seen:3 years 2 months ago
加入ed:2014-11-14 12:23
Scan with DSPS Project

Hello,

I'm working in a project with DSPS and I'm trying scanning in central mode but I can only see BL devices (DA14580). I cannot see devices from other manufactures, like Microchip RN4020.

Scanning configuration follows below:

空白app_scanning(空白)
{
ke_state_set(TASK_APP, APP_CONNECTABLE);

// create a kernel message to start the scanning
struct gapm_start_scan_cmd *msg = (struct gapm_start_scan_cmd *)KE_MSG_ALLOC(GAPM_START_SCAN_CMD, TASK_GAPM, TASK_APP, gapm_start_scan_cmd);
// Maximal peer connection
msg->mode = GAP_OBSERVER_MODE;
msg->op.code = GAPM_SCAN_PASSIVE;
msg->op.addr_src = GAPM_PUBLIC_ADDR;
msg->filt_policy=SCAN_ALLOW_ADV_ALL;
msg->filter_duplic = SCAN_FILT_DUPLIC_DIS;
msg->interval = APP_SCAN_INTERVAL;
msg->window = APP_SCAN_WINDOW;

// Send the message
ke_msg_send(msg);
}

int gapm_adv_report_ind_handler(ke_msg_id_t const msgid,
const struct gapm_adv_report_ind *param,
ke_task_id_t const dest_id,
ke_task_id_t const src_id)
{
char temp[150];
int8_t rssi;

if(!memcmp(¶m->report.data[3], APP_DFLT_ADV_DATA, APP_DFLT_ADV_DATA_LEN))
{
//Save found bd_addr to global variable
rssi=(int)(((float)param->report.rssi*0.474)-122);
memcpy(&connect_bdaddr, param->report.adv_addr.addr, sizeof(struct bd_addr));
sprintf(temp,"mac:%0.2x:%0.2x:%0.2x:%0.2x:%0.2x:%0.2x||rssi:%d\r\n",param->report.adv_addr.addr[5],param->report.adv_addr.addr[4],param->report.adv_addr.addr[3],param->report.adv_addr.addr[2],param->report.adv_addr.addr[1],param->report.adv_addr.addr[0],rssi);
sps_uart_sps_write((uint8_t*)temp, strlen(temp));

//app_cancel_scanning();
}
return (KE_MSG_CONSUMED);
}

Thanks,

Device:
Jonas Freitas
Offline
Last seen:3 years 2 months ago
加入ed:2014-11-14 12:23
any suggestions, for what you

any suggestions, for what you may be going?

MT_dialog
Offline
Last seen:2 months 1 week ago
Staff
加入ed:2015-06-08 11:34
Hi Jonas Freitas,

Hi Jonas Freitas,

Are you able to catch the the advertising indications by using a break point at the if() ? are you sure that the other device is advertising ?

I can see that you are checking the devices advertising string for a specific pattern of advertising data, are you sure that the other devices are advertising the same advertising string as the dialog chip does ?

Thanks MT_dialog

MSun
Offline
Last seen:8 months 3 weeks ago
加入ed:2015-11-30 22:40
By default, the DSPS

By default, the DSPS application will only report devices that match the UUID used by the DSPS application.

If you want to see the other devices, you would need to comment out the code that filters the other non-DPSP devices.

See user_on_adv_report_ind()

if(!memcmp(¶m->report.data[3], USER_ADVERTISE_DATA, USER_ADVERTISE_DATA_LEN))
The above if statement is looking for only the DSPS UUID. You can modify this area to look at all UUIDs if you wish.

Thanks, Martin