This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Change from BLE4 to BLE5 long range (Central and Peripheral) - on the fly

Is it possible to change the protocol on the fly (i.e. based on a flag status or GPIO) from BLE4 to Long range BLE5?

Parents Reply
  • If I understand you correctly the nRF52840 will be connected to a peripheral over 1/2mbps PHY, and you want it to connect to another device that is advertising using Coded PHY(128kbps) upon reception of a certain UART message.

    In order to do that, you need to start a scan in CODED_PHY with a call to sd_ble_gap_scan_start() with a ble_gap_scan_params_t that has the .scan_phys set to BLE_GAP_PHY_CODED, and the .extended set to 1. 

    If the radio receives an advertisement on CODED_PHY it will send an advertisement report event to the application, where you will have to decide whether to connect to this particular device or not. To connect you call sd_ble_gap_connect with the peer address as provided in the advertising report, along with the scan parameters you used, a set of connection parameters that you would like, and an optional connection configuration. 

    The UART communication can be achieved through the UARTE driver

Children
Related