SDK:3.0.6
I use sample128.c profile ,
When Center write sample128 chara.., I will receive message :GATTC_WRITE_CMD_IND ,and go into gattc_write_cmd_ind_handler,It is work well .
I want to know , if center( smart phone ,or others ) read characteristic by UUID , I should receive message :GATTC_READ_CMD right ?
So I add the code :
/// Connected State handler definition.
const struct ke_msg_handler sample128_connected[] =
{
{GATTC_WRITE_CMD_IND, (ke_msg_func_t) gattc_write_cmd_ind_handler},
{SAMPLE128_UPD_CHAR2_REQ, (ke_msg_func_t) sample128_upd_char2_req_handler},
{GATTC_READ_CMD, (ke_msg_func_t) sample128_read_ind_handler},
};
Q1: but ,the function sample128_read_ind_handler(...) never called ~?why?(Is we just can receive GATTC_WRITE_CMD_IND message ?)
Q2:I want to receive message like:GATTC_EXC_MTU_CMD ,GATTC_DISC_CMD.and so on ,How to do?
Thanks for your help .
Hi,
You will not receive a GATTC_READ_CMD_IND from the stack when a client is attempting to read data. Read commands are intended to read data directly from the GATT database in order to save power. So you don't have the option to detect a read that way. Think of the GATT layer as a database - data is available to a client on request, it isn't usually generated on request.
The avilable GATT API is described in RW-BLE-GATT-IS document.GATTC_EXC_MTU_CMD and GATTC_DISC_CMD are commands that a client can send to a server. The responses to those commands on the server side are handled by the stack automatically.
The naming convention is as follows (The end of the primitive name, or message name, if you like):
_CMD, this is a command that you can send (example GATTC_READ_CMD)
_REQ, are very much like commands
_IND, this is an indication/event that you can act on with a handler (Response to a CMD)
_EVT,非常喜欢indications
_RSP, response to _REQ
I hope that sheds a little light on the matter
Hi,MHv_Dialog
Thanks for your reply!
I have another question:I had create sample128 profile(and it work well )。I want the DA14580 to be a center role,it can Discover sample128 profile、and read write characteristic。
Is there has any example?(I found proxm.c proxm_task.c,but it is not enougth to me .).Thanks.
Hi Stone_wang,
Unfortunatelly theres no examples or a tutorials about the 128 sample in a central role, but you can check the DSPS reference design in the host side, since the DSPS service is a profile based on the 128 profile you can use this in order to develop a host based on the custom profile.
Thanks MT_dialog
Hi MT_dialog
Thanks for your reply,I have another question about EXTERN_SLEEEP,
Q1,When Device work in extern sleep mode,and connect with Android 。( Is the Device will no go into extern_sleep mode?)。
Hi Stone_wang,
I am not sure i undestand the question, i assume that you mean when the device is operating under extended sleep mode.... when the device is operating under sleep mode it falls into sleep (extended or deep) between the connection intervals or between the advertising intervals when in advertising mode.
Thanks MT_dialog