Health Thermometer example

11 posts / 0 new
Last post
ronald
Offline
最后一次露面:4 years 3 months ago
Joined:2016-03-03 15:01
Health Thermometer example

我正在使用SDK 5.0.3,Da14580Devkit,14583子板。
我想测量温度,所以我使用HTPT(健康温度计型材温度计)轮廓。在稍后的状态下,我将真正测量温度,但现在数据可能是一个常数。
我在“user_profiles.config.h”中包含#include“htpt.h”。

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

我n the forum I readhttp://support.dialog-semiconductor.com/cant-not-find-taskappht-htpt-pro...about “You have to create the the app_htc_task and app_htc in order to interact with the profile”. This is not enough information for me to work with. I have read the UM-B-051 and the UM-B-050 pdf documents.
Reading the forum I understand that there is a need for a thermometer project example. Dialog Could you please provide an example. Because refering to SDK3 is not working for me.

thanks

Device:
mt_dialog.
Offline
最后一次露面:2 months 1 week ago
Staff
Joined:2015-06-08 11:34
Hi ronald,

Hi ronald,

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) Open keil and place the health thermometer files in the sdk_app folder of the keil directory tree also include the corresposnding header files.

3) You will have to modify the app_ht.c/h and app_ht_task.c/h files, some of the key changes are:

a) You will have to replace the BLE_APP_HT and set the new definition BLE_HT_THERMOM in order for the proper inclusions to take place in all the neccesary files.

b)您必须将Task_App_ht替换为Task_App或Task_htpt到相应的任务,请检查RW BLE健康温度计
Profile Interface Specification in order to get a clear understanding also you can refer to other profile implementation and the corresponding callbacks in order to
得到它。此外,还应更改相应任务的状态(例如而不是调用ke_state_set(task_app_ht,app_ht_idle);应该
be changed to ke_state_set(TASK_HTPT, HTPT_IDLE);)

c)将App_ht_state_max和app_ht_idx_max更改为htpt_state_max,在Task_desc_app_ht中的app_ht.c文件中的htpt_idx_max,无论在哪里发生两个定义。

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},
};

enum 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)在htpt_create_db_cfm_handler()中将if(ke_state_get(dest_id)== app_ht_disabled)更改为(ke_state_get(dest_id)== app_db_init)以便在您将获得确认以创建数据库时接收正确的确认。

i) In order to get the 2 basic functions to be invoked by the application during the initialization you will have to add in the user_prf_funcs[] the next line {TASK_HTPT, app_ht_create_db_send, app_ht_enable_prf}, and you will have to set the app_htpt_process_handler as the handler for the messages that will come from the thermometer TASK, in order to do this add the below snippets in the app_entry_point.c (along with the other profile process handlers).

#if ((BLE_HT_THERMOM) && (!EXCLUDE_DLG_HTPT))
(process_event_func_t)app_htpt_process_handler,
#万一

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

谢谢mt_dialog.

ronald
Offline
最后一次露面:4 years 3 months ago
Joined:2016-03-03 15:01
thanks for the information,

thanks for the information,
我will follow the description

罗纳德

ronald
Offline
最后一次露面:4 years 3 months ago
Joined:2016-03-03 15:01
Hi,

Hi,

We took the prox app to modify.
我t became clear that the tasks TASK_APP_HT is split in TASK_APP and TASK_HTPT in SDK5. In a lot of not user SDK files changes had to be made.
就个人而言,我发现这位客户不友好。

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

北欧Android应用的“健康温度计”n be openend. This app will stay connected. But will not show any temperature.

The “app_htpt_temp_send” functions in “app_ht.c” is never called.

The following code is added in “app_default_handlers.c”
#if BLE_HT_THERMOM
app_ht_init();
#万一

The following code is added in “app_entry_point.c”
#if ((BLE_HT_THERMOM) && (!EXCLUDE_DLG_BASS))
(process_event_func_t)app_htpt_process_handler,
#万一

以下代码在“app.c”中添加
#if BLE_HT_THERMOM
{TASK_HTPT, app_ht_create_db_send, app_ht_enable_prf},
#万一

Any suggestions?

mt_dialog.
Offline
最后一次露面:2 months 1 week ago
Staff
Joined:2015-06-08 11:34
Hi ronald,

Hi ronald,

SDK3中的标准配置文件不起作用,并且需要一些修改以便操作,它们已被放置在SDK3中,以便充当用户实现中的示例,并且由于它们不包括在所包括的设计中。在SDK作为参考。关于您的实现,您应该可以使用上述修改。现在,您没有在App_ht_create_db_send中获取新的测量值的事实,如果您离开它,那么您应该支持服务所需的所有可选功能,这意味着间隔特征是可写的。新测量由计时器(App_ht_timer msg)以稳定间隔触发。当用户写入间隔特征时,将设置特定的计时器。在编写app_ht_meas_intv_min和app_ht_meas_intv_max之间的值时,您应该能够获取通知或指示。如果您在第一次尝试写入该特性时,您的命令将被拒绝使用不足的身份验证错误(因为可写特性是需要身份验证),并且您的Android应启动绑定过程(确保CFG_APP_Security是在da1458x_config_basic.h文件中定义),在绑定完成之后,您将能够写入该特征。成功写后,您应该收到通知/指示取决于您的配置有关温度测量或中间温度的配置。

如果您在手机上没有任何数据,可以使用断点调试问题,请检查写命令后,您发送htpt_meas_intv_chg_ind(从gattc_write_cmd_ind_handler),并且相应的处理程序称为htpt_meas_intv_chg_ind_handler(),然后在处理程序中检查ke_timer_set(app_ht_timer,....)已达到。同样在ke_timer_set(app_ht_timer,dest_id)中,确保在计时器经过的是Task_App(ID 0x32)时将通知的任务,并检查当时间经过的时间后收到计时器的处理程序。

谢谢mt_dialog.

z20121202038
Offline
最后一次露面:3 years 11 months ago
Joined:2016-03-30 12:51
Hi,

Hi,
我want to know the main difference between the SDK 5.0.3 and SDK3 .
SDK3有关于测量温度的更多例子,因此它是必不可少的改为SDK 5?

mt_dialog.
Offline
最后一次露面:2 months 1 week ago
Staff
Joined:2015-06-08 11:34
Hi z20121202038,

Hi z20121202038,

The SDK5 has more apis and its more easy to get started with. Dialog recommend's it for new project development.

谢谢mt_dialog.

Max44
Offline
最后一次露面:9 months 1 week ago
Joined:2016-02-08 15:58
我有一些类似的问题

我有一些类似的问题,但相对于SDK5我正在使用DA14580基本套件。我想向BLE Barebones示例的设备信息服务添加健康温度计档案,我发现用户手册UM-B-050和-051完全如何配置此操作。从配置文件下查看SDK文件 - > HTP似乎是一个健康温度计服务器,您需要HTPC和HTPT任务。这样对吗?如果我只添加包括htpc,h和htpt.h给我的user_profiles_config.h文件我得到构建错误:

。\ out_580 \ ble_app_bbt_580.axf:错误:l6218e:未定义的符号htpc_init(从prf_utils.o引用)。
.\out_580\ble_app_bbt_580.axf: Error: L6218E: Undefined symbol htpt_init (referred from prf_utils.o).
Not enough information to produce a SYMDEFs file.
Not enough information to produce a FEEDBACK file.
没有足够的信息来列出图像符号。

所以显然仍有一些失踪。我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.
Offline
最后一次露面:2 months 1 week ago
Staff
Joined:2015-06-08 11:34
嗨max44,

嗨max44,

我n the SDK5 the Health thermometer profile is not included, in the SDK3 those profiles were included but they were not fully operational and they needed some modifications in order to operate. In order to have the HTPT service in your project you need to have the htpc and htpc_task, since those are the files that will build the database and interact with your application. Please follow the above description on how to implement the HTPT profile.

谢谢mt_dialog.

Max44
Offline
最后一次露面:9 months 1 week ago
Joined:2016-02-08 15:58
谢谢......我想。这是

谢谢......我想。这是坏消息。以上实施健康温度计配置文件的程序看起来很丑陋,但我会尝试。

我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.
Offline
最后一次露面:2 months 1 week ago
Staff
Joined:2015-06-08 11:34
嗨max44,

嗨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.

谢谢mt_dialog.

Topic locked