The Bluetooth Manager listens for commands from the HMI on this control object
The control object accepts the following commands:
Command | Parameters | Description |
---|---|---|
authorize |
data: MAC address of the device.
data2: Boolean value (true | false) to indicate whether to authorize. |
Authorize an incoming Bluetooth connection request. |
cancel_device_search | n/a | Cancel an initiated device search. |
cancel_pairing | data: MAC address of the device. | Cancel an initiated device pairing request. Note that this command must be issued before the pairing completes. |
connect_service |
data: MAC address of the device.
data2: Service number:
|
Connect to a Bluetooth service on the remote paired device.
Note:
For the SPP service, you need to specify the UUID in the data2 parameter by putting a colon between the service number and the UUID. For example:
0x1101:5DF26DC6-8E42-8401-6D98-75C100B108B1 |
device_search | n/a | Search for remote devices. Results will be published to /pps/services/bluetooth/status (devices will also be published under /pps/services/bluetooth/remote_devices/<mac_addr>). |
disconnect_service |
data: MAC address of the device.
data2: Service number:
|
Disconnect a connected Bluetooth service. For SPP (as with the connect_service command), you must specify the UUID in the data2 parameter. |
initiate_pairing | data: MAC address of the device. | Initiate pairing to a remote device. |
radio_init | n/a | Initialize the Bluetooth system and the radio chip. |
radio_shutdown | n/a | Shut down the radio. |
remove_device | data: MAC address of the device. | Delete a paired device from the system. |
set_access | data: Accessibility level (0 - 4):
|
Set the accessibility level of the Bluetooth system. |
set_legacy_pin |
data: MAC address of the device.
data2: PIN of legacy device (usually a four-digit number). |
Set a numeric PIN required for authentication during pairing. |
set_name | data: Desired name. | Set the friendly name of the Bluetooth system. |
set_passkey |
data: MAC address of the device.
data2: Pass phrase string (usually four, but not more than six, characters). |
Set the pass phrase required for authentication during pairing. |
user_confirm |
data: MAC address of the device.
data2: Boolean value (true | false) to indicate whether to confirm request. |
Confirm an authorization request from a remote device. |
Set the accessibility level so devices will be discoverable:
echo "command::set_access\ndata:n:1" >> /pps/services/bluetooth/control
Allow a connection request from the specified device:
echo "command::authorize\ndata::BB:C3:33:AD:66:CD\ndata2::b:true" >> /pps/services/bluetooth/control
Connect the specified device using the Phone Book Access Profile:
echo "command::connect_service\ndata::BA:C3:32:AD:55:CC\ndata2::0x1130" >> /pps/services/bluetooth/control
Connect the specified device to the specified UUID using the Serial Port Profile:
echo "command::connect_service\ndata::BA:C3:32:AD:55:CC\ndata2::0x1101:5DF26DC6-8E42-8401-6D98-75C100B108B1" >> /pps/services/bluetooth/control
Pair with the specified device:
echo "command::initiate_pairing\ndata::CC:55:AD:24:46:51" >> /pps/services/bluetooth/control
echo "command::user_confirm\ndata::CC:55:AD:24:46:51\ndata2:b:true" >> /pps/services/bluetooth/control
Remove pairing for the specified device:
echo "command::remove_device\ndata::CC:55:AD:24:46:51" >> /pps/services/bluetooth/control