SWCU185G January 2018 – June 2024 CC1312PSIP , CC1312R , CC1352P , CC1352R , CC2642R , CC2642R-Q1 , CC2652P , CC2652PSIP , CC2652R , CC2652RB , CC2652RSIP , CC2662R-Q1
The CMD_BLE_ADV_PAYLOAD command can be used to change the payload buffer for a legacy advertising command. It may be issued regardless of whether an advertising command is running or not.
The command structure shall have the format given in Table 26-95. When received, the radio CPU shall check if an advertiser radio operation command is running using the parameter structure given in pParams of the immediate command structure. If not, the radio CPU shall update the parameter structure immediately. If a radio operation command is running using the parameter structure to be updated, the radio CPU shall only modify the parameter structure if the payload to be changed is not currently being transmitted. If it is being transmitted, the radio CPU shall store the request and update as soon as transmission of the packet has finished.
When updating the parameter structure, the payload to change depends on the payloadType parameter of the command structure. If payloadType is 0, the radio CPU shall set pParams->advLen equal to newLen and pParams->pAdvData equal to newData. If payloadType is 1, the radio CPU shall set pParams->scanRspLen equal to newLen and pParams->pScanRspData equal to newData. After the update has taken place, the radio CPU shall raise a Tx_Buffer_Changed interrupt, see Table 26-124. This interrupt shall be raised regardless of whether the update was delayed or not.
If any of the parameters are illegal, the radio CPU shall respond with ParError in CMDSTAT and not perform any update. Otherwise, the radio CPU shall respond with Done in CMDSTAT. This may be done before the update has taken place.
This command is provided to provide an atomic change of the payload and length. For the Bluetooth 5 advertiser command, this is not needed. The pointers pAdvPkt and pRspPkt may safely be changed at any time; however, the packet entry pointed to must not be modified until the command has ended.