< div class = "字段field-name-taxonomy-forums field-type-taxonomy-term-reference field-label-above”> < div class = "字段标签" >论坛:,< / div > < div class = "字段条目" > < div class =”field-item甚至“rel = " sioc: has_container " > < a href = " /论坛/ dialog-smartbond-bluetooth-low-energy - % E2 % 80% 93 -软件”“=“sioc:容器sioc:论坛”属性= " rdfs: label skos: prefLabel”数据类型= " " >对话框Smartbond蓝牙低能量-软件< / > < / div > < / div > < / div > < div class =”字段field-name-body field-type-text-with-summary field-label-hidden”> < div class = "字段条目" > < div class =”field-item甚至“财产=“内容:编码”> < p >你好,< br / >最近我用AD14580开发一些祝福亚博国际官网平台网址应用程序。现在我遇到了一些问题。我得不到任何发展。
首先,我学习了一些外围设备,如timer,spi。他们工作得很好。然后在DA14580上运行一些BLE示例。他们还工作。但是我不能理解软件架构,即使我阅读一些pdf文件,如umb - 015_da14580软件架构v4.0或umb -003软件开发指南1.4几天。
>
>
>
>
>
>
我的目标是知道如何根据我自己的应用程序写或改编一个proflie。我怎么能这么做?
>顺便说一下,我想问一个具体的软件问题。我在网上找到了一个例子。It can send the same bytes through BLE when it receive some bytes.The function below plays a leading role.It is in streamdatad_task.c,one of the profiles.I don't know how it works.I can't fine any information about some function it calls like attmdb_att_set_value, atts_write_rsp_send,attmdb_att_update_value.This makes me desprate and more confused.
/**
****************************************************************************************
* @brief Handles reception of the @ref GATT_WRITE_CMD_IND message.
* The handler checks if the stream needs to be turned on.
* @param[in] msgid Id of the message received (probably unused).
* @param[in] param Pointer to the parameters of the message.
* @param[in] dest_id ID of the receiving task instance (probably unused).
* @param[in] src_id ID of the sending task instance.
* @return If the message was consumed or not.
****************************************************************************************
*/
static int gattc_write_cmd_ind_handler(ke_msg_id_t const msgid,
struct gattc_write_cmd_ind const *param,
ke_task_id_t const dest_id,
ke_task_id_t const src_id)
{
// Update the attribute value
char ValueBuf[20]={0};
/* */
switch (STREAMDATAD_IDX(param->handle))
{
case STREAMDATAD_IDX_ENABLE_VAL:
attmdb_att_update_value(param->handle, param->length, param->offset,
(uint8_t*)&(param->value[0]));
atts_write_rsp_send(streamdatad_env.conhdl, param->handle, PRF_ERR_OK); memcpy(ValueBuf,&(param->value),param->length);
attmdb_att_set_value(STREAMDATAD_DIR_VAL_HANDLE(0), param->length, (uint8_t*)&(param->value[0]));
prf_server_send_event((prf_env_struct *)&(streamdatad_env.con_info), false, STREAMDATAD_DIR_VAL_HANDLE(0));
if(ValueBuf[0] =='1' )
{
GPIO_SetActive(GPIO_PORT_1, GPIO_PIN_0);
}
else
{
GPIO_SetInactive(GPIO_PORT_1, GPIO_PIN_0);
}
break;
case STREAMDATAD_IDX_STREAMDATAD_D0_EN:
__nop();
break;
case STREAMDATAD_IDX_STREAMDATAD_D0_VAL:
__nop();
break;
}
return (KE_MSG_CONSUMED);
}