hi dialog
I found a mistake in the document(UM-B-003 V1.7)
我发现一个错误在文档
10.1 Project and Source files
The application developer needs to add source and header files in the project “profiles” group.
For the sample128 profile add the following files in the dk_apps/src/bleip/src/profiles/sample128
directory:
● sample128.c
● sample128.h
● sample128_task.c
● sample128_task.h
the path
DA14580_581_583_SDK_3.0.10.1\dk_apps\src\ip\ble\hl\src\profiles\sample128\sample128.c
DA14580_581_583_SDK_3.0.10.1\dk_apps\src\ip\ble\hl\src\profiles\sample128\sample128.h
DA14580_581_583_SDK_3.0.10.1\dk_apps\src\ip\ble\hl\src\profiles\sample128\sample128_task.c
DA14580_581_583_SDK_3.0.10.1\dk_apps\src\ip\ble\hl\src\profiles\sample128\sample128_task.h
Device:
I suggest that in“ 10.4 the Add services and attributes in the database” increases a hint(in function sample128_create_db_req_handler()in file sample128_task.c for“first the First the service must be added in the database:” )
The Service attribute value must be set to service UUID:
const struct att_uuid_128 sample128_1_svc = {{0xf0, 0x28, 0xe3, 0x68, 0x62, 0xd6, 0x34, 0x90, 0x51, 0x43, 0xef, 0xaa, 0xc6, 0x4c, 0x2f, 0xbc}};
status = attmdb_att_set_value(sample128_env.sample128_1_shdl, ATT_UUID_128_LEN,
(uint8_t *)sample128_1_svc.uuid);
The text as specified below was not found:“ sample128_1_svc ”and“status = attmdb_att_set_value(sample128_env.sample128_1_shdl, ATT_UUID_128_LEN, (uint8_t *)sample128_1_svc.uuid); "
but,i found:
in sample128.c file :
/// sample128_1 Service
const struct att_uuid_128 sample128_svc = {{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F}};
在函数sample128_create_db_req_handler()in file sample128_task.c:
// Add the value of the primary service attribute (The custom UUID)
status = attmdb_att_set_value( sample128_env.sample128_shdl, // Attribute handle
ATT_UUID_128_LEN, // The value is the 128 bit UUID of the service
(uint8_t *)sample128_svc.uuid // UUID of the service
);
thanks for the feedback Libra.. we will verify and feedback to the documentation team. BR JE_Dialog
11.3Message handlers
#if (BLE_SAMPLE128)
//sample128 database creation confirmation message
{SAMPLE128_CREATE_DB_CFM, (ke_msg_func_t)sample128_create_db_cfm_handler},
//sample128 disabled indication
{SAMPLE128_DISABLE_IND, (ke_msg_func_t)sample128_disable_ind_handler},
//sample128 attribute value change by peer device Indication
{SAMPLE128_VAL_IND, (ke_msg_func_t)sample128_val_ind_handler},
#endif
Need to modify
#if (BLE_SAMPLE128)
//sample128 database creation confirmation message
{SAMPLE128_CREATE_DB_CFM, (ke_msg_func_t)app_sample128_create_db_cfm_handler},
//sample128 disabled indication
{SAMPLE128_DISABLE_IND, (ke_msg_func_t)app_sample128_disable_ind_handler},
//sample128 attribute value change by peer device Indication
{SAMPLE128_VAL_IND, (ke_msg_func_t)app_sample128_val_ind_handler},
#endif // BLE_SAMPLE128
11.4 Adding code in project
The created code can be added in the project by following the process described for DISS profile
application code in section 6.
I found some important step is missing.
For example,
APP_SAMPLE128 must be enumerated among all other profiles in “app_api.h”.
/// List of Server Profile to Initialize
enum
{
APP_PRF_LIST_START = 0,
...
#if (BLE_SAMPLE128)
APP_SAMPLE128,
#endif //(BLE_SAMPLE128)
APP_PRF_LIST_STOP,
};
[ question]
10.3Creation of a profile task
The profile task type must be added in the task types enumeration in file rwip_config.h:
TASK_SAMPLE128 = 64 , // Sample128 Task
in file rwip_config.h
/// Tasks types definition
enum KE_TASK_TYPE
{
TASK_NONE = 0xFF,
// Link Layer Tasks
TASK_LLM = 0 ,
TASK_LLC = 1 ,
TASK_LLD = 2 ,
TASK_DBG = 3 ,
...
// Start of conditionally assigned task types
#if (BLE_SAMPLE128)
TASK_SAMPLE128 , // Sample128 Task
#endif
....
TASK_MAX = 64, //MAX is 64. Do not exceed.
}
These two places a little conflict about TASK_SAMPLE128 。
这两个地方有点冲突关于 TASK_SAMPLE128