Version latest

4 Bluetooth use cases

The following Bluetooth Low Energy use case, show some functionality to get started with GATT client, GATT server and SPS.
u-connectXpress BLE default values
2.0.0
BLE Mode default
ON, Central and Peripheral (3)
BLE Advertising default
OFF, enable with AT+UBTA=1
The following examples use the MAC address below, this must be replaced by the real MAC address of the devices that are used.
  • Peripheral MAC address: AAAAAAAAAAAA
  • Central MAC address: BBBBBBBBBBB

4.1 Bluetooth GATT client

ble
bt-gatt-glient
This use case configures NORA-W36 as a Central device that operates as a GATT client and receives data.
This use case configuration is used in combination with Bluetooth GATT server.
Nr
Instructions
AT command
AT event
1
Check that Bluetooth Central is enabled.
1: Central or
3: Central and Peripheral
. If so jump to step 6.
AT+UBTM?
+UBTM:1 or +UBTM:3
2
Enable Bluetooth
1: Central or
3: Central and Peripheral
AT+UBTM=1 or AT+UBTM=3
3
Store command
AT&W
4
Restart
AT+CPWROFF
5
Wait for NORA-W36 to startup
+STARTUP
6
Connect to remote device
AT+UBTC=AAAAAAAAAAAAp
+UEBTC:0,AAAAAAAAAAAAp
7
Discover Services and look for 180D, which is the descriptor for the Heart Rate service.
AT+UBTGPSD=0
+UBTGPSD:0,12,65535,180D
8
Discover all Service Characteristics and look for 2A37, which is the descriptior for the Heart Rate Measurement characteristics.
AT+UBTGSCD=0,12,65535
+UBTGSCD:0,13,10,14,2A37
9
Use the Value handle, which in this case is 14. The value can vary. Look for 2902, which is the descriptor for the notification.
AT+UBTGCDD=0,14,15
+UBTGCDD:0,13,15,2902
10
Enable notification on the GATT Client the Central in this example
AT+UBTGCCW=0,15,1
11
Notification is received on the GATT Client
+UEBTGCN:0,14,60
+UEBTGCN:0,14,61
+UEBTGCN:0,14,62

4.2 Bluetooth GATT server

ble
bt-gatt-server
This use case configures NORA-W36 as a Peripheral device that operates as GATT server and sends notifications.
This configuration works in combination with Bluetooth GATT client.
Nr
Instructions
AT command
AT event
1
Check that Bluetooth Peripheral is enabled
2: Peripheral and
3: Central and Peripheral. If so jump to step 6.
AT+UBTM?
+UBTM:2 or +UBTM:3
2
Enable Bluetooth
2: Peripheral or
3: Central and Peripheral
AT+UBTM=2 or AT+UBTM=3
3
Store command
AT&W
4
Restart
AT+CPWROFF
5
Wait for NORA-W36 to start
+STARTUP
6
Enable Advertisements to allow connections
AT+UBTA=1
7
Write the Heart Rate service
AT+UBTGS=180D
+UBTGS:21
8
Write the GATT characteristic
AT+UBTGC=2A37,3A,01,01,00
+UBTGC:30,31
9
Activate GATT Service
AT+UBTGSA
10
Wait for incoming Bluetooth connection
+UEBTC:0,BBBBBBBBBBB
11
Get the MTU for the connection (optional)
AT+UBTCST=0,3
+UBTCST:3,247
12
Get the Role for the connection (optional)
AT+UBTCST=0,7
+UBTCST:7,1
13
Send a notification from the GATT Server using the value handle
AT+UBTGNS=0,14,60
AT+UBTGNS=0,14,61
AT+UBTGNS=0,14,62

4.3 Bluetooth SPS central

ble
bt-sps-central
This use case configures NORA-W36 as a Central device that sends and receives data from another NORA-W36 module operating as a Peripheral device. The communication between the two modules is facilitated using the proprietary u-blox Serial Port Service. It is also possible to connect to other devices that supports the SPS protocol. This use case operates in combination with Bluetooth SPS peripheral.
Nr
Instructions
AT command
AT event
1
Check that Bluetooth Central is enabled. 1:Central or
3:Central and Peripheral
. If so, jump to step 6.
AT+UBTM?
+UBTM:1 or +UBTM:3
2
Enable Bluetooth 1:Central or
3:Central and Peripheral
AT+UBTM=1 or AT+UBTM=3
3
Store command
AT&W
4
Restart
AT+CPWROFF
5
Wait for NORA-W36 to start
+STARTUP
6
Initiate Bluetooth discovery. Listen for advertising packets broadcast from Peripheral device.
AT+UBTD
+UBTD:AAAAAAAAAAAAp,-52,"NORA-W36-AAAAAA",0,10094E4F52412D5733362D414141414141
7
Connect Bluetooth
AT+UBTC=AAAAAAAAAAAAp
+UEBTC:0,AAAAAAAAAAAAp
8
Read MTU, maximum data size
AT+UBTCST=0,3
+UBTCST:3,247
9
Read RSSI (optional)
AT+UBTRSS=0
+UBTRSS:-52
10
Connect SPS using handle of Bluetooth connection
AT+USPSC=0
11
SPS connection is up
+UESPSC:0
12
It is now possible to send and receive SPS data in String or Binary mode
13
Disconnect the SPS and Bluetooth connection
AT+UBTDC=0
+UESPSDC:0
+UEBTDC:0

4.4 Bluetooth SPS peripheral

ble
bt-sps-central
This use case configures NORA-W36 module as a Peripheral device that sends and receives data from another NORA-W36 module operating as a Central device. The communication between the two modules is facilitated using the proprietary u-blox Serial Port Service. It is also possible to connect to other devices that support the SPS protocol. This use case configuration is used in combination with Bluetooth SPS central.
Nr
Instructions
AT command
AT events
1
Check that Bluetooth Peripheral is enabled.
2: Peripheral and
3: Central and Peripheral. If so, jump to step 6
AT+UBTM?
+UBTM:2 or +UBTM:3
2
Enable Bluetooth
2: Peripheral or
3: Central and Peripheral
AT+UBTM=2 or AT+UBTM=3
3
Store command
AT&W
4
Restart
AT+CPWROFF
5
Wait for NORA-W36 to startup
+STARTUP
6
Enable SPS on Peripheral
AT+USPS=1
7
Enable Advertisements
AT+UBTA=1
8
Peripheral receives Incoming Bluetooth connection
+UEBTC:0,BBBBBBBBBBBBp
9
Read MTU, maximum data size on both
AT+UBTCST=0,3
+UBTCST:3,247
10
Read RSSI (optional)
AT+UBTRSS=0
+UBTRSS:-52
11
Central Connect SPS using handle of Bluetooth connection
AT+USPSC=0
+UESPSC:0
12
It is now possible to send and receive SPS data in String or Binary mode
13
SPS and Bluetooth link is down
+UESPSDC:0
+UEBTDC:0

4.5 Bluetooth advertise

ble
This use case configures NORA-W36 as a peripheral device that operates as a GATT client and receives data.
This use case configuration is used in combination with Apple iPhone using the The Apple Notification Center Service (ANCS).
Nr
Instructions
AT command
AT event
1
Check that Bluetooth Peripheral is enabled
2: Peripheral and
3: Central and Peripheral. If so, jump to step 6.
AT+UBTM?
+UBTM:2 or +UBTM:3
2
Enable Bluetooth
2: Peripheral or
3: Central and Peripheral
AT+UBTM=2 or AT+UBTM=3
3
Store command
AT&W
4
Restart
AT+CPWROFF
5
Wait for NORA-W36 to start
+STARTUP
6
Set Apple ANCS Advertise data packet
AT+UBTAD=1115D0002D121E4B0FA4994ECEB531F40579
7
Enable Advertisements
AT+UBTA=1
8
Peripheral receives Incoming Bluetooth connection
+UEBTC:0,BBBBBBBBBBBBp
9
Discover Services and look for 180A that is the Device Information
AT+UBTGPSD=0
+UBTGPSD:0,1,5,1800
+UBTGPSD:0,6,9,1801
+UBTGPSD:0,10,14,180A
+UBTGPSD:0,15,19,D0611E78BBB44591A5F8487910AE4366
+UBTGPSD:0,20,24,9FA480E0496745429390D343DC5D04AE
+UBTGPSD:0,25,28,180F
+UBTGPSD:0,29,34,1805
+UBTGPSD:0,35,44,7905F431B5CE4E99A40F4B1E122D00D0
+UBTGPSD:0,45,56,89D3502B0F36433A8EF4C502AD55F8DC
10
Discover all Service Characteristics and look for the attribute 2A29, which describes the Manufacturer Name String characteristics
AT+UBTGSCD=0,10,14
+UBTGSCD:0,11,02,12,2A29
+UBTGSCD:0,13,02,14,2A24
11
Read the Manufacturer Name String Apple Inc. characteristics on handle 12
AT+UBTGR=0,12
+UBTGR:0,12,4170706C6520496E632E (Apple Inc.)

4.6 Bluetooth security

Pairing
  • Pairing is the initial process where two Bluetooth devices exchange information necessary to establish an encrypted connection
  • During pairing, devices negotiate security parameters, such as encryption keys and authentication methods
  • It ensures that communication between devices remains confidential and secure Think of pairing as the handshake that sets the foundation for a secure link
Bonding
  • Bonding occurs after successful pairing
  • It involves storing the information from the pairing process on both devices
  • Once bonded, devices remember each other’s security credentials (keys) for future reconnections
  • Bonding eliminates the need to repeat the pairing process every time the devices reconnect
  • Essentially, bonding creates a permanent security relationship between the devices
In summary
  • Pairing: Establishes the initial secure connection
  • Bonding: Ensures that the devices remember each other’s security details for subsequent interactions
  • Remember, these processes are essential for maintaining the confidentiality and integrity of data exchanged over Bluetooth connections

4.7 Bluetooth security initiator

ble
Bluetooth Security is by disabled default and must be configured and enabled before use.
Nr
Instructions
AT command
AT event
1
Set Bluetooth I/O Capabilities to Display Yes/No (2)
AT+UBTIOC=2
2
Set Only allow authenticated bonding with encrypted Bluetooth link (3)
AT+UBTBSM=3
3
Allow Pairing
AT+UBTPM=1
4
Bluetooth Bond
AT+UBTB=BBBBBBBBBBBBp
5
Bluetooth Connected event
+UEBTC:0,BBBBBBBBBBBBp
6
Bluetooth User Confirmation event, check the numer on both devices, should be the same
+UEBTUC:BBBBBBBBBBBBp,786920
7
Bluetooth User Confirmation, confim with yes
AT+UBTUC=BBBBBBBBBBBBp,1
8
Bluetooth Bond success
+UEBTB:BBBBBBBBBBBBp,0
9
Bluetooth Bonded Devices List (optional)
AT+UBTBDL
+UBTBDL:BBBBBBBBBBBBp

4.8 Bluetooth security responder

ble
Bluetooth Security is by disabled default and must be configured and enabled before use.
Nr
Instructions
AT command
AT event
1
Check that Bluetooth Peripheral is enabled, 2: Peripheral or 3: Central and Peripheral, if so move to step 6
AT+UBTM?
+UBTM:2 or +UBTM:3
2
Enable Bluetooth 2: Central or 3: Central and Peripheral
AT+UBTM=1 or AT+UBTM=3
3
Store command
AT&W
4
Restart
AT+CPWROFF
5
Wait for NORA-W36 to startup
+STARTUP
6
Enable Advertisements
AT+UBTA=1
7
Set Bluetooth I/O Capabilities to Display Yes/No (2)
AT+UBTIOC=2
8
Set Only allow authenticated bonding with encrypted Bluetooth link (3)
AT+UBTBSM=3
9
Allow Pairing
AT+UBTPM=1
10
Bluetooth Connected event
+UEBTC:0,AAAAAAAAAAAAp
11
Bluetooth User Confirmation event, check the numer on both devices, should be the same
+UEBTUC:AAAAAAAAAAAAp,786920
12
Bluetooth User Confirmation, confim with yes
AT+UBTUC=AAAAAAAAAAAAp,1
13
Bluetooth Bond success
+UEBTB:AAAAAAAAAAAAp,0
14
Bluetooth Bonded Devices List (optional)
AT+UBTBDL
+UBTBDL:AAAAAAAAAAAAp

Last updated: 25 August 2025
Need help?Contact Support
Questions?Contact us