⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
11 posts / 0 new
Last post
herochua617
Offline
Last seen:3 years 11 months ago
加入:2017-01-18 12:46
HRPS profile creation

Hi there,

I am having problem with the hrps profile. I am trying to create a hrps profile so that it can connect with my sensor. I have followed the example in UM-003 for DISS to implement the heart rate profile and I have also read this link about it (https://support.dialog-semiconductor.com/hrps-application-side). Here's in my attachment is the error that I have obtained in Keil MDK. Thanks!

Device:
LT_Dialog (not verified)
Hi herochua617,

Hi herochua617,
Do you define the structurestruct bass_create_db_cfm? You need to define one, better with a proper name such asstruct hrps_create_db_cfmfor easy maintenance. As the content of the structure to be defined and the location where the structure to be put to, you can refer to how bass is done.

herochua617
Offline
Last seen:3 years 11 months ago
加入:2017-01-18 12:46
Hi there,

Hi there,

I have already changed the definition of struct bass_create_db_cfm to struct hrps_create_db_cfm and some of the errors have gone. However, I would like to ask any suggestion for my remaining errors? Thank you very much! I have declared the #include "app_hrps.h". You can have a look on the attachment that I have attached to this message.

herochua617
Offline
Last seen:3 years 11 months ago
加入:2017-01-18 12:46
Hi there,

Hi there,

I found that my heart rate profile cannot advertise. I do not know where is the problem and it seems I have already done all the configuration and there is no error detected from Keil MDK of my coding. I hope that you can have a look. I have followed the linkhttps://support.dialog-semiconductor.com/hrps-application-sideand I have modified the code for app_hrps and app_hrps_task. I only see device information, generic access and generic attribute in the BLE scanner apps and I could not see the Heart Rate Profile. Please help thanks! (ATTACHMENT 4)

LT_Dialog (not verified)
Hi hereochua617,

Hi hereochua617,
can you check if the associated macros are defined properly?

herochua617
Offline
Last seen:3 years 11 months ago
加入:2017-01-18 12:46
Hi LT_Dialog,

Hi LT_Dialog,

我已经比较了app_hrps.c and app_hrps_task.c with the app_diss.c and the app_diss_task.c respectively and I have erased the #if HRPS_DISABLED and #if HRPS_IDLE || BLE_HR_SENSOR. I have no error in Keil MDK. I have found that I need to define UUID is it? or it has been done in the hrps.c and hrps_task.c. Besides that, I do not need to follow the sample128 example right since sample128 is for making new profile and since the hrps profile is already exist in the source file. However, I still wondering where is the problem will be. I cannot see the profile of Heart Rate being showed up in the BLE scanner apps. Thanks, By the way, do I need to change this (attachment 5) in order to make it advertise?

MT_dialog
Offline
Last seen:2 months 3 weeks ago
工作人员
加入:2015-06-08 11:34
Hi herochua617,

Hi herochua617,

心率形象在SDK只有the implementation of the profile and not how the application will handle it (for example the DISS profile has an implementation of the application side, the DISS profile besides the diss.c and diss_task.c files it also has available the files app_diss.c and app_diss_task.c files, those files give the ability to your application to handle the functionallity of the profile itself). So in order to use the hrp profile you will have to create those file and handle the messages that the profile will exchange with your application. Please have a look at the FAQ's on the support site at the Software Implementation section, there are a couple of FAQ's that explain this aspect of the profile and also the hrp is a standard profile with a 16Bit UUID, it has nothing to do with 128Bit example. Assuming that you ve allready done that (i mean create the app_....c file for the heart rate profile) if your device isn't able to advertise then i assume that something is wrong withe the database creation. For example, lets take the diss profile As soon as you create the database the diss_create_db_req_handler() should execute and send a message DISS_CREATE_DB_CFM that your application should handle. The app_diss_task.c file should handle that message and the diss_create_db_cfm_handler should execute, after that function has executed and initialized the database with the required values it should send an APP_MODULE_INIT_CMP_EVT in order for the device to continue to the next profile or start the advertising procedure. If the completion message from the profile isn't handled then the device won't proceed to the advertising procedure or initiate your next profile, if there is one.

Thanks MT_dialog

herochua617
Offline
Last seen:3 years 11 months ago
加入:2017-01-18 12:46
Hi there,

Hi there,

I have initialized all the handlers. I do not know where I have gone wrong since I referred to the app_diss_task.c. Please refer to the attachment 6. But I found that there is a problem that is being showed up. When I load my codes into the development kit once I plugged into the board to the pc, the code able to load into the development kit but the heart rate profile cannot be advertised and only device information service is there with Generic access and attribute. However, I found that when I try to load the code the second time by pressing the debug key in Keil MDK, I found that the link between the board with the PC will suddenly being shutdown and what is the reason, this is happening and it might be the reason why my heart rate service is not being advertise. Thank you very much, MT_Dialog.

herochua617
Offline
Last seen:3 years 11 months ago
加入:2017-01-18 12:46
Hi there,

Hi there,

I am able to see the profile now. But however, it seems that it is no giving any values when i turned on the notifications. Do you see any problems in my handlers? or app_hrps.c? Do I need to set a timer? And since I am not using the SDK 5, and I do not have the app_easy_timer so what is the easiest wat to implement a timer callback function? I would like to create a loop like in the custom profile in the sdk 5 where there is a function call app_adcvall_timer_cb_handler(). How can I implement the same thing in sdk 3?. Thanks

MT_dialog
Offline
Last seen:2 months 3 weeks ago
工作人员
加入:2015-06-08 11:34
Hi herochua617,

Hi herochua617,

You will have to debug this in order to check the reason why the device doens't get to the advertising procedure (place break point to the functions that the code should go through and check if the proper functions are triggered) as soon as the database initialization finishes, what i can comment on the attachment that you have posted is that, in the hrps_create_db_cfm_handler() function you send a HRPS_CREATE_DB_CFM message and a APP_MODULE_INIT_CMP_EVT. The HRPS_CREATE_DB_CFM message is send by the hrps_create_db_req_handler() in the hrps_task.c file and the APP_MODULE_INIT_CMP_EVT message only should be send from the hrps_create_db_cfm_handler() in order to declare that the database is initilized, so that the device will proceed to the initialization of the database or start advertising. Regarding the loosing connection between the Jlink and the PC, i suppose that you are using an SDK older than 5.0.4 and you are using sleep. So either move to the 5.0.4 SDK or remove the sleep from the project if you would like to debug while your fw executes.

Are you sending anything from the application in order to see data on the other side ? please have a look at the RW BLE Heart Rate Profile (HRP) Interface specification, in the Profiles & API Documents in order to see how to use the profile properly. Also regarding the timers in SDK3 and general the SDK3 documentation you can have a look at the Documents section, in the Discontinued documents, SDK3 documents.

Thanks MT_dialog

herochua617
Offline
Last seen:3 years 11 months ago
加入:2017-01-18 12:46
Hi there.

Hi there.

Thanks for your response. I have another question but is not very related to this forum topic so I've asked it in a new topic. Please follow up with this link (https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bl...). Thank you very much.