NINA-B31 series - Getting Started
UBX-18022394 - R02
Use case examples
Page 17 of 26
AT+UBTLN="u-blox NINA-B31"
NINA-B31 (Device B) as a Central
•
Set Central Role on NINA-B31
AT+UBTLE=1
•
Store configuration
AT&W
•
Restart NINA-B31
AT+CPWROFF
•
Make a Device Discover to find Device A
AT+UBTD
+UBTD:112233445566p,-70,"u-blox NINA-B31",1,0F09752D626C6F78204E494E412D...
4.6
Set up GATT Server on NINA-B31
The following example shows how to set up a GATT Server on NINA-B31. The GATT Server value can
be read by a remote device see the use case in section 4.7.
Set up a GATT Server with a pre-defined service on NINA-B31
•
Define a Heart Rate service - A list of all available pre-defined services and its characteristics can
be found at [8] and [9]
AT+UBTGSER=180D
+UBTGSER:30
•
Add a Heart Rate measurement characteristic with notification support
AT+UBTGCHA=2A37,10,1,1
+UBTGCHA:32,33
•
Optionally change the local name to a name indicating the devices new status:
AT+UBTLN="NINA-B3 GATT Server"
OK
4.7
Set up GATT Server / Client on NINA-B31
The following example shows how to set up a GATT Server on one NINA-B31 and receive notifications
of updated values at a GATT Client on a second NINA-B31.
Set up a GATT Server with a pre-defined service on NINA-B31 (Device A)
See section 4.6 for a guide on how to set up Device A.
Use the GATT Client on NINA-B31 (Device B) to receive Heart rate measurement values:
•
Enable Central Role
AT+UBTLE=1
•
Store configuration
AT&W
•
Restart
AT+CPWROFF
•
Find the other device
AT+UBTD=4,1
+UBTD:112233445566p,-59,"NINA-B3 GATT Server",1,1109426C756574...