Bluetooth¶
JP150PCB 1.3PCB 1.4generatedJan PřibyslavskýThis page does not apply to the product or PCB revision chosen in the header.
The Bluetooth module: its name, connection and codec state, playback state and track metadata, the LED lines of PCB 1.4, and the raw AT console. Free-text values (names, titles) are UTF-8. The TWS commands have their own page.
Commands¶
| Command | Function | Parameter | Answer | Since | Boards |
|---|---|---|---|---|---|
BT:DEVNAME? |
Bluetooth name of the module | – | BT:DEVNAME:<name> |
26.6.2 | 1.3, 1.4 |
BT:DEVNAME |
Set the Bluetooth name | <name> |
no answer | 26.6.2 | 1.3, 1.4 |
BT:RELEASE? |
Firmware release of the Bluetooth module | – | BT:RELEASE:<release> |
26.6.2 | 1.3, 1.4 |
BT:REMOTE:DEVNAME? |
Name of the connected phone | – | BT:REMOTE:DEVNAME:<name> |
26.6.2 | 1.3, 1.4 |
BT:REMOTE:MAC? |
Address of the connected phone | – | BT:REMOTE:MAC:<aa:bb:cc:dd:ee:ff> |
26.6.2 | 1.3, 1.4 |
BT:RELOAD |
Restore the Bluetooth module's defaults | – | no answer | 26.6.2 | 1.3, 1.4 |
BT:RST |
Restart the Bluetooth module | – | no answer | 26.6.2 | 1.3, 1.4 |
BT:CODEC:ACTIVE? |
Codec of the current stream | – | BT:CODEC:ACTIVE:<codec> |
26.6.2 | 1.3, 1.4 |
BT:CODEC:LIST? |
Codecs the module supports | – | BT:CODEC:LIST:<codec>[,<codec>...] |
26.6.2 | 1.3, 1.4 |
BT:NETSTATE? |
Connection and streaming state | – | BT:NETSTATE:<state> |
26.6.2 | 1.3, 1.4 |
BT:PLAYBACKSTATE? |
Playback state | – | BT:PLAYBACKSTATE:<state> |
26.6.2 | 1.3, 1.4 |
BT:CURPOS? |
Playback position in ms | – | BT:CURPOS:<ms> |
26.6.2 | 1.3, 1.4 |
BT:TOTLEN? |
Track length in ms | – | BT:TOTLEN:<ms> |
26.6.2 | 1.3, 1.4 |
BT:TITLE? |
Track title | – | BT:TITLE:<text> |
26.6.2 | 1.3, 1.4 |
BT:ARTIST? |
Track artist | – | BT:ARTIST:<text> |
26.6.2 | 1.3, 1.4 |
BT:ALBUM? |
Track album | – | BT:ALBUM:<text> |
26.6.2 | 1.3, 1.4 |
BT:AIO? |
Levels and edge counts of the module's LED lines | – | BT:AIO:<aio0>,<aio1>,<edges0>,<edges1> |
26.10.1 | 1.4 (1.3: N/A) |
BT:AT |
Raw AT command to the Bluetooth module (development aid) | "<AT command>" |
BT:AT:<count>,<truncated>;<hexline>[;<hexline>...] |
26.10.1 | 1.3, 1.4 |
Since is the release the command appeared in; 26.6.2 is the oldest release documented here, so a command marked 26.6.2 may be older.
BT:DEVNAME¶
Commands: BT:DEVNAME?, BT:DEVNAME
The name a phone sees when it searches for the module. The Bluetooth module stores it itself. The length is not checked by the firmware; keep it short.
Module and phone identity¶
Commands: BT:RELEASE?, BT:REMOTE:DEVNAME?, BT:REMOTE:MAC?
BT:REMOTE:DEVNAME? -> BT:REMOTE:DEVNAME:Jan's phone
BT:REMOTE:MAC? -> BT:REMOTE:MAC:AA:BB:CC:DD:EE:FF
BT:RELOAD, BT:RST¶
Commands: BT:RELOAD, BT:RST
BT:RST restarts the module; the link to a phone drops and comes back when the phone
reconnects. BT:RELOAD restores the module's factory defaults, which forgets its pairings and
its name: a service action, not a normal control.
BT:CODEC:ACTIVE?, BT:CODEC:LIST?¶
Commands: BT:CODEC:ACTIVE?, BT:CODEC:LIST?
Codecs
| Value | Meaning |
|---|---|
SBC |
SBC |
AAC |
AAC |
APTX |
aptX |
APTX-HD |
aptX HD |
APTX-LL |
aptX Low Latency |
APTX-AD |
aptX Adaptive |
LDAC |
LDAC |
BT:NETSTATE?, BT:PLAYBACKSTATE?¶
Commands: BT:NETSTATE?, BT:PLAYBACKSTATE?
Bluetooth link states
| Value | Meaning |
|---|---|
Disconnected |
No device connected |
Standby |
Connectable, no device connected |
Connecting |
A connection is being set up |
Connected |
A device is connected |
Streaming |
Audio is being received |
Playback states
| Value | Meaning |
|---|---|
Stopped |
Stopped |
Playing |
Playing |
Paused |
Paused |
Fast-forwarding |
Fast forward |
Fast-revinding |
Rewind (the spelling is the firmware's and is kept for compatibility) |
Track metadata and position¶
Commands: BT:CURPOS?, BT:TOTLEN?, BT:TITLE?, BT:ARTIST?, BT:ALBUM?
As the phone delivers them over the remote-control profile, UTF-8, possibly empty. Position and length in milliseconds.
BT:AIO?¶
PCB 1.4 routes the two LED outputs of the Bluetooth module to the MCU. The firmware samples
them every 100 ms (0 = LED on) and counts their edges, which grow while a LED blinks. A bench
diagnostic today, reserved for a later TWS feature. BT:AIO:N/A on PCB 1.3.
BT:AT¶
Sends the quoted command to the module as it is and returns every line the module emitted
during a 500 ms window, hex-encoded (the example answer is OK), at most 6 lines;
truncated is 1 when a line or the buffer overflowed. The parameter must be quoted: an
unquoted value containing + is cut at the + by the command parser and a different command
is sent. The module's own status polling continues, so an unrelated line can land in the
window; the answer sought is normally the first. :ERR:PARAM when the argument does not begin
with AT, :ERR:MODULE when the module could not be written.
Unfiltered: anything the module accepts is sent, including AT+RESTORE (factory reset of the
module) and AT+BAUD (breaks the serial link to the MCU). A development aid, not a product
feature.
Changes¶
- 26.10.1: added
BT:AIO?,BT:AT. - 26.6.2 (oldest release documented): 16 commands.