This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

ANCS, How to traverce the app identifier using nrf_ble_ancs_c_request_attrs?

I put the nrf_ble_ancs_c_request_attrs in the BLE_ANCS_C_EVT_NOTIF event(added). But only return back 1 or 2 BLE_ANCS_C_EVT_NOTIF_ATTRIBUTE event. I am using 12.3.0 SDK example on nrf51822.

Parents
  • I am sorry, but I cannot understand your question. Are you asking how to navigate through the discovered attributes? well in that case the application has to keep track of them based on their UUID. Please look at the examples which have different service based libraries and they categorize these services based on the discovered UUID. If this is not what you asked, then please let me know what you wanted to know.

  • case BLE_ANCS_C_EVT_NOTIF:
        m_notification_latest = p_evt->notif;
        notif_print(&m_notification_latest);			
    	if(m_notification_latest.evt_id == BLE_ANCS_EVENT_ID_NOTIFICATION_ADDED)//add by zeno
    	{
    		ret = nrf_ble_ancs_c_request_attrs(&m_ancs_c, &m_notification_latest);
    		APP_ERROR_CHECK(ret);
    	}
        break;
    
    case BLE_ANCS_C_EVT_NOTIF_ATTRIBUTE:
        m_notif_attr_latest = p_evt->attr;
        notif_attr_print(&m_notif_attr_latest);
        if(p_evt->attr.attr_id == BLE_ANCS_NOTIF_ATTR_ID_APP_IDENTIFIER)
        {
            m_notif_attr_app_id_latest = p_evt->attr;
    		Watch_AncsNotifyChk(m_notif_attr_app_id_latest.p_attr_data);
        }
        break;

    I just want to know all the APP IDENTIFIER of all notifications when connected to apple device.On my iphone, there are more than 50 notifications exsit when connected. But I can only get 1 or 2 app Identifier. The code snippet:

  • you should get discovery notification for all the attributes discovered with a handle, if you are not getting it , then something is wrong o rmaybe i am misunderstanding the question

Reply Children
No Data
Related