6 Replies Latest reply on Jul 13, 2017 8:23 PM by AndyMarder

    Update advertisement data fails - INVALID_OPERATION

    MartinBirkebæk

      Hi,

         

      I have a running project where i have the PSoC 4 BLE run in what is called multi-role.

         

      Peripheral or central role combined with observer/broadcaster.

         

      My current issue is that the latency for updating advertisement data is quiet large > 1 minute sometimes. And it is not clear to me why that is.

         

      I update advertisement data upon changes in the system. These are queued until they are broadcasted using the advertisement packet.

         

      code snippet:

         

              if ( CyBle_GetBleSsState() == CYBLE_BLESS_STATE_EVENT_CLOSE ) 
              {
                   CYBLE_API_RESULT_T res = CyBle_GapUpdateAdvData(cyBle_discoveryModeInfo.advData,          cyBle_discoveryModeInfo.scanRspData);
              if ( res == CYBLE_ERROR_OK )
              {
                  // Advertisement data updated
              }

         

      }

         

      My problem is that res == CYBLE_ERROR_INVALID_OPERATION

         

      The device is broadcasting advertisement data at that point, so advertisements are enabled and it is in the correct BLESS State, so why do I get this error ?