Possibility of using Nordic nRF52840 as PAwR advertiser and the other device as PAwR scanner

Hi,

I am currently investigating the possibility of using Nordic nRF52840 as the PAwR advertiser and the other device (from a different vendor) as the PAwR scanner. 

I don't want to include in the PAST procedure in my first demo, and found this ticket related: PaWR subevent data - Nordic Q&A - Nordic DevZone - Nordic DevZone

I have went through the recommended `periodic_adv_conn` sample application. But I am not really sure whether it is possible to get this working. Moreover, I am actually not using the STACK on the other device, but writing the application based on the radio driver. 

Would appreciate it if you can give some suggestions Slight smile

Parents
  • I modified the example as follows:


    	int err;
    	struct bt_le_ext_adv *pawr_adv;
    	init_bufs();
    
    	/* Initialize the Bluetooth Subsystem */
    	err = bt_enable(NULL);
    	if (err) {
    		printk("Bluetooth init failed (err %d)\n", err);
    		return 0;
    	}
    
    	/* Create a non-connectable advertising set */
    	err = bt_le_ext_adv_create(BT_LE_EXT_ADV_NCONN, &adv_cb, &pawr_adv);
    	if (err) {
    		printk("Failed to create advertising set (err %d)\n", err);
    		return 0;
    	}
    
    	/* Set periodic advertising parameters */
    	err = bt_le_per_adv_set_param(pawr_adv, &per_adv_params);
    	if (err) {
    		printk("Failed to set periodic advertising parameters (err %d)\n", err);
    		return 0;
    	}
    
    	/* Enable Periodic Advertising */
    	printk("Start Periodic Advertising\n");
    	err = bt_le_per_adv_start(pawr_adv);
    	if (err) {
    		printk("Failed to enable periodic advertising (err %d)\n", err);
    		return 0;
    	}
    
    	printk("Start Extended Advertising\n");
    	err = bt_le_ext_adv_start(pawr_adv, BT_LE_EXT_ADV_START_DEFAULT);
    	if (err) {
    		printk("Failed to start extended advertising (err %d)\n", err);
    		return 0;
    	}
    
    	/* Send the HCI subevent data request */
    	struct net_buf *buf;
    	struct bt_hci_evt_le_per_adv_subevent_data_request *evt;
    	buf = bt_hci_evt_create(BT_HCI_EVT_LE_PER_ADV_SUBEVENT_DATA_REQUEST, sizeof(struct bt_hci_evt_le_per_adv_subevent_data_request));
    	if (!buf)
    	{
    		printk("Unable to allocate event buffer\n");
    		return -1;
    	}
    
    	/* Update the parameters */
    	evt = net_buf_push(buf, sizeof(struct bt_hci_evt_le_per_adv_subevent_data_request));
    	if (!evt)
    	{
    		printk("Unable to allocate memory for the request event\n");
    		return -1;
    	}
    
    	uint8_t adv_handle;
    	err = bt_hci_get_adv_handle(pawr_adv, &adv_handle);
    	if (err)
    	{
    		printk("Failed to get the advertising handle (err %d)\n", err);
    		return -1;
    	}
    
    	evt->adv_handle = adv_handle;
    	evt->subevent_start = 1;
    	evt->subevent_data_count = NUM_SUBEVENTS;
    
    	/* Request... */
    	extern void bt_hci_le_per_adv_subevent_data_request(struct net_buf *buf);
    	bt_hci_le_per_adv_subevent_data_request(buf);
    
    	while (true) {
    		k_sleep(K_SECONDS(1));
    	}


    When running this PAwR advertiser application, I got the following errors



  • I did check the meaning of this -5 error. According to Zephyr documentation, this is an I/O error. But I don't really understand what does this I/O error mean in this context. Could u please shed some light on understanding and resolving this issue?

Reply Children
No Data
Related