Implementing the Current Time Profile

7 posts / 0 new
Last post
jd@exp-eng.com
Offline
Last seen:2年6个月前
加入:2014-10-22 04:34
Implementing the Current Time Profile

I could use a little help adding the Current Time Profile in SDK V5.0.3.

I have read thru the Tutorial – Developing a custom profile on DA1458x
http://support.dialog-semiconductor.com/download/file/fid/885

But, rather than implementing the sample128 profile, I would like to implement the current time profile (tipc.c and tipc_task.c). The app note is very thorough but is outdated as we are using SDK5 version 5.0.3. I have also read thru the entire SDK5 Software Development Guide.

The steps that I have done are:

1.从项目开始ble_examples \祝福_app_profile
2. Include the following files in the sdk_profiles folder of the project:
a. Tipc.c
b. Tipc_task.c
c. Tipc.h
d. Tipc_task.h
3. Place #include "tipc.h" in the user_profiles_config.h header file
4. Build-successful 

I am able to run the application but I do not see the BLE Current Time Service, assigned number 0x1805 according to Bluetooth.org. Attached is screenshot of the profiles that I do see. I know that the functions in those files listed above are compile and linked because I can set breakpoints on them. I am not sure what other steps to take in SDK5 to implement this profile correctly. Please let me know if I missed anything ?

Attachment:
Device:
Gongyu_Dialog
Offline
Last seen:2 days 9 hours ago
加入:2016-04-27 07:07
Need to add the app layer

Need to add the app layer code to send the message of "TIPS_CREATE_DB_REQ" and "TIPS_ENABLE_REQ" etc.
The SDK5 doesn't contain the relevant files in directory "app_modules\src". Maybe you can refer to the "app_bass" for example.
Thanks

jd@exp-eng.com
Offline
Last seen:2年6个月前
加入:2014-10-22 04:34
Gongyu,

Gongyu,

Thanks for the input. It sounds like I need to add the app layer code-got it. But, you state that SDK5 does NOT contain the relevant files nor does it contain the app_bass project. So, should I install the SDK3? All signs seem to point to revert back to SDK3 and that's fine. I see that the "Tutorial – Developing a custom profile on DA1458x" uses SDK3.

Gongyu_Dialog
Offline
Last seen:2 days 9 hours ago
加入:2016-04-27 07:07
Hi, Jd

Hi, Jd
Not the app_bass project.They are app_bass.c /app_bass_task.c files.
I mean that you can check these two files for reference.
Besides, I upload a pdf to describe how to add customer files in SDK5. No big difference compared with SDK3 if takes a close look.
You may also check the file inhttp://support.dialog-semiconductor.com/connectivity/product/da14580?qt-...

Just on the support site for customers under DA14580 / Software & Tools / Tutorials

jd@exp-eng.com
Offline
Last seen:2年6个月前
加入:2014-10-22 04:34
Thank you for the attached

Thank you for the attached training doc. It was very useful. I believe I have almost everything I need to make my own custom profile. I did have questions about characteristic write handlers in general looking to get more information on the custs.c and custs1_task.c and header files. Basically, I would to be able to write to a custom characteristic value and have a callback/handler execute when that characteristic value HAS been written to and take that newly written value and transmit out the I2C.

For example, I see the Default State handlers defined in custs1_task.c:

/// Default State handlers definition
const struct ke_msg_handler custs1_connected[] =
{
{GATTC_WRITE_CMD_IND, (ke_msg_func_t)gattc_write_cmd_ind_handler},
{GATTC_CMP_EVT, (ke_msg_func_t)gattc_cmp_evt_handler},
{CUSTS1_VAL_NTF_REQ, (ke_msg_func_t)custs1_val_ntf_req_handler},
{CUSTS1_VAL_SET_REQ, (ke_msg_func_t)custs1_val_set_req_handler},
{CUSTS1_VAL_IND_REQ, (ke_msg_func_t)custs1_val_ind_req_handler},
};

编辑这些文件可以吗?让我知道我是否在正确的轨道上。

Thanks again,

Gongyu_Dialog
Offline
Last seen:2 days 9 hours ago
加入:2016-04-27 07:07
函数“gattc\u write\u cmd

函数“gattc\u write\u cmd_ind_handler" already do the job for the attribute write work.
But if you want to do extra job, I may prefer to add the relevant code in function "user_catch_rest_hndl".

static const catch_rest_event_func_t app_process_catch_rest_cb = (catch_rest_event_func_t)user_catch_rest_hndl;

void user_catch_rest_hndl(ke_msg_id_t const msgid,void const *param,ke_task_id_t const dest_id,ke_task_id_t const src_id)
{
switch(msgid)
{
case CUSTS1_VAL_WRITE_IND:
{
struct custs1_val_write_ind const *msg_param = (struct custs1_val_write_ind const *)(param);
开关(msg_param->handle)
{
case CUST_IDX_SENSOR_PERIOD_VAL: //example ---specific attribute
{
//add your code here for the specific attribute
break;
}

......

default:
break;
}
}

jd@exp-eng.com
Offline
Last seen:2年6个月前
加入:2014-10-22 04:34
Gongyu,

Gongyu,

This worked great! Thank you!

Topic locked