1 Reply Latest reply on Dec 19, 2016 4:36 AM by anpm

    Simultaneously advertise and scan

    jaemann.park_1817436

      I would like to simultaneously broadcast advertisement packets while scanning for broadcast messages from other devices.

         

      The following threads seem to indicate that this is possible, however I am not sure how to program this behavior.

         

      http://www.cypress.com/forum/psoc-4-ble/scanadvertise-vs-connectedbroadcasting

         

      http://www.cypress.com/forum/psoc-4-ble/gap-profiles-broadcast-observer

         

      Could anyone point me in the direction or provide some example code?

         

      Specifically, I would like to broadcast data that includes dynamically updated user-specific data while scanning for advertisement packets from other devices (which implement the exact same broadcast+observer behavior).

         

      My target device is CYBLE-212019-00.

         

      Thanks,

         

      Jaemann

        • 1. Re: Simultaneously advertise and scan
          anpm

          Hi Jaemann,

             


          Yes, it is possible to do both broadcaster and observer at the same time.

             

          In the BLE component, You can put the device in to Central and Peripheral GAP role ,

             

          Broadcaster settings to be noted: Make the advertisement settings as : Discovery mode: Non discoverable Advertising: Non connectable undirected advertising

             

          Observer settings to be noted: To make the central in observer mode, add the below code in the CYBLE_EVT_STACK_ON event. cyBle_discoveryInfo.discProcedure=CYBLE_GAPC_OBSER_PROCEDURE; (for making observation procedure) After this call start scan API. Call start advertising API also in stack on. Now the device will act both as broadcaster and observer.

             

          Thanks,

             

          Anjana