This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

I know I can send a packet with data length 1~20 using sd_ble_gatts_hvx(), then how to send an empty notification packet(data length 0)?

Hi, I am using nrf51822 (128k). Softdevice 6.0 (s110), SDK 5.2. How can I send an empty notification packet (data length 0) to master device? If I send a packet with data length 0, nrf51822 reset...

Thank you.

Parents
  • Hi

    If you would like to send an empty notification, the hvx_params have to be something like this:

    unit8_t buffer[20], len=0;
    
    hvx_params.p_data = &buffer[0];
    hvx_params.p_len = &len;
    hvx_params.offset = 0;
    hvx_params.type = BLE_GATT_HVX_NOTIFICATION;
    hvx_params.handle = 0x000F
    
    sd_ble_gatts_hvx(gs_conn_handle, &hvx_params);
    
Reply
  • Hi

    If you would like to send an empty notification, the hvx_params have to be something like this:

    unit8_t buffer[20], len=0;
    
    hvx_params.p_data = &buffer[0];
    hvx_params.p_len = &len;
    hvx_params.offset = 0;
    hvx_params.type = BLE_GATT_HVX_NOTIFICATION;
    hvx_params.handle = 0x000F
    
    sd_ble_gatts_hvx(gs_conn_handle, &hvx_params);
    
Children
Related