AnsweredAssumed Answered

How to update advScanStruct after initialization?

Question asked by pradeep v on May 21, 2018
Latest reply on May 29, 2018 by pradeep v

Hi,
I am using FRDM-KW41Z and MCUXpresso SDK-2.2 ,i want to change my advstruct after initialization or while advertising.
I am using wireless uart demo application from bluetooth application .

 

i have an advstruct of this type

static const gapAdStructure_t advScanStruct[] = {
{
.length = NumberOfElements(adData0) + 1,
.adType = gAdFlags_c,
.aData = (uint8_t *)adData0
},
{
.length = NumberOfElements(uuid_service_wireless_uart) + 1,
.adType = gAdComplete128bitServiceList_c,
.aData = (uint8_t *)uuid_service_wireless_uart
},
{
.length = 7,
.adType = gAdShortenedLocalName_c,
.aData = (uint8_t*)"NXP_WU"
}
};

i am trying to update this structure in my wireless uart application

void Update_AdvStruct(void)
{
   for(int i = 0;i<gAppAdvertisingData.cNumAdStructures;i++)
   {
      if(gAppAdvertisingData.aAdStructures[i].adType == gAdShortenedLocalName_c)
         {
            FLib_MemCpy(&gAppAdvertisingData.aAdStructures[i].aData,"NEW_WU",7);
         }
     }
}

i changed the advstruct from static const to static struct also and tried.
Always fails in memcpy.
How can i update this name in runtime?
whether i have to change adType for updating ? 

Outcomes