Hogpd commands Page Up/Down not recognized

Dear Community

We are using the RSL10-Sense-Gevk where we would like to send HID commands over BLE to scroll a pdf up and down to a smartphone. Therefore we use peripheral_server_hid as the example project to send HID commands over the hogpd profile. Unfortunately, the commands are not recognized correctly on the receiving app.
When I am using the ble_server_peripheral project with included hopgd profile it is working and the pdf ond the smarthphone can be scrolled down/up.

The Hogpd_EnableRsp is called after the Enable request and the profile is visible on the nRF Connect App in the peripheral_server_hid project.
The configuration for the hogpd profile is also called and is shown in the following code:

void Hogpd_ServiceAdd(void)
{
    struct hogpd_db_cfg *db_cfg;

    /* Allocate the HOGPD_CREATE_DB_REQ */
    struct gapm_profile_task_add_cmd *req = KE_MSG_ALLOC_DYN(
        GAPM_PROFILE_TASK_ADD_CMD,
        TASK_GAPM,
        TASK_APP,
        gapm_profile_task_add_cmd,
        sizeof(struct
               hogpd_db_cfg));

    /* Fill message */
    req->operation = GAPM_PROFILE_TASK_ADD;
    req->sec_lvl = PERM(SVC_AUTH, ENABLE);
    req->prf_task_id = TASK_ID_HOGPD;
    req->app_task = TASK_APP;
    req->start_hdl = HOGPD_SERV_START_HANDLE;

    /* Set Parameters */
    db_cfg = (struct hogpd_db_cfg *)req->param;
    db_cfg->hids_nb = HOGPD_NUM_OF_HID_DEV;  // Number of HID devices
    db_cfg->cfg[0].svc_features = HOGPD_CFG_KEYBOARD | HOGPD_CFG_PROTO_MODE;
    db_cfg->cfg[0].report_nb = HOGPD_NUM_OF_HID_REP;
    db_cfg->cfg[0].report_char_cfg[0] = HOGPD_CFG_REPORT_IN;
    db_cfg->cfg[0].report_id[0] = HOGPD_NUM_OF_HID_RID;
    db_cfg->cfg[0].hid_info.bCountryCode = HOGPD_NUM_OF_HID_CC;
    db_cfg->cfg[0].hid_info.bcdHID = HOGPD_NUM_OF_HID_VER;
    db_cfg->cfg[0].hid_info.flags = HIDS_REMOTE_WAKE_CAPABLE |
                                    HIDS_NORM_CONNECTABLE;
    db_cfg->cfg[0].ext_ref.inc_svc_hdl = HOGPD_NUM_OF_HID_EXT;
    db_cfg->cfg[0].ext_ref.rep_ref_uuid = HOGPD_NUM_OF_HID_EXT;

    /* Send message */
    ke_msg_send(req);
}

Furthermore, the devices are paired to enable HID data exchange. As far as I know, it is only possible to send keyboard commands if the devices are paired. Am I right?
We are using the Hogpd_ReportUpdReq function to send commands to the Smartphone. We also receive the Hogpd_ReportUpdRsp callback and there is no error occuring.

void Hogpd_ReportUpdReq(const uint8_t conidx,
                        const uint8_t key,
                        const uint8_t mod_id)
{
    /* reply for Hogpd_ProtoModeReqInd */
    struct hogpd_report_upd_req *req;
    struct hogpd_env_tag *hogpd_env;
    hogpd_env = PRF_ENV_GET(HOGPD, hogpd);

    req = KE_MSG_ALLOC_DYN(HOGPD_REPORT_UPD_REQ,
                           prf_src_task_get(&(hogpd_env->prf_env),
                                            conidx),
                           TASK_APP,
                           hogpd_report_upd_req,
                           HOGPD_REPORT_LEN);

    req->conidx = conidx;
    req->report.hid_idx = 0;
    req->report.type = HOGPD_REPORT;
    req->report.length = HOGPD_REPORT_LEN;
    req->report.idx = 0;

    req->report.value[0] = mod_id;
    req->report.value[1] = 0x00;
    req->report.value[2] = key;
    req->report.value[3] = 0x00;
    req->report.value[4] = 0x00;
    req->report.value[5] = 0x00;
    req->report.value[6] = 0x00;
    req->report.value[7] = 0x00;

    /* Send the message */
    ke_msg_send(req);
}

int Hogpd_ReportUpdRsp(ke_msg_id_t const msgid,
                       struct hogpd_report_upd_rsp const *param,
                       ke_task_id_t const dest_id,
                       ke_task_id_t const src_id)
{
    /* Retrieve the index of environment structure representing peer device */
    signed int device_indx = Find_Connected_Device_Index(KE_IDX_GET(src_id));

    if (device_indx == INVALID_DEV_IDX)
    {
        return (KE_MSG_CONSUMED);
    }

    if (param->status != GAP_ERR_NO_ERROR)
    {
        hogpd_support_env.err_cnt++;
    }
    return (KE_MSG_CONSUMED);
}

As start we use following commands for the Hogpd profile:

static struct on_semi_banner_str scrollcmd[] =
{
    // will be extended with more commands (Home, Enable, arrows,...)
    { 0x4B,    /* Page up      */ 0x00 },
    { 0x4E,    /* Page Down    */ 0x00 }
};

So far the project seem to work fine, so we can not explain, why the commands are not recognized in the app. Is there anything important missing or have we missunderstood anything?

Thank you and best regards
Robert

@naer

Please refer to our KB: Advertising RSL10 as an Accessory to iOS and use attached project (peripheral_server_hid_v2) in this topic.

This should solve your issue.

@martin.bela
Thanks a lot for the response. I managed to let it work.
Even the proposed solution does not correlate at all with the issue, since we do not use iOs.

Robert

1 Like