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

read_resp is missing in SDK 15

Hi,

May I ask, why read_resp is missing in struct ble_hid_report_record_t in sdk 15? Currently, I am migrating to sdk 15 from sdk 14.2. However, I didn't find any document related to this, on how to replace read_resp with the latest sdk interfaces.

I am new to BLE hid, and I do not know what read_resp is really for. Should I just remove all read_resp assignments and do just nothing?

would you please guide? Thanks.

Vincent

Parents Reply Children
  • Hi, it locates: C:\nordic\nRF5_SDK_14.2.0_17b948a\components\ble\ble_services\ble_hids\ble_hids.h

    it reads like the following in sdk 14.2:

    /**@brief HID Service Input Report characteristic init structure. This contains all options and
     *        data needed for initialization of one Input Report characteristic. */
    typedef struct
    {
        uint16_t                      max_len;          /**< Maximum length of characteristic value. */
        ble_srv_report_ref_t          rep_ref;          /**< Value of the Report Reference descriptor. */
        ble_srv_cccd_security_mode_t  security_mode;    /**< Security mode for the HID Input Report characteristic, including cccd. */
        uint8_t                       read_resp : 1;    /**< Should application generate a response to read requests. */
    } ble_hids_inp_rep_init_t;
    
    /**@brief HID Service Output Report characteristic init structure. This contains all options and
     *        data needed for initialization of one Output Report characteristic. */
    typedef struct
    {
        uint16_t                      max_len;          /**< Maximum length of characteristic value. */
        ble_srv_report_ref_t          rep_ref;          /**< Value of the Report Reference descriptor. */
        ble_srv_cccd_security_mode_t  security_mode;    /**< Security mode for the HID Output Report characteristic, including cccd. */
        uint8_t                       read_resp : 1;    /**< Should application generate a response to read requests. */
    } ble_hids_outp_rep_init_t;
    
    /**@brief HID Service Feature Report characteristic init structure. This contains all options and
     *        data needed for initialization of one Feature Report characteristic. */
    typedef struct
    {
        uint16_t                      max_len;          /**< Maximum length of characteristic value. */
        ble_srv_report_ref_t          rep_ref;          /**< Value of the Report Reference descriptor. */
        ble_srv_cccd_security_mode_t  security_mode;    /**< Security mode for the HID Service Feature Report characteristic, including cccd. */
        uint8_t                       read_resp : 1;    /**< Should application generate a response to read requests. */
    } ble_hids_feature_rep_init_t;
    
    

    and the following is from sdk 15:

    /**@brief HID Service Input Report characteristic init structure. This contains all options and
     *        data needed for initialization of one Input Report characteristic. */
    typedef struct
    {
        uint16_t                      max_len;          /**< Maximum length of characteristic value. */
        ble_srv_report_ref_t          rep_ref;          /**< Value of the Report Reference descriptor. */
        ble_srv_cccd_security_mode_t  security_mode;    /**< Security mode for the HID Input Report characteristic, including cccd. */
    } ble_hids_inp_rep_init_t;
    
    /**@brief HID Service Output Report characteristic init structure. This contains all options and
     *        data needed for initialization of one Output Report characteristic. */
    typedef struct
    {
        uint16_t                      max_len;          /**< Maximum length of characteristic value. */
        ble_srv_report_ref_t          rep_ref;          /**< Value of the Report Reference descriptor. */
        ble_srv_cccd_security_mode_t  security_mode;    /**< Security mode for the HID Output Report characteristic, including cccd. */
    } ble_hids_outp_rep_init_t;
    
    /**@brief HID Service Feature Report characteristic init structure. This contains all options and
     *        data needed for initialization of one Feature Report characteristic. */
    typedef struct
    {
        uint16_t                      max_len;          /**< Maximum length of characteristic value. */
        ble_srv_report_ref_t          rep_ref;          /**< Value of the Report Reference descriptor. */
        ble_srv_cccd_security_mode_t  security_mode;    /**< Security mode for the HID Service Feature Report characteristic, including cccd. */
    } ble_hids_feature_rep_init_t;

  • Yes, the parameter was removed as it was not used.

    In the ble_app_hids_keyboard example in SDK 15, the parameter is set to 1 when used:

    ble_hids_feature_rep_init_t const * p_rep_init = &p_hids_init->p_feature_rep_array[i];
    
    err_code = rep_char_add(p_hids,
                            &properties,
                            p_rep_init->max_len,
                            &p_rep_init->rep_ref,
                            &p_rep_init->security_mode,
                            1,
                            &p_hids->feature_rep_array[i]);

Related