Freertos ble peripheral server bond extend BLE profiles

Dear Community

I am using the “freertos_ble_peripheral_server_bond” example which includes a custom and a BAS service profile. I would like to extend this example with other profiles such as HID or custom services.
Custom services are not the problem since I can copy+paste the existing “app_customss” source and header files and rename and modify it.
I struggle more with adding the HID profile.
I compared the projects “freertos_ble_peripheral_server_bond” with the “peripheral_server_hid” and I see some differences in how the profiles are added.
The guide “RSL10 Sample Code User’s Guide” describes a way how to extend existing projects with either premade profiles or custom services. The description matches with the files of “peripheral_server_hid” but not with the “freerots_ble_peripheral_server_bond”. So how do I included the HID profile there? I enabled in the rte the profiles HID but no code is generated in “RTE → Device → RSL”. Doesn’t need to be code generated such as in “ble_hid.c” which can be used in the application layer?

Many thanks and best regards
Robert

1 Like

@naer

So far RSL10 abstraction can only support a few of standard profiles which can check and then add related *.c file and *.h into RTE - Device - RSL10 folder automatically.
They are listed in here.

Unfortunately, HID profile is not there so far.
You need manually copy ble_hogpd.c and ble_hogpd.h from peripheral_server_hid project into
RTE - Device - RSL10 folder.

After that, using peripheral_server_hid for reference, you can add HID profile into Free_ble_peripheral_server_bond project.

Thank you for using our community forum!

Dear Martin

Thank you very much for your reply. So I explain what I did:
I copied the ble_hogpd.c and .h files from the “peripheral_server_hid” into the RTE → Device → RSL10 folder and followed the instruction in the pdf file Sample Code Users Guide in chapter “How to Add a New Standard Service/Profile”. There I inserted the CFG_PRF_HOGPD in the includes and the amount of error reduced.
I now recognized that the ble_hogpd file does not have the same structure as the ble_bass files from the freerots_ble_peripheral_server_bond example. The instruction in the Sample Code User Guide does not seem to fit for the freertos example. Are you sure it will work like that or how am I supposed to implement this? I see a discprepancy between your documentation Sample Code Users guide and your example freertos_ble_peripheral_server_bond.
For example in the ble_bass.h from RSL10 folder there is not list of message handler such as in ble_hogpd.h.
/* List of message handlers that are used by the HID over GATT profile for

  • device role application manager */
    #define HOGPD_MESSAGE_HANDLER_LIST
    DEFINE_MESSAGE_HANDLER(HOGPD_ENABLE_RSP, Hogpd_EnableRsp),
    DEFINE_MESSAGE_HANDLER(HOGPD_NTF_CFG_IND, Hogpd_NtfCfgInd),
    DEFINE_MESSAGE_HANDLER(HOGPD_PROTO_MODE_REQ_IND, Hogpd_ProtoModeReqInd),
    DEFINE_MESSAGE_HANDLER(HOGPD_CTNL_PT_IND, Hogpd_CtnlPtInd),
    DEFINE_MESSAGE_HANDLER(HOGPD_REPORT_UPD_RSP, Hogpd_ReportUpdRsp),
    DEFINE_MESSAGE_HANDLER(HOGPD_REPORT_REQ_IND, Hogpd_ReportReqInd)

At the moment I am still facing some errors while adding HID profile to the freertos_… project.

Best regards and nice weekend
Robert

@naer

I have attached a modified freertos_ble_peripheral_server_bond project and I have added HID profile.
The reference project (freertos_ble_peripheral_server_bond) is based on RSL10.3.6.465.

Since I have selected DIO5 (BUTTON_DIO) for UART_TX , so this project selects DIO0 (touch to ground) to perform keyboard click.

image

To verify this HID function (after pairing success), you can use GPIO0 pin and touch to GND pin.

On your computer go to Bluetooth & other devices,

Once connected RSL10 board , DIO6 LED is steady on.
image

Touch DIO0 pin to the GND pin on the RSL10 board and you will see letters on notepad , which are defined in on_semi_banner_str.

static struct on_semi_banner_str on_semi_banner[]

image

freertos_ble_peripheral_server_bond_H.7z (598.9 KB)

Thank you for using our community forum!

1 Like

Dear Martin

Thank you for your reply. I have been analyzing this code and the integrated HID part is quite helpful.
I have still some questions and issues with the project / system.
First of all, you inserted “ble_hogpd.c” in the source folder. I am wondering, if the code there is on the application layer or still belongs to the ble stack like the ble_diss.c file in folder RTE->Device->RSL.
So what I would do next, is to seperate the functions and definitions in the ble_hogpd files into ble_hogpd and app_hogpd file, so the structure is the same as with the remaining profiles. Is this method reasonable?
grafik

Next I downloaded the project on the RSL10-sense-gevk development board. As central device I am using the nRF Connect App. The data from the custom service can be received, also the battery level is transmitted correctly. Unfortunately, I receive 30s to 2 minutes after connecting the GATT Error 0x8 on the nRF Connect app. The time seems to be random. Similar issues in forums tend towards a hardware issue. I tried another RSL sense GVK eval board and it behaves the same way. I have no idea what causes this error. Do you have an idea?
What I am gonna do is to install a sniffer and take a look at the transfer.

Best regards
Robert

Hi @naer ,

  1. You can build your own app_hogpd.c and app_hogpd.h for your own application.
    You can use ble_hogpd.c and ble_hogpd.h as abstraction layer files. (like ble_diss.c etc.)

  2. The attached project is for our RSL10-002GEVB. I has not been tested on RSL10-sense-gevk development board.

  3. Could you please try this on RSL10-002GEVB and see if you can get the same issue?

Thank you very much for the response, that helped.
I still think, that in the ble_hogpd.c file are some functions they should be in the app_hogpd.c file. Am I right?
I will look if we have the RSL10-002GEVB inhouse.
Cheers
Robert

Hi @naer ,
Yes. You are right. The project is just a reference to show HID profile.
The ble_hogpd.c is not optimized.