NXP Semiconductors
UM11490
Feature Configuration Guide for NXP-based Wireless Modules on i.MX 8M Quad EVK
4.6 Bluetooth LE device as GATT server
This section shows how to configure the i.MX 8M Quad board as a Bluetooth LE GATT
Server using the example of Battery Service registration.
Use the following steps to configure the Battery Service for LE GATT server. To configure
more services please refer the
.
Start
bluetoothctl
to interact with the Bluetooth daemon from the command line
root@imx8mqevk:~#
bluetoothctl
Agent registered
[bluetooth]#
Register the Battery Service
[bluetooth]#
menu gatt
Menu gatt:
[bluetooth]# register-service 0x180F
[NEW] Primary Service
/org/bluez/app/service0xbf29850
0x180F
Battery Service
[/org/bluez/app/service0xbf29850] Primary (yes/no): yes
[bluetooth]#
Configure the characteristics for Battery Service
[bluetooth]#
register-characteristic 0x2A19 notify,read
[NEW] Characteristic
/org/bluez/app/service0xbf29850/chrc0xbf32890
0x2A19
Battery Level
[/org/bluez/app/service0xbf29850/chrc0xbf32890] Enter value: 0x64
[bluetooth]#
UM11490
All information provided in this document is subject to legal disclaimers.
© NXP B.V. 2021. All rights reserved.
User manual
Rev. 2 — 29 January 2021
68 / 88