1 Reply Latest reply on May 4, 2017 8:11 AM by e.pratt_1639216

    BLE Central vs Peripheral

    rich.soennichsen_1592346

      I have, up until now, used an Android app to connect to my BLE peripheral.  Now I have need to connect CY8CKIT eval board to the peripheral.  I am looking at the UART_to_BLE_Central project.  How does the Central find and connect automatically to the peripheral?  By device address?  Where is this parameter set?

         

       

         

      I have sent notifications from the peripheral to the Android app, how do I send a notification from the Central on the eval board to a characteristic in the profile on the peripheral?  Does the central need to "discover" the characteristic on the peripheral or do you define the characteristic the same on both?

         

       

         

      Thanks

         

       

         

      Rich

        • 1. Re: BLE Central vs Peripheral
          e.pratt_1639216

          Under the app_ble.c file, for the case CYBLE_EVT_GAPC_SCAN_PROGRESS_RESULT, it is checking if the advertisement packet it receives contains manufacturing-specific data corresponding with a data length of 6 and values 0xFF,0x31,0x01,0x3B,0x04.

             

          It is doing it based on the payload data in the advertisement packet, and thus No; It is not doing it based on the device address.

             

          Notifications are inherently 1-way in that they can only be sent from a Data Server to a Data Client; Thus, unless both sides of the BLE connection contain both Client and Server profiles, you can only use notifications from the Peripheral to the Client (generally the Peripheral is the Server).

             

          Either the Central needs to already know the handle of the characteristic it wants to write to (hardcoded to both devices, discovered previously, etc.), or it will need to scan and discover the handle of the characteristic that it wants to interact with. You can send data from the Central to a characteristic on the Peripheral with a characteristic write. This will send a write with the data you want written to the peripheral device, which will then handle the data.