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

BLE multislave communication

Hi all,

We need to develop a communication channel between 2 Controllers One is Master controller and another is Slave controller

  1. Master controller will send Data packet of 8 Byte Length,
  2. Slave controller will receive the Data packet and processed data will be echoed back to master controller

Master to slave Byte 0 0xAA Byte 1 0xFF Byte 2 Command (0x00 to 0x3F - Write Commands, 0x40 to 7F – Read Commands) Byte 3 Data0 Byte 4 Data1 Byte 5 Data3 Byte 6 Data3 Byte 7 Chk Sum

Slave to master Byte 0 0xAA Byte 1 0xFF Byte 2 Command + 0x80 Byte 3 Command Status – (Ok, error, etc…)
Byte 4 Data0 Byte 5 Data1 Byte 6 0x00 Byte 7 Chk Sum

  1. We need option to set unique ID to Module through controller in both Master & Slave
  2. Option to de pair and pair another BLE module In master controller( We have 16X2 LCD and 4X4 Keypad to use)

Please suggest how to achieve the above application using BLE also please provide the links of code which can be used for above application.

thanks in advance

pavan.

  • If you want to use BLE not some proprietary RF protocol then you need to make your application architecture work with BLE stack architecture. So firstly on basically all BLE products (including nRF5x chips with Nordic BLE stacks aka Soft Devices) you don't live on Link Layer and Data packets (PDUs). You need to translate your high-level needs to language of GAP and GATT layers which are the highest in the stack and much higher then LL and PDUs. Normally you could define what device is GAP Central and what GAP Peripheral, which will be GATT Server and which GATT Client, what GATT structures (aka Services and Characteristics) you will use to exercise your custom protocol exchange (= your 8-byte messages and "echos") etc. This is called GAP Profile definition and each real BLE app should have it. However you can for the start use some existing GAP Profile and GATT Service definition just to transport the data over the top. Take a look at Nordic BLE UART Service (aka NUS) examples in nRF SDK, they are ready exactly for this use case (relative paths to SDK root):

    examples\ble_peripheral\ble_app_uart examples\ble_central\ble_app_uart_c

Related