Giter VIP home page Giter VIP logo

Comments (2)

zerosensei avatar zerosensei commented on August 21, 2024

Hi brain112,

GAPRole_SetParameter(GAPROLE_ADVERT_DATA, sizeof(advertData), advertData);
This function is designed to be called in the initialization state,so it may cause status errors when called in other stages.

You can use this function to update the advertising data:

/**
 * @brief   Setup or change advertising and scan response data.
 *
 * @note    if the return status from this function is SUCCESS,the task isn't complete
 *          until the GAP_ADV_DATA_UPDATE_DONE_EVENT is sent to the calling application task.
 *
 * @param   taskID - task ID of the app requesting the change
 * @param   adType - TRUE - advertisement data, FALSE  - scan response data
 * @param   dataLen - Octet length of advertData
 * @param   pAdvertData - advertising or scan response data
 *
 * @return  SUCCESS: data accepted
 *          bleIncorrectMode: invalid profile role
 */
extern bStatus_t GAP_UpdateAdvertisingData( uint8_t taskID, uint8_t adType, uint16_t dataLen, uint8_t *pAdvertData );

This function wiil send a message to a valid taskID, if you use the Peripheral_TaskID, you can handle the message here:

static void Peripheral_ProcessGAPMsg(gapRoleEvent_t *pEvent)
{
    switch(pEvent->gap.opcode)
    {
        case GAP_ADV_DATA_UPDATE_DONE_EVENT:
            PRINT("%s data update status: %#x\n",
                       pEvent->dataUpdate.adType ? "adv" : "scan", pEvent->dataUpdate.hdr.status);
            break;
        ...

from ch583.

brain113 avatar brain113 commented on August 21, 2024

Hi zerosensei,
This works! Thank you!

from ch583.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.