Hello Dialog Team
I want to reflect BD Address which read form a specific area of external memory to DA14580 .
In AN-B23 chapter 9.1.1 and chapter 12.5 , example source has been described for only trimmig value.
About BD address value read from External memory, I do not know the modification .
How should BD address value from extenal memory reflect to DA14580 ?
Best Regards
Hi Shuhei,
BD address is loaded by custom_nvds_get_func into the stack.
Hello Dialog Team
Thanks for your reply.
I confirmed it works well by copying the BD address read from external memory to "buf" in nvds.c, .
I appreciate your information.
BestRegards
Best Regards
Hi, Dialog
My chipset is also 14580.
I want to change BD address dynamically, therefor, I reference this artical.
I know I must modify custom_nvds_get_func in nvds.c
so I prepare a bd address in char array: {{0x61},{0x62},{0x63},{0x64},{0x65},{0x66}}
here is my custom_nvds_get_func:
extern char device_bd_addr[6];
uint8_t custom_nvds_get_func(uint8_t tag, nvds_tag_len_t *lengthPtr, uint8_t *buf)
{
switch (tag)
{
case NVDS_TAG_BD_ADDRESS:
if (nvds_data_ptr->NVDS_VALIDATION_FLAG & BD_ADDRESS_VALID)
{
if (*lengthPtr < NVDS_LEN_BD_ADDRESS)
{
*lengthPtr = 0;
return NVDS_LENGTH_OUT_OF_RANGE;
}
else
{
uint8_t buf1[6];
memcpy(&buf1,&device_bd_addr,NVDS_LEN_BD_ADDRESS);
*lengthPtr = NVDS_LEN_BD_ADDRESS;
return nvds_get_func(tag, lengthPtr, buf1);
}
}
break;
}
return nvds_get_func(tag, lengthPtr, buf);
}
my invoker is in uart_sps.c
nvds_tag_len_t lengthPtr;
uint8_t buff1[6];
uint8_t re = custom_nvds_get_func(NVDS_TAG_BD_ADDRESS, &lengthPtr, buff1);
if(re == NVDS_OK)
{
app_gapm_reset_msg_create();
app_easy_gap_advertise_with_timeout_stop();
app_easy_gap_undirected_advertise_start();
}
The final bd address had really changed (not default{0x00, 0x00, 0x00, 0xCA, 0xEA, 0x80} ), but its value is not expected {{0x61},{0x62},{0x63},{0x64},{0x65},{0x66}}
it is 0x00, 0x06, 0x00, 0x00, 0x00, 0x00
what's wrong?
Hi double524,
I dont exactly get what you are trying to do, but why you allocate an extra local array and copy the bd address from the array that you allready have in a global variable and also why after doing that you call the nvds_get_func() again ?
只要做以下,你将能够get the advertising address that you want from the device_bd_addr array that you have set.
case NVDS_TAG_BD_ADDRESS:
{
if (nvds_data_ptr->NVDS_VALIDATION_FLAG & BD_ADDRESS_VALID)
{
if (*lengthPtr < NVDS_LEN_BD_ADDRESS)
{
*lengthPtr = 0;
return NVDS_LENGTH_OUT_OF_RANGE;
}
else
{
memcpy(buf,device_bd_addr,NVDS_LEN_BD_ADDRESS);
*lengthPtr = NVDS_LEN_BD_ADDRESS;
return(NVDS_OK);
}
}
break;
}
Thanks MT_dialog