Adafruit Feather 32u4 Bluefruit LE: BLE GAP: Difference between revisions

From UNamur InfoSec
Jump to navigation Jump to search
Line 29: Line 29:


  AT+FACTORYRESET
  AT+FACTORYRESET
*Read Command Mode '?'
'Read' mode is used to read the current value of a command.
Not every command supports read mode, but you generally use this to retrieve information like the current transmit power level for the radio by appending a '?' to the command, as shown below:
AT+BLEPOWERLEVEL?


== AT+GAPSETADVDATA ==
== AT+GAPSETADVDATA ==

Revision as of 14:57, 14 December 2017

BLE GAP

GAP, which stands for the Generic Access Profile, governs advertising and connections with Bluetooth Low Energy devices.

The following commands can be used to configure the GAP settings on the BLE module.

You can use these commands to modify the advertising data (for ex. the device name that appears during the advertising process), to retrieve information about the connection that has been established between two devices, or the disconnect if you no longer wish to maintain a connection.

AT Commands

The Bluefruit LE modules use a Hayes AT-style command set to configure the device.

The advantage of an AT style command set is that it's easy to use in machine to machine communication, while still being somewhat user friendly for humans.

  • Test Command Mode '=?'

'Test' mode is used to check whether or not the specified command exists on the system or not.

Certain firmware versions or configurations may or may not include a specific command, and you can determine if the command is present by taking the command name and appending '=?' to it, as shown below

AT+BLESTARTADV=?
  • Write Command Mode '=xxx'

'Write' mode is used to assign specific value(s) to the command, such as changing the radio's transmit power level using the command we used above.

To write a value to the command, simple append an '=' sign to the command followed by any paramater(s) you wish to write (other than a lone '?' character which will be interpretted as tet mode):

AT+BLEPOWERLEVEL=-8
  • Execute Mode

'Execute' mode will cause the specific command to 'run', if possible, and will be used when the command name is entered with no additional parameters.

AT+FACTORYRESET
  • Read Command Mode '?'

'Read' mode is used to read the current value of a command.

Not every command supports read mode, but you generally use this to retrieve information like the current transmit power level for the radio by appending a '?' to the command, as shown below:

AT+BLEPOWERLEVEL?

AT+GAPSETADVDATA

Reference

Adafruit Learn BLE GAP https://learn.adafruit.com/adafruit-feather-32u4-bluefruit-le/ble-gap

Adafruit Learn AT Commands https://learn.adafruit.com/adafruit-feather-32u4-bluefruit-le/at-commands