Hello Elvispre,
I hope you were able to pair and play audio on your bluetooth earphone using luna commands.
If not, you can refer to the below API reference link for commands to pair, connect your bluetooth earphone.
Link: http://webosose.org/develop/ls2-api/ls2-api-reference/com-webos-service-bluetooth2/
Hope it helps
You can pair and connect with below commands:
Turn on BT
luna-send -n 1 -f luna://com.webos.service.bluetooth2/adapter/setState '{"powered":true}'
Expected Response:
{
"adapterAddress": "00:00:97:1c:c9:3c",
"returnValue": true
}
Start Discovery
luna-send -n 1 -f luna://com.webos.service.bluetooth2/adapter/startDiscovery '{}'
Expected Response:
{
"adapterAddress": "00:00:97:1c:c9:3c",
"returnValue": true
}
Search your bluetooth earphone device for example LG HBS700
luna-send -n 1 -f luna://com.webos.service.bluetooth2/device/getStatus '{}' | grep "LG HBS700" -C 10
Expected Response:
{
"serviceClasses": [
],
"trusted": false,
"connectedProfiles": [
],
"pairing": false,
"rssi": -62,
"name": "LG HSB700",
"address": "xx:xx:xx:xx:xx:xx",
"paired": false,
"typeOfDevice": "bredr",
"adapterAddress": "",
"classOfDevice": 5898764,
"blocked": false
},
Cancel discovery
luna-send -n 1 -f luna://com.webos.service.bluetooth2/adapter/cancelDiscovery '{}'
Expected Response:
{
"adapterAddress": "00:00:97:1c:c9:3c",
"returnValue": true
}
Pair LG HBS700 deivce, replace xx:xx:xx:xx:xx:xx by your bluetooth earphone address
luna-send -i -f luna://com.webos.service.bluetooth2/adapter/pair '{ "address": "xx:xx:xx:xx:xx:xx", "subscribe":true}'
Expected Response:
{
"subscribed": false,
"returnValue": true,
"request": "endPairing"
}
Bluetooth A2DP device Connect
luna-send -i -f luna://com.webos.service.bluetooth2/a2dp/connect '{"address":"xx:xx:xx:xx:xx:xx","subscribe":true}'
Expected Response:
{
"subscribed": true,
"adapterAddress": "00:00:97:1c:c9:3c",
"returnValue": true
}