Hi,
Recently I was using AD14580 to develop some BLE applications.Now I met some problems.I can't get any development.
At first,I learned some periphrals,such as timer,spi.They works well.Then I run some BLE examples on DA14580.They also works.But I can't understand the software architecture even I read some pdf file like UM-B-015_DA14580 Software architecture v4.0 or UM-B-003 Software Development Guide 1.4 for several days.
Now I only know a little about RW,profile.I prepare to read some books about BLE to see whether it can become better .
My goal is to know how to write or adapte a proflie myself according to my own application.how could I do that?
By the way,I want to ask a specific software problem.I found a example on the Internet.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);
}
anyone can help me ?
Hi there, if you are looking to develop your own profile, the tutorial guide AN-B-029 is hte best place to start : this will guide you through the process from start to finish. There are also some files which you can use as the examples. Look on the support site for AN-B-029 and its assosciated files. BR JE_Dialog.
thanks a lot!
The file is restricted.Although I tried many times,I still can't receive any email." You will be emailed when access to the SDK is granted.".
Hi,
Go to Products>>DA14580>>Documents>>Application notes>>AN-029(PDF Download)
Hope this helps.
Thanks a lot!But it still can't works.Restricted!
Click the PDF option on the right side of the page. Dont click on the name of the document.
My account has some problems!now it is OK!