BLE Generic

The following general purpose BLE commands are available on Bluefruit LE modules:

AT+BLEPOWERLEVEL

Gets or sets the current transmit power level for the module's radio (higher transmit power equals better range, lower transmit power equals better battery life).

Codebase Revision: 0.3.0

Parameters: The TX power level (in dBm), which can be one of the following values (from lowest to higher transmit power):

  • -40
  • -20
  • -16
  • -12
  • -8
  • -4
  • 0
  • 4

Output: The current transmit power level (in dBm)

The updated power level will take affect as soon as the command is entered. If the device isn't connected to another device, advertising will stop momentarily and then restart once the new power level has taken affect.
# Get the current TX power level (in dBm)
AT+BLEPOWERLEVEL
0
OK
  
# Set the TX power level to 4dBm (maximum value)
AT+BLEPOWERLEVEL=4
OK
  
# Set the TX power level to -12dBm (better battery life)
AT+BLEPOWERLEVEL=-12
OK
  
# Set the TX power level to an invalid value
AT+BLEPOWERLEVEL=-3
ERROR

AT+BLEGETADDRTYPE

Gets the address type (for the 48-bit BLE device address).

Normally this will be '1' (random), which means that the module uses a 48-bit address that was randomly generated during the manufacturing process and written to the die by the manufacturer.

Random does not mean that the device address is randomly generated every time, only that a one-time random number is used.

Codebase Revision: 0.3.0

Parameters: None

Output: The address type, which can be one of the following values:

  • 0 = public
  • 1 = random
AT+BLEGETADDRTYPE
1
OK

AT+BLEGETADDR

Gets the 48-bit BLE device address.

Codebase Revision: 0.3.0

Parameters: None

Output: The 48-bit BLE device address in the following format: 'AA:BB:CC:DD:EE:FF'

AT+BLEGETADDR
E4:C6:C7:31:95:11
OK

AT+BLEGETPEERADDR

Gets the 48-bit address of the peer (central) device we are connected to.

Codebase Revision: 0.6.5

Parameters: None

Output: The 48-bit address of the connected central device in hex format. The command will return ERROR if we are not connected to a central device.

Please note that the address returned by the central device is almost always a random value that will change over time, and this value should generally not be trusted. This command is provided for certain edge cases, but is not useful in most day to day scenarios.
AT+BLEGETPEERADDR
48:B2:26:E6:C1:1D
OK

AT+BLEGETRSSI

Gets the RSSI value (Received Signal Strength Indicator), which can be used to estimate the reliability of data transmission between two devices (the lower the number the better).

Codebase Revision: 0.3.0

Parameters: None

Output: The RSSI level (in dBm) if we are connected to a device, otherwise '0'

# Connected to an external device
AT+BLEGETRSSI
-46
OK
  
# Not connected to an external device
AT+BLEGETRSSI
0
OK
Last updated on 2015-06-29 at 04.48.13 PM Published on 2015-05-01 at 05.25.22 PM