如何使用包括服务属性吗?(ATT_DECL_INCLUDE)

2 posts / 0 new
Last post
smher68
Offline
Last seen:5 years 4 months ago
Joined:2015-02-05 04:56
如何使用包括服务属性吗?(ATT_DECL_INCLUDE)

/*---------------- DECLARATIONS -----------------*/
/// Primary service Declaration
ATT_DECL_PRIMARY_SERVICE = 0x2800,
/// Secondary service Declaration
ATT_DECL_SECONDARY_SERVICE,
/// Include Declaration
ATT_DECL_INCLUDE,
/// Characteristic Declaration
ATT_DECL_CHARACTERISTIC,

if you see file "att.h", you can find this contents

I want to use ATT_DECL_INCLUDE

i try declare include service attribute.

//-------------------------------------------------------------------------------------------------------------
const struct attm_desc sample128_att_db[SAMPLE128_IDX_NB] =
{
//Service Decleration
[SAMPLE128_IDX_SVC] = {ATT_DECL_PRIMARY_SERVICE, PERM(RD, ENABLE), sizeof(sample128_svc),
sizeof(sample128_svc), (uint8_t *)&sample128_svc},
// DISS Service Declaration
[SAMPLE128_IDX_INCL_DISS_SVC] = {ATT_DECL_INCLUDE, PERM(RD, ENABLE),sizeof(struct att_incl_desc), 0, NULL},
...
status = attm_svc_create_db(&sample128_env.sample128_shdl, (uint8_t *)&cfg_flag, SAMPLE128_IDX_NB, &sample128_env.att_tbl[0], dest_id, &sample128_att_db[0]);
...
//-------------------------------------------------------------------------------------------------------------

but i don't know how to fill DB "struct att_incl_desc"

can i see example using include service attribute ?

(need information in example)
1. when
send msg REQ_DB_CREATE

2. where
func req_db_create_hendler

3. how
get diss_service_start_handle
get diss_service_end_handle
//-----------------------------------------------------
/// include service entry element
struct att_incl_desc
{
/// start handle value of included service
uint16_t start_hdl;
/// end handle value of included service
uint16_t end_hdl;
/// attribute value UUID
uint16_t uuid;
};
//-------------------------------------------------------

谢谢你!

JE_Dialog
Offline
Last seen:2 weeks 6 days ago
Staff
Joined:2013-12-05 14:02
Hello, i beleive the local

Hello, i beleive the local team have been in touch and responded to your problem, so i will mark as completed.

BR JE_Dialog