2.3.1 Creating Custom GATT Services

To create a private GATT service, enter the following configuration commands:

  1. Power on the RNBD451 module by connecting the RNBD451 Add On Board using a USB Type-C cable to the host PC.
  2. Using the terminal emulator (Tera Term), open the COM port associated with the RNBD451 module with the following settings.
  3. Go to Setup > Terminal.
  4. Under the “New-line” section, from the drop-down list, select CR+LF (Carriage Return, Line Feed) for better reading of data.
    Figure 2-21. Tera Term Serial Port Setup
    Figure 2-22. Tera Term Terminal Setup
  5. Enter into Command mode:
    1. Type the command mode sequence $$$ to enter Command mode.
    2. Enter + for turn on ECHO.
  6. Set to factory default:
    1. Enter SF,2 and verify the module is rebooted after entering the command.
    2. Type the command mode sequence $$$ to enter Command mode.
    Note: Use this command only to remove previously configured services and characteristics and to bring the device to factory reset.
  7. Create the private GATT service with three characteristics by entering the following command.
    PS,4D6963726F636869702D524E34383730
    PC,BF3FBD80063F11E59E690002A5D5C501,02,02
    PC,BF3FBD80063F11E59E690002A5D5C502,02,02
    PC,BF3FBD80063F11E59E690002A5D5C503,18,04
    Figure 2-23. PS and PC Command
    • The PS command creates the GATT private service, identified by UUID 16-byte value 4D6963726F636869702D524E34383730.
    • The PC command creates the characteristics in the service. Each characteristic is identified by the following UUIDs:
      • BF3FBD80063F11E59E690002A5D5C501, BF3FBD80063F11E59E690002A5D5C502, BF3FBD80063F11E59E690002A5D5C503.
      • The second parameter is the characteristics property, and the third parameter is the size of the data value of the characteristics.
  8. Reboot the module using the R,1 command to ensure the new GATT details get stored in PDS.
  9. To verify the GATT service is configured correctly:
    1. Type the command mode sequence $$$ to enter Command mode.
    2. Issue the LS command to list the services.
      Figure 2-24. LS Command