Health Thermometer example

11个帖子/ 0新
最后一篇
ronald
离线
Last seen:4年3个月前
加入:2016-03-03 15:01
Health Thermometer example

我am using SDK 5.0.3, the DA14580DEVKIT with 14583 daughterboard.
我want to measure temperature so I use the htpt (Health Thermometer Profile Thermometer) profile. In a later state I will realy measure temp but for now the data may be a constant.
我have included #include "htpt.h" in “user_profiles.config.h”.

我see that the “htpt.c” code is embedded in the Keil debugger.

在论坛上我读了http://support.dialog-semiconductor.com/cant-not-find-taskappht-htpt-pro...关于“您必须创建app_htc_task和app_htc以便与配置文件进行交互”。这对我来说是不够的信息。我已经阅读了UM-B-051和UM-B-050 ​​PDF文件。
阅读论坛我明白需要一个温度计项目示例。对话您可以提供一个例子。因为引用SDK3不适合我。

谢谢

Device:
MT_dialog
离线
Last seen:2个月1周前
职员
加入:2015-06-08 11:34
嗨罗纳德,

嗨罗纳德,

Some of the application layer profiles in SDK3 like the thermometer are not 100% functional and they need some modifications, unfortunatelly there isn't any official example how to implement, port a profile or any existing reference design that can show the way of implementing the thermometer profile, i will try to provide some guidelines in order to port this from SDK3 to SDK5, i hope i dont forget anything since the process is a bit long. You can either start from blank .c files and try to implement the two app_ht_task.c/h and app_ht.c/h based on another profile example (the battery of the device information service) or port the allready existing profile and take the app_ht_task.c/h and app_ht.c/h from SDK3 which allready have the implementation of the application profile. The following steps describe a portion of the second option of applying modification to the existing implementation.

1) Take from the SDK3 the profile implementation from the directory src/modules/app/src/app_profiles/ht and place them to the application profile directory of the
SDK5 project.

2)打开keil并将健康温度计文件放在keil目录树的sdk_app文件夹中,还包括corresposnding头文件。

3)您必须修改app_ht.c / h和app_ht_task.c / h文件,其中一些关键更改是:

a)您必须替换BLE_APP_HT并设置新的定义BLE_HT_THERMOM,以便在所有必需文件中进行适当的夹杂物。

b) You will have to replace the TASK_APP_HT with the proper TASK either TASK_APP or TASK_HTPT to the corresponding tasks, please check the RW BLE Health Thermometer
配置文件界面规范,以便清楚了解,您还可以参考其他配置文件实现和相应的回调
get it. Additionally the states of the corresponding tasks should be changed as well (for example instead of invoking ke_state_set(TASK_APP_HT, APP_HT_IDLE); should
更改为ke_state_set(task_htpt,htpt_idle);)

c) Change the APP_HT_STATE_MAX and APP_HT_IDX_MAX to HTPT_STATE_MAX, HTPT_IDX_MAX in the app_ht.c file in the TASK_DESC_APP_HT and wherever those two defines occur.

d) In the file app_ht.c file at the app_ht_enable_prf() function remove the ke_state_set(TASK_APP_HT, APP_HT_CONNECTED).

e) In the app_htpt_temp_send() function change the instruction req->conhdl = app_env.conhdl to req->conhdl = app_env[0].conhdl.

f) In the app_ht_task.c remove the app_display.h file.

g) The callbacks and the corresponding messages should be created in the app_ht_task.c file and also the function that will handle those messages. Please check the below snippet:

static const struct ke_msg_handler app_htpt_process_handlers [] =
{
{HTPT_CREATE_DB_CFM, (ke_msg_func_t)htpt_create_db_cfm_handler},
{HTPT_DISABLE_IND, (ke_msg_func_t)htpt_disable_ind_handler},
{htpt_meas_intv_chg_ind,(ke_msg_func_t)htpt_meas_intv_chg_ind_handler},
{APP_HT_TIMER, (ke_msg_func_t)app_ht_timer_handler},
};

枚举process_event_response app_htpt_process_handler(ke_msg_id_t const msgid,
void const * param,
ke_task_id_t const dest_id,
ke_task_id_t const src_id,
enum ke_msg_status_tag *msg_ret)
{
return (app_std_process_event(msgid, param,src_id,dest_id,msg_ret, app_htpt_process_handlers,
sizeof(app_htpt_process_handlers)/sizeof(struct ke_msg_handler)));
}

h) In the htpt_create_db_cfm_handler() change the if (ke_state_get(dest_id) == APP_HT_DISABLED) to if (ke_state_get(dest_id) == APP_DB_INIT) in order to receive the proper confirmation when you are going to get the confirmation for creating the database.

i)为了在初始化期间通过应用程序调用2个基本函数,您将必须在user_prf_funcs []下一行{task_htpt,app_ht_create_db_send,app_ht_enable_prf}中添加,并且您必须将app_htpt_process_handler设置为从温度计任务中获取的消息的处理程序,以便在App_entry_point.c中添加以下代码段(以及其他配置文件处理处理程序)。

#if ((BLE_HT_THERMOM) && (!EXCLUDE_DLG_HTPT))
(process_event_func_t) app_htpt_process_handler,
#endif

By using the allready existing application profile implementations as examples it will be easier to get through the process.

Thanks MT_dialog

ronald
离线
Last seen:4年3个月前
加入:2016-03-03 15:01
谢谢你提供的详情,

谢谢你提供的详情,
我will follow the description

Ronald

ronald
离线
Last seen:4年3个月前
加入:2016-03-03 15:01
你好,

你好,

我们采取了Prox应用程序来修改。
很明显,任务Task_App_Ht在SDK5中的Task_Apd和Task_htpt中拆分。在很多不是用户SDK文件中必须更改。
Personally I find this customer unfriendly.

我n “htpt_enable_req_handler”
// Go to connected state
ke_state_set(TASK_HTPT, HTPT_CONNECTED);
is executed.

Nordic Android应用程序“健康温度计”可以是开放的。这个应用程序将保持联系。但不会显示任何温度。

从未调用“app_ht.c”中的“app_htpt_temp_send”函数。

The following code is added in “app_default_handlers.c”
#if ble_ht_thermom.
app_ht_init();
#endif

以下代码在“app_entry_point.c”中添加
#if((ble_ht_thermomomomomom)&&(!exclude_dlg_bass))
(process_event_func_t) app_htpt_process_handler,
#endif

The following code is added in “app.c”
#if ble_ht_thermom.
{task_htpt,app_ht_create_db_send,app_ht_enable_prf},
#endif

有什么建议么?

MT_dialog
离线
Last seen:2个月1周前
职员
加入:2015-06-08 11:34
嗨罗纳德,

嗨罗纳德,

标准配置文件在SDK3不是functional and require some modifications in order to operate, they have been placed in the SDK3 in order to act as examples in user implementations and since they weren't used in a design they were included in the SDK as a reference. Regarding your implementation, you should be ok with the above modifications. Now regarding the fact that you dont get the notifications or indications with new measurement values, in the app_ht_create_db_send if you left it as is then you should support all the optional features that the service requires, that means that the interval characteristic is writable. The new measurements are triggered by a timer (APP_HT_TIMER msg) in steady intervals. The specific timer is set when the user writes the interval characteristic. Upon writing a value between APP_HT_MEAS_INTV_MIN and APP_HT_MEAS_INTV_MAX you should be able to get notifications or indications. If you are not bonded the first time you will try to write to that characteristic, your command will be rejected with unsufficient authentication error (since the writable characteristic is requires authentication) and your android should initiate a bonding procedure (make sure that the CFG_APP_SECURITY is defined in the da1458x_config_basic.h file), after the bonding is completed you will be able to write to that characteristic. After the successfull write you should get notifications/indication depends on your configuration about the Temperature measurement or the Intermediate Temperature.

我n case you dont have any data on your phone you can debug your issue using breakpoint, check that upon the write command you send a HTPT_MEAS_INTV_CHG_IND (from the gattc_write_cmd_ind_handler) and the appropriate handler is called htpt_meas_intv_chg_ind_handler(), then check in the handler the ke_timer_set(APP_HT_TIMER, ....) is reached. Also in the ke_timer_set(APP_HT_TIMER, dest_id, ) make sure that the task that will be notified when the timer elapses is the TASK_APP (id 0x32), and check if you get the handler of the timer when the time elapses.

Thanks MT_dialog

Z20121202038
离线
Last seen:3 years 11 months ago
加入:2016-03-30 12:51
你好,

你好,
我想知道SDK 5.0.3和SDK3之间的主要区别。
SDK3 has more example about the measurement of the temperature, so is it neccessary to change to SDK 5 ?

MT_dialog
离线
Last seen:2个月1周前
职员
加入:2015-06-08 11:34
嗨z20121202038,

嗨z20121202038,

SDK5具有更多API,更容易开始。对话框建议它为新项目开发。

Thanks MT_dialog

Max44
离线
Last seen:9 months 1 week ago
加入:2016-02-08 15:58
我have some similar questions

我have some similar questions but relative to SDK5 that I'm using with a DA14580 Basic Kit. I'd like to add a Health Thermometer profile to the Device Information Service of the BLE barebones example and I'm finding it's not clear in the User Manuals UM-B-050 and -051 exactly how to configure this. From looking over the SDK files under profiles->htp it seems to be a Health Thermometer server you would need both the htpc and htpt tasks. Is this correct? If I just add includes for htpc,h and htpt.h to my user_profiles_config.h file I get build errors:

.\out_580\ble_app_bbt_580.axf: Error: L6218E: Undefined symbol htpc_init (referred from prf_utils.o).
。\ out_580 \ ble_app_bbt_580.axf:错误:l6218e:未定义的符号htpt_init(从prf_utils.o引用)。
没有足够的信息来生成Symdefs文件。
Not enough information to produce a FEEDBACK file.
Not enough information to list image symbols.

所以显然仍有一些失踪。我wasn't sure what but guessed that from the diss files present I should add files relating to htp to the sdk_profiles folder: htpc.c, htpc_task.c, htpt.c, htpt_task.c. Now I at least get a build without errors. I'm wondering if there are some configuration parameters that need to be set in the user_profiles_config.h file such as were made for the diss? And do I also need to create an app_htpt.c, app_htpt_task.c,app_htpc.c, and app_htpc_task.c as mentioned above? Are there guidlines for this somewhere?

MT_dialog
离线
Last seen:2个月1周前
职员
加入:2015-06-08 11:34
Hi Max44,

Hi Max44,

在SDK5中,不包括健康温度计曲线,在SDK3中,这些轮廓包括在内,但它们并不完全运行,并且它们需要一些修改以便运行。为了在项目中拥有HTPT服务,您需要拥有HTPC和HTPC_TASK,因为这些文件是将构建数据库并与您的应用程序交互的文件。请按照上面的描述如何实现HTPT配置文件。

Thanks MT_dialog

Max44
离线
Last seen:9 months 1 week ago
加入:2016-02-08 15:58
Thanks .... I think. This is

Thanks .... I think. This is bad news. The procedure above to implement the Health Thermometer profile looks ugly, but I'll try it.

我s there a fully operational and tested standard BLE profile (other than the Design Information Service) that I can use as a reference example? Primarily for setting up tasks, databases, and message handlers.

MT_dialog
离线
Last seen:2个月1周前
职员
加入:2015-06-08 11:34
Hi Max44,

Hi Max44,

Sorry but there is no application implementation for the Health Thermometer, about the other profiles you can check the proximity, the battery, and the find me profile, those should provide enough guidance to implememnt the thermometer profile properly. You can find an implementation of those profiles in the prox_reporter project.

Thanks MT_dialog

主题锁定