Subsection 15.3.3 The AT Commands, and the Module’s Timing Rules
In command mode the module accepts AT commands and replies OK or ERROR. The full command set is described in the Adafruit documentation; the three used in Lab 9 are these.
-
ATZperforms a soft reset, which restarts the Bluetooth stack. -
AT+FACTORYRESETrestores the module to a known state; in Lab 9 you are advised to issue it at startup so you know exactly what state your device is in. -
AT+GAPDEVNAME=chosenNamesets the name the module advertises.
In Lab 9 you are given two timing rules to follow for a reliable startup routine. After sending a command, wait a few milliseconds (
delay_ms() is fine) and then process the response. You do not necessarily need to do anything with it, but you should keep watching for available characters until the response is done, which you can tell from having seen no new character for 10 or 20 milliseconds. After extracting the response, wait an additional 200 ms before sending another command.
