5 Replies Latest reply on May 5, 2019 11:19 PM by GyanC_36

    dynamic broadcaster not updating the GATT

    HeGi_2497906

      I am implementing the Dynamic Broadcaster, and can see that the buffers for the CYBLE_GAPP_DISC_MODE_INFO_T advertData shows the correct data has been loaded in the data structure, and the scan response structure, via the watch window of the emulator,

       

      Here is my call to update:

       

                  if(CyBle_GetBleSsState() == CYBLE_BLESS_STATE_EVENT_CLOSE)

                  {

                  advPayload[18] = accel_data[0];

                  advPayload[19] = accel_data[1];

                  advPayload[20] = accel_data[2];

                  advPayload[21] = accel_data[3];

                  advPayload[22] = accel_data[4];

                  advPayload[23] = accel_data[5];

                

                  CyBle_GapUpdateAdvData(advertData.advData, advertData.scanRspData);

                  CyBle_ProcessEvents();

                  CyBle_GappStartAdvertisement(CYBLE_ADVERTISING_FAST);

                 

                  // send out uart

                  #ifdef DEBUG_UART_ENABLED

                  DBG_PRINTF("\r\t\t\t\t\t\t X:%i %i  Y: %i %i  Z: %i %i \r\n",advPayload[18],advPayload[19],advPayload[20],advPayload[21],advPayload[22],advPayload[23]);

                  #endif

       

      but the stack never updates. What am I doing wrong?

       

      But the scan in the CYSMART tool never changes from the default FF FF FF FF FF FF FF set in the BLE config dialog.

       

        • 1. Re: dynamic broadcaster not updating the GATT
          GyanC_36

          I assume, advertisement has already been started before you call the above mentioned lines and if yes, there is no need of calling CyBle_GappStartAdvertisement(CYBLE_ADVERTISING_FAST) API again. Could you please comment out this line and check if it works?

           

           

          -Gyan

          • 2. Re: dynamic broadcaster not updating the GATT
            HeGi_2497906

            Gyan, that did not fix the issue, everything else works great, I sample the values, store them, can see them,  it just will not update the GATT?

             

            I have attached the bundle.

             

            Herb

            • 3. Re: dynamic broadcaster not updating the GATT
              GyanC_36

              Hi Herb,

               

                In CySmart App , did you disable the duplicate filtering ?  ( Configure Master Setting-> Scam Parameters -> Duplicate Filtering)

               

              I could see the adv data updating using your project. However, I modified some code to run in our board.

               

              If you haven't , please disable the duplicate filtering in CySmart and test once.

               

               

              -Gyan

              1 of 1 people found this helpful
              • 4. Re: dynamic broadcaster not updating the GATT
                HeGi_2497906

                Gyan, you must have changed something else, still no data on CYSMART, duplicate filtering disabled, all the trailing bytes are FF they are supposed to be the dynamic data from our accelerometer.

                • 5. Re: dynamic broadcaster not updating the GATT
                  GyanC_36

                  Here is the attached project. I just bypassed the accelerometer checks in below function. Also, you need to update the same instance of struct CYBLE_GAPP_DISC_MODE_INFO_T.

                   

                  void Sample_Data(void)

                  {

                       if(CyBle_GetBleSsState() == CYBLE_BLESS_STATE_EVENT_CLOSE)

                              {

                                  static uint8 count = 0;

                                  advPayload[18] = count++;

                                  advPayload[19] = count++;

                                  advPayload[20] = count++;

                                  advPayload[21] = count++;

                                  advPayload[22] = count++;

                                  advPayload[23] = count++;

                                  advPayload[24] = count++;

                                  advPayload[25] = count++;

                                  advPayload[26] = count++;

                                  advPayload[27] = count++;

                                  advPayload[28] = count++;

                                

                                  CyBle_GapUpdateAdvData(cyBle_discoveryModeInfo.advData, cyBle_discoveryModeInfo.scanRspData);

                                  CyBle_ProcessEvents();

                                 

                                  // send out uart

                                  #ifdef DEBUG_UART_ENABLED

                                  DBG_PRINTF("\r\t\t\t\t\t\t X:%d %d  Y: %d %d  Z: %d %d \r",advPayload[18],advPayload[19],advPayload[20],advPayload[21],advPayload[22],advPayload[23]);

                                  #endif

                         // get acceleration data and place in manufacturers data

                          if((accelFlag == TRUE)&&(accelInitFlag == TRUE))

                          {

                              // control flags

                              accelFlag = FALSE;

                              accelStartFlag = FALSE;          

                              // go get the data

                              api_Result = Accel_GetData();

                                  if(api_Result != TRANSFER_CMPLT)

                                  {

                                      Status = Status | MER;

                                  }

                   

                   

                              // update adv package

                  //            if(CyBle_GetBleSsState() == CYBLE_BLESS_STATE_EVENT_CLOSE)

                  //            {

                  //                advPayload[18] = accel_data[0];

                  //                advPayload[19] = accel_data[1];

                  //                advPayload[20] = accel_data[2];

                  //                advPayload[21] = accel_data[3];

                  //                advPayload[22] = accel_data[4];

                  //                advPayload[23] = accel_data[5];

                  //              

                  //                CyBle_GapUpdateAdvData(advertData.advData, advertData.scanRspData);

                  //                CyBle_ProcessEvents();

                  //               

                  //                // send out uart

                  //                #ifdef DEBUG_UART_ENABLED

                  //                DBG_PRINTF("\r\t\t\t\t\t\t X:%d %d  Y: %d %d  Z: %d %d \r",advPayload[18],advPayload[19],advPayload[20],advPayload[21],advPayload[22],advPayload[23]);

                  //                #endif

                              }

                          }

                  }

                   

                  -Gyan

                  1 of 1 people found this helpful