Note
This API has been available since API level 11.
This API has been available since API level 11.
Allows webOS to use remote Bluetooth devices.
The bluetooth2 service supports the following categories:
Bluetooth2 service behavior in Sessions
In webOS platforms that are running with multiple sessions, in addition to a host session, one session is created for each of the display screens.
Given this background, the bluetooth2 service assigns a different Bluetooth adapter for each of the container sessions. This means that applications running on each screen, use adapters that are pre-selected at system startup.
In such cases, when an API is called, by default, the pre-selected adapterAddress is used. Therefore, you must not specify an adapterAddress. Even if you specify an adapter, it will be disregarded in favor of the pre-selected adapter.
Method Behavior
Glossary
API level 11
Connects to the A2DP profile on the specified remote device.
Name | Required | Type | Description |
---|---|---|---|
address | Required | String | Indicates the address (bdaddr) of the remote device. |
subscribe | Optional | Boolean | Indicates if subscribed to get notifications. Possible values are:
Default: false |
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
subscribed | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
adapterAddress | Required | String | Indicates the address of the adapter. |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
subscribed | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
disconnectByRemote | Required | String | Indicates whether the remote device or the local user initiated the disconnect. Possible values are:
|
adapterAddress | Required | String | Indicates the address of the adapter. |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
102, 103, 105, 106, 127, 143, 144 | See API Error Codes Reference | See API Error Codes Reference. |
128 | Device is already connecting | The remote Bluetooth device is already connecting to the A2DP profile, so another connection cannot be opened. |
129 | Device is not paired | The remote Bluetooth device is not paired, so A2DP connection cannot be opened. |
130 | Failed to connect with remote device | The remote Bluetooth device cannot be connected to A2DP profile. |
131 | Already connected | The remote Bluetooth device is already connected to the adapter's A2DP profile, so another connection cannot be opened. |
Example code
# luna-send -i -f luna://com.webos.service.bluetooth2/a2dp/connect '{
"address":"00:18:6b:49:db:86",
"subscribe":true
}'
Response:
{
"subscribed":true,
"adapterAddress":"00:00:45:0e:48:9b",
"returnValue":true
}
API level 12
Disables the AVDTP delay reporting.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Required | String | Indicates the address of the adapter. |
errorCode | Required | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
returnValue | Optional | Boolean | Indicates the status of the operation. Possible values are:
|
Error Code | Error Text | Error Description |
---|---|---|
101 | Bluetooth adapter is not available | Bluetooth adapter is not available |
286 | This API is not support by Bluetooth Stack | This API is not support by Bluetooth Stack |
288 | Delay Reporting already disabled | Delay Reporting already disabled |
Example: Disable delay reporting
# luna-send -i -f luna://com.webos.service.bluetooth2/a2dp/disableDelayReporting '{
"adapterAddress":"b8:ad:3e:bd:93:c2"
}'
Response:
{
"returnValue":true
}
API level 11
Drops the connection to the given remote device on the A2DP profile.
Name | Required | Type | Description |
---|---|---|---|
address | Required | String | Indicates the address (bdaddr) of the remote device. |
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
adapterAddress | Required | String | Indicates the address of the adapter. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
errorCode | Optional | Number | The error code for the failed operation. |
Error Code | Error Text | Error Description |
---|---|---|
102, 105, 106, 127, 143, 144 | See API Error Codes Reference | See API Error Codes Reference. |
132 | Failed to disconnect from remote device | The A2DP connection with the remote Bluetooth device could not be closed. |
Example: Valid address
# luna-send -i -f luna://com.webos.service.bluetooth2/a2dp/disconnect '{
"address":"aa:bb:cc:dd:ee:00"
}'
Response:
{
"adapterAddress":"11:22:33:44:55:66",
"returnValue":true
}
API level 12
Enables the AVDTP delay reporting.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Required | String | Indicates the address of the adapter. |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
Error Code | Error Text | Error Description |
---|---|---|
101 | Bluetooth adapter is not available | Bluetooth adapter is not available |
286 | This API is not support by Bluetooth Stack | This API is not support by Bluetooth Stack |
287 | Delay Reporting already enabled | Delay Reporting already enabled |
Example: Enable delay reporting code
#luna-send -n -1 luna://com.webos.service.bluetooth2/a2dp/enableDelayReporting '{
"adapterAddress":"0a:ad:3e:bd:93:c2"
}'
Response:
{
"returnValue":true
}
API level 12
Gets the AVDTP delay from a remote A2DP device, whenever the AVDTP delay is changed.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
address | Optional | String | Indicates the address (bdaddr) of the remote device. |
subscribe | Optional | Boolean | Indicates if subscribed to get notifications. Possible values are:
Default: false |
Name | Required | Type | Description |
---|---|---|---|
delay | Required | Number | Indicates the delay in 1/10 of milliseconds. |
adapterAddress | Required | String | Indicates the address of the adapter. |
address | Required | String | Indicates the address (bdaddr) of the remote device. |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Required | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
Error Code | Error Text | Error Description |
---|---|---|
101 | Bluetooth adapter is not available | Bluetooth adapter is not available |
106 | Device with supplied address is not available | Indicates that the device with the supplied address is not available. |
237 | Required 'address' parameter is not supplied | The required address parameter has not been supplied. |
286 | This API is not support by Bluetooth Stack | This API is not support by Bluetooth Stack |
289 | Delay Reporting disabled | Delay Reporting disabled |
Example: Get delay reporting time
# luna-send -i -f luna://com.webos.service.bluetooth2/a2dp/getDelayReportingTime '{
"adapterAddress":"0a:ad:3e:bd:93:c2",
"address":"b8:ad:3e:bd:93:c2",
"subscribe":true
}
Response:
{
"subscribed": true,
"adapterAddress":"0a:ad:3e:bd:93:c2",
"address":"b8:ad:3e:bd:93:c2",
"delay": 1228,
"returnValue":true
}
API level 11
Returns the status of the A2DP connection to a remote device.
Note: If the address input parameter is not specified, the method will return the information of the device whose connection or playing status has been changed.
Name | Required | Type | Description |
---|---|---|---|
address | Required | String | Indicates the address (bdaddr) of the remote device. |
subscribe | Optional | Boolean | Indicates if subscribed to get notifications. Possible values are:
Default: false |
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
subscribed | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
connecting | Required | Boolean | Indicates if the connection request is currently being processed. Possible values are:
Example: If the Bluetooth stack is no longer processing the connection request. |
connected | Required | Boolean | Indicates if the connection is open. Possible values are:
|
playing | Required | Boolean | Indicates if the device is streaming music. Possible values are:
|
adapterAddress | Required | String | Indicates the address of the adapter. |
address | Optional | String | Indicates the address (bdaddr) of the remote device. Note: The address is returned only when the address input parameter is not specified. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
errorCode | Optional | Number | The error code for the failed operation. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
subscribed | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
connecting | Required | Boolean | Indicates whether the connection request is currently being processed. Possible values are:
|
connected | Required | Boolean | Indicates if the connection is open. Possible values are:
|
playing | Required | Boolean | Indicates whether the device is streaming music. Possible values are:
|
adapterAddress | Required | String | Indicates the address of the adapter. |
address | Optional | String | Indicates the address (bdaddr) of the remote device. Note: Returned only when the address input parameter is not specified. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
errorCode | Optional | Number | The error code for the failed operation. |
Error Code | Error Text | Error Description |
---|---|---|
102, 105, 106, 127, 143, 144 | See API Error Codes Reference | See API Error Codes Reference. |
133 | Failed to retrieve state for remote device | The A2DP connection status of the remote Bluetooth device cannot be retrieved. |
Example: Remote device connected
# luna-send -i -f luna://com.webos.service.bluetooth2/a2dp/getStatus '{
"address":"aa:bb:cc:dd:ee:00",
"subscribe":true
}'
Response:
{
"returnValue":true,
"connected":true,
"subscribed":true,
"adapterAddress":"11:22:33:44:55:66",
"address":"aa:bb:cc:dd:ee:00",
"connecting":false,
"playing":true,
}
Example: Remote device disconnected
# luna-send -i -f luna://com.webos.service.bluetooth2/a2dp/getStatus '{
"address":"aa:bb:cc:dd:ee:00",
"subscribe":true
}'
Response:
{
"subscribed":false,
"disconnectByRemote":true,
"returnValue":false
}
API level 11
Awaits incoming pairing requests on the default Bluetooth adapter (only) by setting its state to be pairable. The caller must subscribe to this method. It expects the caller will stay subscribed to this method across multiple pairing requests for as long as the webOS device wishes to accept pairing requests.
Only one pairing request, either incoming or outgoing, can be active for an adapter at a given time.
Note:
Name | Required | Type | Description |
---|---|---|---|
subscribe | Required | Boolean | Indicates if subscribed to get notifications. Note: Set to true, since caller must subscribe to this method. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
subscribed | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
address | Required | String | Indicates the address (bdaddr) of the remote device with which pairing is being attempted. |
request | Required | String | Indicates the type of request. Possible values are:
|
passkey | Optional | String | Indicates the passkey for request:displayPasskey or request:confirmPasskey. |
pinCode | Optional | String | Indicates the PIN code for request:displayPinCode. |
name | Required | String | Indicates the friendly name of the device displayed to the user. Note: When a previously undiscovered device is first discovered, the system makes up a reasonable value for this. |
Error Code | Error Text | Error Description |
---|---|---|
101-104, 107, 143, 144 | See API Error Codes Reference | See API Error Codes Reference. |
123 | Failed to make device pairable | The Bluetooth stack could not set the pairable property of the adapter to true. |
124 | Pairing canceled or timed out | The ongoing incoming pairing with a remote device has been either canceled at the remote device or timed out before receiving a response from the remote device. |
125 | Device for incoming pairing request is not available | The remote Bluetooth device from which incoming pairing request has been received is not currently available. |
126 | Pairable timeout reached | The set pairable timeout has reached, hence the pairing operation cannot continue and the adapter is no longer pairable. The client should subscribe to adapter/awaitPairingRequests method again to make the adapter pairable. |
Example code
# luna-send -i -f luna://com.webos.service.bluetooth2/adapter/awaitPairingRequests '{
"subscribe":true
}'
Response:
{
"subscribe":true,
"returnValue":true
}
Subscription response: If the remote device requests pairing
{
"address":"34:4d:f7:f9:52:f7",
"name":"XYZ DEVICE",
"subscribed":true,
"request":"incomingPairRequest",
"returnValue":true
}
{
"returnValue":true,
"subscribed":true,
"passkey":952197,
"address":"34:4d:f7:f9:52:f7",
"name":"XYZ DEVICE",
"request":"confirmPasskey"
}
API level 11
Cancels discovering the remote Bluetooth devices.
Note: Discovery of a specific adapter can be canceled based on the adapter address passed.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Required | String | Indicates the address of the adapter. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
Note: returnValue will always contain true (even if there is no active discovery scan). |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
101 | See API Error Codes Reference | See API Error Codes Reference. |
116 | Can't stop discovery when adapter is turned off | The adapter needs to be powered on with adapter/setState to stop discovering other remote devices. |
117 | Failed to cancel discovery | The Bluetooth stack could not terminate discovering remote devices. |
Example code
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/adapter/cancelDiscovery '{ }'
Response:
{
"adapterAddress":"00:00:45:0e:48:9b",
"returnValue":true
}
API level 11
Cancels the pairing request with a remote device, either incoming or outgoing. Sends a success response immediately.
Once the SIL (Stack Interface Layer) calls back,
Name | Required | Type | Description |
---|---|---|---|
address | Required | String | Indicates the address (bdaddr) of the remote device. |
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
Note: returnValue will always contain true. |
subscribed | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
adapterAddress | Required | String | Indicates the address of the adapter. Note:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
101, 102, 105, 106, 108, 143, 144 | See API Error Codes Reference | See API Error Codes Reference. |
Example: Valid address
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/adapter/cancelPairing '{
"address": "34:4d:f7:f9:52:f7"
}'
Response:
{
"returnValue":true,
"subscribed":false,
"adapterAddress":"00:00:45:0e:48:9b"
}
Example: Invalid address
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/adapter/cancelPairing '{
"address": "34:4d:f7:f9:52:f7"
}'
Response:
{
"errorCode":8,
"returnValue":false,
"errorText":"Unknown device address"
}
API level 11
Returns the status information about the Bluetooth adapters available in the system.
Name | Required | Type | Description |
---|---|---|---|
subscribe | Optional | Boolean | Indicates if subscribed to get notifications. Possible values are:
Default: false |
Name | Required | Type | Description |
---|---|---|---|
subscribed | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
Note: returnValue will always contain true unless the request for subscription has failed. |
adapters | Required | Object array: bluetooth2AdapterStatus | Contains the information for all the Bluetooth adapters available in the system. Note: If there are no available adapters, the array will be empty. |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
Note: returnValue will always contain true unless the request for the subscription has failed. |
subscribed | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
adapters | Required | Object array: bluetooth2AdapterStatus | Contains status information for all the Bluetooth adapters available in the system. Note: If there are no available adapters, the array will be empty. |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
101, 143, 144 | See API Error Codes Reference | See API Error Codes Reference. |
Example code
# luna-send -i -f luna://com.webos.service.bluetooth2/adapter/getStatus '{
"subscribe":true
}'
Response:
{
"subscribed":true,
"adapters":[
{
"powered":true,
"discoveryTimeout":20,
"pairing":true,
"discoverableTimeout":30,
"name":"LG",
"adapterAddress":"00:00:dd:41:6b:ef",
"discovering":false,
"discoverable":false,
"pairable":true,
"pairableTimeout":30
}
],
"returnValue":true
}
Subscription response:
{
"subscribed":true,
"adapters":[
{
"powered":true,
"discoveryTimeout":20,
"pairing":true,
"discoverableTimeout":30,
"name":"LG",
"adapterAddress":"00:00:dd:41:6b:ef",
"discovering":false,
"discoverable":false,
"pairable":true,
"pairableTimeout":30
}
],
"returnValue":true
}
API level 11
Pairs a specific remote Bluetooth device with a specific Bluetooth adapter. The caller must subscribe to this method.
Only one pairing request, either incoming or outgoing, can be active for an adapter at a given time.
If the client calls LSCallCancel(), the pairing is canceled the same way as if adapter/cancelPairing had been called.
Note: A remote device can only be paired to a single adapter.
Name | Required | Type | Description |
---|---|---|---|
address | Required | String | Indicates the address (bdaddr) of the remote device with which pairing is being attempted. |
subscribe | Required | Boolean | Indicates if subscribed to get a notification when there is a change in the pairing status. Possible values are:
Note: Set subscribe to true. The caller must subscribe to this method. |
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
subscribed | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
Note: subscribed will contain true until the request:endPairing response is sent by the service. |
address | Optional | String | Indicates the address (bdaddr) of the paired remote Bluetooth device. |
request | Optional | String | Indicates the type of return. Possible values are:
|
passkey | Optional | Number | Indicates the passkey for request:displayPasskey or request:confirmPasskey. |
pinCode | Optional | String | Indicates the PIN code for request:displayPinCode. |
Error Code | Error Text | Error Description |
---|---|---|
1-13, 101-107, 143, 144 | See API Error Codes Reference | See API Error Codes Reference. |
118 | Pairing already in progress | Only one remote device can be pairing with the bluetooth adapter at any given time. This error indicates that the adapter is already pairing with a remote Bluetooth device, either with incoming or outgoing. Hence another pair cannot be initiated. |
Example code
# luna-send -i -f luna://com.webos.service.bluetooth2/adapter/pair '{
"address": "34:4d:f7:f9:52:f7",
"subscribe":true
}'
Response:
{
"returnValue":true,
"subscribed":true,
"passkey":952197,
"address":"34:4d:f7:f9:52:f7",
"request":"confirmPasskey"
}
API level 11
Returns the information on the Bluetooth adapters currently available in the system. The caller subscribes to this method to get informed of added/removed adapters (e.g., Bluetooth dongles) dynamically.
Note: The information returned for an adapter doesn't change while it is available.
Name | Required | Type | Description |
---|---|---|---|
subscribe | Optional | Boolean | Indicates if subscribed to get notifications. Possible values are:
Default: false |
Name | Required | Type | Description |
---|---|---|---|
subscribed | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
Note: returnValue will always contain true unless the request for subscription fails. |
adapters | Required | Object array: bluetooth2Adapter | Contains information of all the adapters currently available in the system. Note:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
Note: returnValue will always contain true unless the request for subscription fails. |
subscribed | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
Note: subscribed will contain true until the final response is sent by the service before stopping. |
adapters | Required | Object array: bluetooth2Adapter | Contains information of all the adapters currently available in the system. Note:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
101, 143, 144 | See API Error Codes Reference | See API Error Codes Reference. |
Example code
# luna-send -i -f luna://com.webos.service.bluetooth2/adapter/queryAvailable '{"subscribe":true}'
Response:
{
"subscribed":false,
"adapters":[
{
"stackName":"mock",
"stackVersion":"",
"adapterAddress":"00:00:dd:41:6b:ef",
"classOfDevice":5898764,
"firmwareVersion":"",
"serviceClasses":[
],
"default":true
}
],
"returnValue":true
}
Subscription response:
{
"subscribed":false,
"adapters":[
{
"stackName":"mock",
"stackVersion":"",
"adapterAddress":"00:00:dd:41:6b:ef",
"classOfDevice":5898764,
"firmwareVersion":"",
"serviceClasses":[
],
"default":true
}
],
"returnValue":true
}
API level 11
Sets the state of the specified Bluetooth adapter.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
name | Optional | String | Indicates the friendly name of the adapter. |
powered | Optional | Boolean | Indicates the power status of the adapter radio. Possible values are:
|
discoveryTimeout | Optional | Number | Indicates the discovery timeout in seconds. Note:
|
discoverable | Optional | Boolean | Indicates whether the adapter can be discovered by remote devices. Possible values are:
Default: false Note: If discoverableTimeout is set to a non-zero value, discoverable will be set back to false when the timer expires. |
discoverableTimeout | Optional | Number | Indicates the discoverable timeout in seconds. Note:
|
pairable | Optional | Boolean | Indicates whether to enable the adapter to be paired to a remote device. Possible values are:
Default: true |
pairableTimeout | Optional | Number | Indicates the pairable timeout in seconds. Note: After pairableTimeout seconds, the adapter is no longer pairable, and false is returned for pairable. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
adapterAddress | Required | String | Indicates the address of the adapter. Note:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
5, 101, 143, 144 | See API Error Codes Reference | See API Error Codes Reference. |
109 | Invalid negative value for discoveryTimeout | The discoveryTimeout parameter value cannot be negative, hence invalid. The passed value is also mentioned in the error message. |
110 | Invalid negative value for discoverableTimeout | The discoverableTimeout parameter value cannot be negative, hence invalid. The passed value is also mentioned in the error message. |
111 | Invalid negative value for pairableTimeout: | The pairableTimeout parameter value cannot be negative, hence invalid. The passed value is also mentioned in the error message. |
112 | Failed to change bluetooth power status | The default Bluetooth adapter cannot be either enabled or disabled as requested in the method. |
113 | Failed to set adapter properties | The Bluetooth adapter properties cannot be set to the stack(bluez5/bsa) as requested in this method. |
Example code
# luna-send -f -n 1 luna://com.webos.service.bluetooth2/adapter/setState '{
"powered":true
}'
Response:
{
"returnValue":true,
"adapterAddress":"00:00:45:0e:48:9b"
}
API level 11
Starts discovering the remote Bluetooth devices.
Note:
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
adapterAddress | Required | String | Indicates the address of the adapter. Note:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
101 | See API Error Codes Reference | See API Error Codes Reference. |
114 | Can't start discovery when adapter is turned off | Bluetooth adapter needs to be powered on with adapter/setState to start discovering other remote Bluetooth devices. |
115 | Failed to start discovery | The Bluetooth stack could not initiate discovery of remote Bluetooth devices. |
Example code
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/adapter/startDiscovery '{ }'
Response:
{
"returnValue":true,
"adapterAddress":"00:00:45:0e:48:9b"
}
API level 11
Supplies the user-entered passkey.
Note: The passkey is entered when adapter/pair sends a subscription response containing request:enterPasskey.
Name | Required | Type | Description |
---|---|---|---|
address | Required | String | Indicates the address (bdaddr) of the remote device. |
passkey | Required | Number | Indicates the passkey entered by the user. |
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Required | String | Indicates the address of the adapter. Note:
|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
1-13, 101, 102, 105, 143, 144 | See API Error Codes Reference | See API Error Codes Reference. |
119 | Required 'passkey' parameter not supplied | The passkey parameter is mandatory to this method, but was not supplied by the caller of the method. |
Example code
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/adapter/supplyPasskey '{
"address": "34:4d:f7:f9:52:f7",
"passkey":842280
}'
Response:
{
"adapterAddress":"00:00:45:0e:48:9b",
"returnValue":true
}
API level 11
Supplies the user's confirmation for the passkey.
Note: The user confirms the passkey when adapter/pair sends a subscription response containing request:confirmPasskey.
Name | Required | Type | Description |
---|---|---|---|
address | Required | String | Indicates the address (bdaddr) of the remote device with which pairing is being attempted. |
accept | Required | Boolean | Indicates if the user has confirmed the passkey. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Required | String | Indicates the address of the adapter. Note:
|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
Note: If accept is false, the adapter/pair method will send a final subscription response containing returnValue:false indicating that the pairing has failed. |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
1-13, 101, 102, 105, 108, 143, 144 | See API Error Codes Reference | See API Error Codes Reference. |
121 | Required 'accept' parameter not supplied | The accept parameter is mandatory for this method, but was not supplied by the caller of the method. |
Example code
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/adapter/supplyPasskeyConfirmation '{
"address": "34:4d:f7:f9:52:f7",
"accept":true
}'
Response:
{
"adapterAddress":"00:00:45:0e:48:9b",
"returnValue":true
}
API level 11
Supplies the user-entered PIN code.
Note: The PIN code is entered when adapter/pair sends a subscription response containing request:enterPinCode.
Name | Required | Type | Description |
---|---|---|---|
address | Required | String | Indicates the address (bdaddr) of the remote device. |
pin | Required | String | Indicates the PIN code entered by the user. |
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Required | String | Indicates the address of the adapter. Note:
|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
Note: If the pin is incorrect, the adapter/pair method will send a final subscription response containing returnValue:false indicating that the pairing has failed. |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
1-13, 101, 102, 105, 143, 144 | See API Error Codes Reference | See API Error Codes Reference. |
120 | Required 'pin' parameter not supplied | The pin parameter is mandatory to this method, but was not supplied by the caller of the method. |
Example code
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/adapter/supplyPinCode '{
"address": "34:4d:f7:f9:52:f7",
"pin":"2345"
}'
Response:
{
"adapterAddress":"00:00:45:0e:48:9b",
"returnValue":true
}
API level 11
Disconnects from the paired remote device.
Note: All pairing information about the remote device will be removed and any open connections will be closed. However, the remote device is still discoverable.
Name | Required | Type | Description |
---|---|---|---|
address | Required | String | Indicates the address (bdaddr) of the remote device to unpair. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
adapterAddress | Required | String | Indicates the address of the adapter. Note:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
101, 102, 105, 106, 143, 144 | See API Error Codes Reference | See API Error Codes Reference. |
122 | Failed to unpair | Failed to unpair the Bluetooth adapter with the paired remote Bluetooth device. |
Example code
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/adapter/unpair '{
"address": "34:4d:f7:f9:52:f7"
}'
Response:
{
"adapterAddress":"00:00:45:0e:48:9b",
"returnValue":true
}
API level 11
Awaits incoming media metadata requests from remote devices. This method is available only for TG (Target).
The method just listens the requests from CT (Controller) and lets the caller of the method in TG know the requests.
We assume that the caller already knows the media or playback status information or can get it from the other services such as media or music service.
The caller in TG is expected to send proper information by using the avrcp/supplyMediaMetaData method to CT after receiving the request returned from the avrcp/awaitMediaMetaDataRequest method.
In AVRCP, metadata attributes for the currently playing media element can be retrieved by the CT by using the GetElementAttributes command. This allows the CT to request a specific set, or all attributes from the TG. These attributes include such as title and artist. The CT also might be interested to know the current status of a media track or when media track is changed, so that new media information can be displayed on the controller’s display.
The CT could do one of:
i) Querying for play status or
ii) Registering with the TG to receive play status notifications.
The TG then sends a notification PDU when a status is changed if the CT had registered for that change.
Note: Currently, this method is focusing on only TG operations which are triggered by CT requests or queries. The CT operations and TG notification by registration of CT will be added later in the same category.
Name | Required | Type | Description |
---|---|---|---|
subscribe | Required | Boolean | Indicates if subscribed for notifications. Possible values are:
Note: The caller must subscribe to this method. |
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
adapterAddress | Optional | String | Indicates the address of the adapter. |
subscribed | Optional | Boolean | Indicates if subscribed to get notifications. Possible values are:
Note: subscribed will always contain true since subscription ends only when the client chooses to close it. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
errorCode | Optional | Number | The error code for the failed operation. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
subscribed | Optional | Boolean | Indicates if subscribed to get notifications. Possible values are:
Note: subscribed will always contain true since subscription ends only when the client chooses to close it. |
address | Optional | String | Indicates the address (bdaddr) of the remote device. |
adapterAddress | Optional | String | Indicates the address of the adapter. |
requestId | Optional | String | Indicates the unique ID of a request. Note: The format of requestId is "nnn", 3 digit number. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
errorCode | Optional | Number | The error code for the failed operation. |
Error Code | Error Text | Error Description |
---|---|---|
101, 103, 104, 143, 144, 161, 162 | Depends on error code | For details of a specific error code, see the API Error Codes Reference section. |
Example: With subscription
# luna-send -f -i luna://com.webos.service.bluetooth2/avrcp/awaitMediaMetaDataRequest '{
"subscribe":true
}'
Response:
{
"subscribed":true,
"adapterAddress":"00:00:c5:99:f5:87",
"returnValue":true
}
Subscription response:
{
"requestId":"001",
"adapterAddress":"00:00:c5:99:f5:87",
"subscribed":true,
"address":"34:4d:f7:f9:52:f7",
"returnValue":true
}
API level 11
Awaits the incoming media play status requests from remote devices. This method is available only for the TG (Target).
The avrcp/awaitMediaPlayStatusRequest method used for the TG just listens to the requests from CT (Controller) and lets the caller of the method in TG know the requests.
We assume that the caller already knows the media or playback status information or can get it from the other services such as media or music service.
The caller in TG is expected to send the proper information by using avrcp/supplyMediaPlayStatus method to CT after receiving the request returned from the avrcp/awaitMediaPlayStatusRequest method.
Name | Required | Type | Description |
---|---|---|---|
subscribe | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
Note: The caller must subscribe to this method. |
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
adapterAddress | Optional | String | Indicates the address of the adapter. |
subscribed | Optional | Boolean | Indicates if subscribed to get notifications. Possible values are:
Note: subscribed will always contain true since subscription ends only when the client chooses to close it. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
errorCode | Optional | Number | The error code for the failed operation. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
subscribed | Optional | Boolean | Indicates if subscribed to get notifications. Possible values are:
Note: subscribed will always contain true since subscription ends only when the client chooses to close it. |
address | Optional | String | Indicates the address (bdaddr) of the remote device. |
adapterAddress | Optional | String | Indicates the address of the adapter. |
requestId | Optional | String | Indicates the unique ID of a request. Note: The format of requestId is "nnn", 3 digit number. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
errorCode | Optional | Number | The error code for the failed operation. |
Error Code | Error Text | Error Description |
---|---|---|
101, 103, 104, 143, 144, 161, 162 | Depends on error code | For details of an error code, see the API Error Codes Reference section. |
Example code
# luna-send -f -i luna://com.webos.service.bluetooth2/avrcp/awaitMediaPlayStatusRequest '{
"subscribe":true
}'
Response:
{
"subscribed":true,
"adapterAddress":"00:00:c5:99:f5:87",
"returnValue":true
}
Subscription response:
{
"requestId":"001",
"adapterAddress":"00:00:c5:99:f5:87",
"subscribed":true,
"address":"34:4d:f7:f9:52:f7",
"returnValue":true
}
API level 12
Adds the browsed item to the current playing list.
Note:
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
address | Required | String | Indicates the address of the remote device. |
itemPath | Required | String | Indicates the path to the item in the current folder to be added to the current playing list. Note: Item path is received in the bluetooth2FolderItem object of the getFolderItems API response. |
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Required | String | Indicates the address of the adapter. |
address | Required | String | Indicates the address of the remote device. |
returnValue | Required | Boolean | Indicates the status of the operation.
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. |
Error Code | Error Text | Error Description |
---|---|---|
1, 17, 101, 105, 302, 127, 136, 143, 144 | See API Error Codes section for reference | See API Error Codes section for reference |
Example: Invalid operation
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/ avrcp/browse/addToNowPlaying '{
"address":"6c:c4:d5:6d:83:db",
"adapterAddress":"b8:27:eb:59:5c:8a",
"itemPath":"player0/Filesystem/item4/item97"
}'
Response:
{
"errorCode":17,
"returnValue":false,
"errorText":"Performed operation is not allowed"
}
API level 12
Navigates the virtual filesystem presented by the remote media player. This API can be called to change to a specific folder for browsing. "type" field of bluetooth2FolderItem received as response to getFolderITems indicates if the item is audio/video or folder. If the item is "folder" then the API can be called with corresponding path to browse the folder.
Browsing folder can be changed to a folder that is one level up or down to the current folder in hierarchy.
Example: Folder cannot be changed directly from media/album/album1/ to /media/artist/artist1.
We need to move first from /media/album/album1 ==> to /media/album/ ==> then to /media/ ==> then to /media/artist/ ==> and then to /media/artist/artist1.
Note that for going back to a parent folder also the API needs to be called with the parent folder path.
When the API succeeds, the current browsing folder changes, hence the application will receive the subscription response to the getCurrentFolder API.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
address | Required | String | Indicates the address of the remote device. |
itemPath | Required | String | Indicates the path to the folder item to change to. Note: Item path is received in the bluetooth2FolderItem object of the getFolderItems API response. |
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Required | String | Indicates the address of the adapter. |
address | Required | String | Indicates the address of the remote device. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. |
Error Code | Error Text | Error Description |
---|---|---|
1, 17, 101, 105, 302, 127, 136, 143, 144 | See API Error Codes section for reference | See API Error Codes section for reference |
Example scenario
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/ avrcp/browse/changePath '{
"address":"6c:c4:d5:6d:83:db",
"adapterAddress":"5c:f3:70:97:5d:3c",
"itemPath":"player0/Filesystem/item4"
}'
Response:
{
"adapterAddress":"5c:f3:70:97:5d:3c",
"address":"6c:c4:d5:6d:83:db",
"returnValue":true
}
API level 12
Gets the current folder in the media player's virtual filesystem presented by AVRCP TG which can be browsed for the media content.
Example: As the user navigates to a sub folder or a parent folder, browsing folder changes. The information (i.e. the new current folder) is provided as subscription response of this API.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
address | Required | String | Indicates the address of the remote device. |
subscribe | Optional | Boolean | Indicates if subscribed to get notifications. Possible values are:
Default: false |
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. |
address | Optional | String | Indicates the address of the remote device. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
subscribed | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
folderName | Optional | String | Indicates the current folder name browsed by the user. Note: Folder name can be empty if current folder information is not received yet from the device for current addressed player or if the current addressed player does not support browsing. |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Required | String | Indicates the address of the adapter. |
address | Required | String | Indicates the address of the remote device. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
subscribed | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
folderName | Optional | String | Indicates the current folder name browsed by the user. Note: Folder name can be empty if current folder information is not received yet from the device for current addressed player or if the current addressed player does not support browsing. |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
1, 17, 101, 105, 127, 136, 143, 144 | See API Error Codes section for reference | See API Error Codes section for reference |
Example scenario
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/avrcp/browse/getCurrentFolder '{
"address":"54:B8:02:34:B0:78",
"adapterAddress":"b8:27:eb:b4:79:3f",
"subscribe":true
}'
Response:
{
"address":"54:b8:02:34:b0:78",
"subscribed":true,
"folderName":"/Filesystem",
"adapterAddress":"b8:27:eb:b4:79:3f",
"returnValue":true
}
API level 12
Gets the items in the current folder of the media player's virtual filesystem presented by AVRCP TG. It takes startIndex and endIndex as argument and gets the items within this range.
It is recommended to fetch a part of the list at a time and update it as user scrolls the display to avoid any delay in fetching the items from AVRCP_TG and displaying the items. This can be done by specifying the range using startIndex and endIndex. endIndex should be less than total number of items received using getNumberOfItems API. Application should not call getFolderItems API if the folder is empty.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
address | Required | String | Indicates the address of the remote device. |
startIndex | Required | Number | Indicates the offset within the listing of the item, which should be the first returned item. The first element in the listing is at offset 0. |
endIndex | Required | Number | Indicates the offset within the listing of the item, which should be the final returned item. Note: endIndex should be greater than or equal to startIndex ( endIndex = startIndex means you are requesting one item that is at index endIndex/startIndex) and less than total number of items in the current folder. |
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Required | String | Indicates the address of the adapter. |
address | Required | String | Indicates the address of the remote device. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
folderItems | Optional | Object array: bluetooth2AvrcpFolderItem | Indicates an array of items in the folder. |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
1, 17, 101, 105, 127, 136, 143, 144, 300, 301 | See API Error Codes section for reference | See API Error Codes section for reference |
Example scenario
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/avrcp/browse/getFolderItems '{
"address":"6c:c4:d5:6d:83:db",
"adapterAddress":"5c:f3:70:97:5d:3c",
"startIndex":0,
"endIndex":3
}'
Response:
{
"adapterAddress":"5c:f3:70:97:5d:3c",
"address":"6c:c4:d5:6d:83:db",
"folderItems":[
{
"path":"player0/Filesystem/item1",
"playable":false,
"name":"/Filesystem/Albums",
"type":"Folder"
},
{
"path":"player0/Filesystem/item2",
"playable":false,
"name":"/Filesystem/Artists",
"type":"Folder"
},
{
"path":"player0/Filesystem/item3",
"playable":false,
"name":"/Filesystem/Playlists",
"type":"Folder"
},
{
"path":"player0/Filesystem/item4",
"playable":false,
"name":"/Filesystem/All Songs",
"type":"Folder"
}
],
"returnValue":true
}
Example scenario
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/avrcp/browse/getFolderItems '{
"address":"6c:c4:d5:6d:83:db",
"adapterAddress":"b8:27:eb:59:5c:8a",
"startIndex":2,
"endIndex":4
}'
Response:
{
"adapterAddress":"b8:27:eb:59:5c:8a",
"returnValue":true,
"folderItems":[
{
"path":"player9/Filesystem/item4/item94",
"name":"AUD-20200726-WA0001",
"type":"Audio",
"playable":true,
"metaData":{
"artist":"",
"trackNumber":0,
"album":"",
"genre":"",
"title":"AUD-20200726-WA0001",
"duration":0,
"trackCount":0
}
},
{
"path":"player9/Filesystem/item4/item95",
"name":"AUD-20200726-WA0002",
"type":"Audio",
"playable":true,
"metaData":{
"artist":"",
"trackNumber":0,
"album":"",
"genre":"",
"title":"AUD-20200726-WA0002",
"duration":0,
"trackCount":0
}
},
{
"path":"player9/Filesystem/item4/item96",
"name":"AUD-20200726-WA0003",
"type":"Audio",
"playable":true,
"metaData":{
"artist":"",
"trackNumber":0,
"album":"",
"genre":"",
"title":"AUD-20200726-WA0003",
"duration":0,
"trackCount":0
}
}
],
"address":"6c:c4:d5:6d:83:db"
}
API level 12
Retrieves the total number of items in the current folder of the media player's virtual file system presented by the AVRCP TG.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
address | Required | String | Indicates the address of the remote device. |
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Required | String | Indicates the address of the adapter. |
address | Required | String | Indicates the address of the remote device. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
numberOfItems | Optional | Number | Indicates the total number of items in the current folder. |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
1, 17, 101, 105, 127, 136, 143, 144 | See API Error Codes section for reference | See API Error Codes section for reference |
Example scenario
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/avrcp/browse/getNumberOfItems '{
"address":"6c:c4:d5:6d:83:db",
"adapterAddress":"b8:27:eb:59:5c:8a"
}'
Response:
{
"adapterAddress": "b8:27:eb:59:5c:8a",
"address": "6c:c4:d5:6d:83:db",
"returnValue": true,
"numberOfItems": 4
}
API level 12
Plays the browsed item.
Note:
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
address | Required | String | Indicates the address of the remote device. |
itemPath | Required | String | Indicates the path to the playable item in the current folder to be played. Note: Item path is received in the bluetooth2AvrcpFolderItem object of the getFolderItems API response. |
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. |
address | Required | String | Indicates the address of the remote device. |
returnValue | Required | Boolean | Indicates the status of the operation.
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
1, 17, 101, 105, 302, 127, 136, 143, 144 | See API Error Codes section for reference | See API Error Codes section for reference |
Example scenario
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/ avrcp/browse/playItem '{
"address":"6c:c4:d5:6d:83:db",
"adapterAddress":"b8:27:eb:59:5c:8a",
"itemPath":"player7/Filesystem/item4/item95"
}'
Response:
{
"adapterAddress":"b8:27:eb:59:5c:8a",
"address":"6c:c4:d5:6d:83:db",
"returnValue":true
}
API level 12
Searches an item in the current browsing folder (and its sub folders) using a search string.
Note:
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
address | Required | String | Indicates the address of the remote device. |
searchString | Required | String | Indicates the string to search. |
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Required | String | Indicates the address of the adapter. |
address | Required | String | Indicates the address of the remote device. |
returnValue | Required | Boolean | Indicates the status of the operation.
|
searchResult | Optional | String | Indicates the path to the search list. Note: The application can changeFolder to this path and browse the search list |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
1, 17, 101, 105, 303, 127, 136, 143, 144 | See API Error Codes section for reference | See API Error Codes section for reference |
Example: Invalid operation
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/ avrcp/browse/search '{
"address":"6c:c4:d5:6d:83:db",
"adapterAddress":"b8:27:eb:59:5c:8a",
"searchString":"abcd"
}'
Response:
{
"errorCode":17,
"returnValue":false,
"errorText":"Performed operation is not allowed"
}
API level 11
Opens an AVRCP connection to a remote Bluetooth device.
Name | Required | Type | Description |
---|---|---|---|
address | Required | String | Indicates the address (bdaddr) of the remote device. |
subscribe | Optional | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
adapterAddress | Optional | String | Indicates the address of the adapter. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
errorCode | Optional | Number | The error code for the failed operation. |
subscribed | Optional | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
subscribed | Optional | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
disconnectByRemote | Optional | String | Indicates whether the remote device or the local user initiated the disconnection. Possible values are:
|
adapterAddress | Optional | String | Indicates the address of the adapter. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
errorCode | Optional | Number | The error code for the failed operation. |
Error Code | Error Text | Error Description |
---|---|---|
102, 103, 105, 106, 127, 128, 129, 130, 131, 143, 144 | Depends on error code | For details of an error code, see the API Error Codes Reference section. |
Example code
# luna-send -i -f luna://com.webos.service.bluetooth2/avrcp/connect '{
"address":"00:18:6b:49:db:86",
"subscribe":true
}'
Response:
{
"subscribed": true,
"adapterAddress": "00:00:45:0e:48:9b",
"returnValue": true
}
Subscription response:
{
"subscribed": true,
"adapterAddress": "00:00:45:0e:48:9b",
"disconnectByRemote": true,
"returnValue": true
}
API level 11
Drops the connection to the given remote device on the AVRCP profile.
Name | Required | Type | Description |
---|---|---|---|
address | Required | String | Indicates the address (bdaddr) of the remote device. |
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
adapterAddress | Optional | String | Indicates the address of the adapter. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
errorCode | Optional | Number | The error code for the failed operation. |
Error Code | Error Text | Error Description |
---|---|---|
102, 105, 106, 127, 132, 143, 144 | Depends on error code | For details of an error code, see the API Error Codes Reference section. |
Example code
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/avrcp/disconnect '{
"address":"aa:bb:cc:dd:ee:00"
}'
Response:
{
"adapterAddress":"11:22:33:44:55:66",
"returnValue":true
}
API level 12
Gets media metadata of the target from remote devices connected via AVRCP 1.3 profile.
Name | Required | Type | Description |
---|---|---|---|
subscribe | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
Note: The caller must subscribe to this method. |
address | Required | String | Indicates the address (bdaddr) of the remote device. |
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
subscribed | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
address | Required | String | Indicates the address (bdaddr) of the remote device. |
adapterAddress | Required | String | Indicates the address of the adapter. |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
subscribed | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
address | Required | String | Indicates the address (bdaddr) of the remote device. |
adapterAddress | Required | String | Indicates the address of the adapter. |
metaData | Required | Object: bluetooth2MediaMetaData | Indicates the metaData of the media. |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
106, 127, 136, 143, 144 | See API Error Codes Reference | See the API Error Codes Reference section. |
Example code
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/avrcp/getMediaMetaData '{
"subscribe":true,
"address":"34:4d:f7:f9:52:f7"
}'
Response:
{
"subscribed":true,
"returnValue":true,
"adapterAddress":"00:00:9a:1d:89:5d",
"address":"34:4d:f7:f9:52:f7"
}
Subscription response:
{
"subscribed":true,
"returnValue":true,
"adapterAddress":"00:00:9a:1d:89:5d",
"address":"34:4d:f7:f9:52:f7"
"metaData":{
"title":"Beethoven Symphony No.5",
"artist":"Berliner Phillharmoniker",
"album":"ss",
"genre":"Classic",
"trackNumber":5,
"trackCount":9,
"duration":2065000
}
}
API level 12
Gets the media metadata of the target from remote devices connected via AVRCP 1.3 profile.
Name | Required | Type | Description |
---|---|---|---|
subscribe | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
Note: The caller must subscribe to this method. |
address | Required | String | Indicates the address (bdaddr) of the remote device. |
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
subscribed | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
address | Required | String | Indicates the address (bdaddr) of the remote device. |
adapterAddress | Required | String | Indicates the address of the adapter. |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
subscribed | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
address | Required | String | Indicates the address (bdaddr) of the remote device. |
adapterAddress | Required | String | Indicates the address of the adapter. |
playbackStatus | Required | Object: bluetooth2PlayStatus | Indicates the information about the playbackStatus of the media. |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
103, 106, 127, 136, 143, 144 | See API Error Codes Reference | See the API Error Codes Reference section. |
Example code
# luna-send -i -f luna://com.webos.service.bluetooth2/avrcp/getMediaPlayStatus '{
"subscribe":true
}'
Response:
{
"subscribed":true,
"returnValue":true,
"adapterAddress":"00:00:9a:1d:89:5d"
}
Subscription Response:
{
"subscribed":true,
"returnValue":true,
"adapterAddress":"00:00:9a:1d:89:5d",
"address":"34:4d:f7:f9:52:f7",
"playbackStatus":{
"position":156910,
"duration":13544,
"status":"play"
}
}
API level 12
Gets the player application settings value.
Name | Required | Type | Description |
---|---|---|---|
subscribe | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
address | Required | String | Indicates the address (bdaddr) of the remote device. |
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
subscribed | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
address | Required | String | Indicates the address (bdaddr) of the remote device. |
adapterAddress | Required | String | Indicates the address of the adapter. |
errorCode | Optional | String | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
subscribed | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
address | Required | String | Indicates the address (bdaddr) of the remote device. |
adapterAddress | Required | String | Indicates the address of the adapter. |
equalizer | Required | String | Indicates the status of the equalizer. Possible values are:
|
repeat | Required | String | Indicates the status of the repeat mode. Possible values are:
|
shuffle | Required | String | Indicates the status of the shuffle. Possible values are:
|
scan | Required | String | Indicates the status of the scan. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
103, 106, 127, 136, 143, 144 | See API Error Codes Reference | See the API Error Codes Reference section. |
Example code
# luna-send -i -f luna://com.webos.service.bluetooth2/avrcp/getPlayerApplicationSettings '{
"subscribe":true
}'
Response:
{
"subscribed":true,
"returnValue":true,
"adapterAddress":"00:00:9a:1d:89:5d"
}
Subscription Response:
{
"subscribed":true,
"returnValue":true,
"adapterAddress":"00:00:9a:1d:89:5d",
"address":"34:4d:f7:f9:52:f7",
"equalizer":"off",
"reapeat":"off",
"shuffle":"off",
"scan":"off"
}
API level 12
Returns the information of the media players available that is received from AVRCP TG (AVRCP Target). Subscription response will be received by the application whenever a new media player is added or a media player is removed from the media player list received from AVRCP TG.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
address | Required | String | Indicates the address of the remote device. |
subscribe | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
Default: false |
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Required | String | Indicates the address of the adapter. |
address | Required | String | Indicates the address of the remote device. |
subscribed | Required | Boolean | Indicates if subscribed to get notifications.
|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
playerInfo | Optional | Object array: bluetooth2AvrcpPlayerInfo | Indicates the player information. |
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Required | String | Indicates the address of the adapter. |
address | Required | String | Indicates the address of the remote device. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
subscribed | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
playerInfo | Optional | Object array: bluetooth2AvrcpPlayerInfo | Indicates the player information. |
Error Code | Error Text | Error Description |
---|---|---|
1, 17, 101, 105, 127, 136, 143, 144 | See API Error Codes section for reference | See API Error Codes section for reference |
Example Code
# luna-send -i -f luna://com.webos.service.bluetooth2/avrcp/getPlayerInfo '{
"address":"54:B8:02:34:B0:78",
"adapterAddress":"b8:27:eb:b4:79:3f",
"subscribe":true
}'
Response:
{
"playerInfo":[
{
"addressed":true,
"playlistPath":"player0/NowPlaying",
"type":"Audio",
"searchable":false,
"browsable":true,
"name":"Google Play Music"
}
],
"address":"54:b8:02:34:b0:78",
"subscribed":true,
"adapterAddress":"b8:27:eb:b4:79:3f",
"returnValue":true
}
API level 12
Gets the volume of the remote device.
Note: The method supports 'Volume Changed Notification' only.
Name | Required | Type | Description |
---|---|---|---|
subscribe | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
Note: The caller must subscribe to this method. |
address | Optional | String | Indicates the address (bdaddr) of the remote device. Note: If not specified, returns all requested volume info from the all connected devices. |
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | String | Indicates the status of the operation. Possible values are:
|
subscribed | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
Note: subscribed will always contain true since subscription ends only when the client chooses to close it. |
adapterAddress | Required | String | Indicates the address of the adapter. |
address | Optional | String | Indicates the address (bdaddr) of the remote device. |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
subscribed | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
adapterAddress | Required | String | Indicates the address of the adapter. |
address | Optional | String | Indicates the address (bdaddr) of the remote device. |
volume | Required | Number | Indicates the requested volume level in percentage. Possible range: 0 ~ 100. |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
103, 106, 127, 136, 143, 144 | See API Error Codes Reference | See the API Error Codes Reference section. |
Example code
# luna-send -f -n 1 luna://com.webos.service.bluetooth2/avrcp/getRemoteVolume '{
"subscribe":true
}'
Response:
{
"subscribed":true,
"returnValue":true,
"adapterAddress":"00:00:9a:1d:89:5d"
}
Subscription response:
{
"subscribed":true,
"returnValue":true,
"adapterAddress":"00:00:9a:1d:89:5d",
"address":"34:4d:f7:f9:52:f7",
"volume":100
}
API level 11
Returns the status of an AVRCP connection to a remote Bluetooth device.
Name | Required | Type | Description |
---|---|---|---|
address | Required | String | Indicates the address (bdaddr) of the remote device. |
subscribe | Optional | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
subscribed | Optional | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
connecting | Optional | Boolean | Indicates whether the connection request is currently being processed. Possible values are:
|
connected | Optional | Boolean | Indicates if the connection is open. Possible values are:
|
adapterAddress | Optional | String | Indicates the address of the adapter. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
errorCode | Optional | Number | The error code for the failed operation. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
subscribed | Optional | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
connecting | Optional | Boolean | Indicates whether the connection request is currently being processed. Possible values are:
|
connected | Optional | Boolean | Indicates if the connection is open. Possible values are:
|
adapterAddress | Optional | String | Indicates the address of the adapter. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
errorCode | Optional | Number | The error code for the failed operation. |
Error Code | Error Text | Error Description |
---|---|---|
102, 105, 106, 127, 133, 143, 144 | Depends on error code | For details of an error code, see the API Error Codes Reference section. |
Example code
# luna-send -i -f luna://com.webos.service.bluetooth2/avrcp/getStatus '{
"address":"aa:bb:cc:dd:ee:00",
"subscribe":true
}'
Subscription Return: When the user connects to a remote device, the connected field changes from false to true (if the remote device gets connected)
{
"adapterAddress":"11:22:33:44:55:66",
"connected":false,
"subscribed":true,
"returnValue":true,
"connecting":true
}
{
"adapterAddress":"11:22:33:44:55:66",
"connected":true,
"subscribed":true,
"returnValue":true,
"connecting":false
}
API level 12
Disables the profile and role of AVRCP.
Name | Required | Type | Description |
---|---|---|---|
role | Optional | String | Indicates the type of AVRCP role to be disabled. Possible values are:
Note: If not specified, the role which is possible is disabled. |
adapterAddress | Optional | String | Indicates the address of the adapter. Note: If not specified, the default adapter will be used. |
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Required | String | Indicates the address of the adapter. Note: If not specified, the default adapter will be used. |
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
143, 144, 249, 251 | See API Error Codes Reference | See the API Error Codes Reference section. |
Example code
# luna-send -f -n 1 luna://com.webos.service.bluetooth2/avrcp/internal/disable '{
"role":"AVRCP-TG"
}'
API level 12
Enables the profile and the role of AVRCP.
Name | Required | Type | Description |
---|---|---|---|
role | Optional | String | Indicates the AVRCP role to be enabled. Possible values are:
Note: If not specified, the role which is possible is enabled. |
adapterAddress | Optional | String | Indicates the address of the adapter. Note: If not specified, the default adapter will be used. |
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Required | String | Indicates the address of the adapter. Note: If not specified, the default adapter will be used. |
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
errorCode | Optional | Boolean | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
143, 144, 248, 250 | See API Error Codes Reference | See the API Error Codes Reference section. |
Example code
# luna-send -f -n 1 luna://com.webos.service.bluetooth2/avrcp/internal/enable '{
"role":"AVRCP-TG"
}'
API level 12
Gets the remote AVRCP's features.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note: If not specified, the default adapter will be used. If the application/service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used. |
address | Required | String | Indicates the address (bdaddr) of the remote device. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
adapterAddress | Required | String | Indicates the address of the adapter. Note: If not specified, the default adapter will be used. |
address | Required | String | Indicates the address (bdaddr) of the remote device. |
remoteFeatures | Required | Object array: bluetooth2AvrcpRemoteFeatureInfo | Indicates an array of the remote features. |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
101,143,144 | See API Error Codes Reference | See the API Error Codes Reference section. |
Example code
# luna-send -f -n 1 luna://com.webos.service.bluetooth2/avrcp/internal/getRemoteFeatures '{
"address":"aa:bb:cc:dd:ee:ff"
}'
API level 12
Gets the remote AVRCP's supported notification events.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter executing this method. Note: If not specified, the default adapter will be used. If the application/service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used. |
address | Required | String | Indicates the address (bdaddr) of the remote device. |
subscribe | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
Note: The caller must subscribe to this method. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
adapterAddress | Required | String | Indicates the address of the adapter. |
subscribed | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
Note: subscribed will always contain true since subscription ends only when the client chooses to close it. |
address | Required | String | Indicates the address (bdaddr) of the remote device. |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
subscribed | Required | Boolean | Indicates if subscribed to get notified when a connection is closed.
|
address | Required | String | Indicates the address (bdaddr) of the remote device. |
adapterAddress | Required | String | Indicates the address of the adapter. Note: If not specified, the default adapter will be used. |
supportedNotificationEvents | Required | Number array | Indicates the list of remote avrcp's supported notification events. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
101,143,144 | See API Error Codes Reference | See the API Error Codes Reference section. |
Example code
# luna-send -f -n 1 luna://com.webos.service.bluetooth2/avrcp/internal/getSupportedNotificationEvents '{
"address":"aa:bb:cc:dd:ee:ff",
"subscribe":true
}'
API level 12
Enables the AVRCP target to inform the AVRCP controller about the change in media play status or position without controller requesting for the same.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note: If not specified, the default adapter is used |
address | Required | String | Indicates the address of the remote device. |
playbackStatus | Required | Object: bluetooth2PlayStatus | Indicates the information about the play status of the media. |
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Required | String | Indicates the address of the adapter. |
address | Required | String | Indicates the address of the remote device. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
1, 17, 101, 105, 308, 127, 136, 143, 144 | See API Error Codes section for reference | See API Error Codes section for reference |
Example scenario
# luna-send -f -n 1 luna://com.webos.service.bluetooth2/avrcp/ notifyMediaPlayStatus '{
"adapterAddress":"b8:27:eb:59:5c:8a",
"address":"04:52:c7:7b:9e:ce",
"playbackStatus":{
"duration":60000,
"position":8000,
"status":"playing"
}
}'
Response:
{
"adapterAddress":"b8:27:eb:59:5c:8a",
"returnValue":true,
"address":"04:52:c7:7b:9e:ce"
}
API level 11
Receives PATH THROUGH command from CT to TG.
Note: The PASS THROUGH command is used to transfer user operation information from a CT (Controller) to Panel sub-unit on TG (Target).
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
address | Required | String | Indicates the address (bdaddr) of the remote device. |
subscribe | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
Note: The caller must subscribe to this method. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
adapterAddress | Required | String | Indicates the address of the adapter. |
subscribed | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
Note: subscribed will always contain true since subscription ends only when the client chooses to close it. |
address | Required | String | Indicates the address (bdaddr) of the remote device. |
errorCode | Optional | Boolean | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
subscribed | Required | Boolean | Indicates if subscribed to get notified when a connection is closed.
|
address | Required | String | Indicates the address (bdaddr) of the remote device. |
adapterAddress | Required | String | Indicates the address of the adapter. |
keyCode | Required | String | The key code which is operated. Possible values are:
|
keyStatus | Required | String | Indicates the key status. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
101,143,144 | See API Error Codes Reference | See the API Error Codes Reference section. |
Example code
# luna-send -f -n 1 luna://com.webos.service.bluetooth2/avrcp/receivePassThroughCommand '{
"address": "aa:bb:cc:dd:ee:ff",
"subscribe" : true
}'
API level 12
Sends PASS THROUGH command from CT (Controller) to TG (Target).
Note: The PASS THROUGH command is used to transfer user operation information from the CT to the panel sub-unit on the TG.
Name | Required | Type | Description |
---|---|---|---|
keyCode | Required | String | The key code which is operated. Possible values are:
|
keyStatus | Required | String | The key status. Possible values are:
|
address | Required | String | Indicates the address (bdaddr) of the remote device. |
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
adapterAddress | Required | String | Indicates the address of the adapter. |
address | Required | String | Indicates the address (bdaddr) of the remote device. |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
106, 127, 136, 143, 144, 237, 238, 239, 240, 241, 242 | See the "API Error Codes Reference" section. | See the API Error Codes Reference section. |
Example code
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/avrcp/sendPassThroughCommand '{
"keyCode":"play",
"keyStatus":"pressed",
"address":"34:4d:f7:f9:52:f7"
}'
Response:
{
"returnValue":true,
"adapterAddress":"00:00:9a:1d:89:5d",
"address":"34:4d:f7:f9:52:f7"
}
API level 12
Sets the absolute volume on the target device.
Name | Required | Type | Description |
---|---|---|---|
volume | Required | Number | Indicates the requested volume level in percentage. Possible range: 0 ~ 100. |
address | Required | String | Indicates the address (bdaddr) of the remote device. |
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
adapterAddress | Required | String | Indicates the address of the adapter. |
address | Required | String | Indicates the address (bdaddr) of the remote device. |
errorCode | Optional | String | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
106, 127, 136, 143, 144, 237, 252, 253, 254 | See API Error Codes Reference | See the API Error Codes Reference section. |
Example code
# luna-send -f -n 1 luna://com.webos.service.bluetooth2/avrcp/setAbsoluteVolume '{
"address":"34:4d:f7:f9:52:f7",
"volume":100
}'
Response:
{
"returnValue":true,
"adapterAddress":"00:00:9a:1d:89:5d"
}
API level 12
Sets the player application settings value.
Name | Required | Type | Description |
---|---|---|---|
address | Required | String | Indicates the address (bdaddr) of the remote device. |
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
equalizer | Optional | String | Indicates the status of the equalizer. Possible values are:
|
repeat | Optional | String | Indicates the status of repeat mode. Possible values are:
|
shuffle | Optional | String | Indicates the status of shuffle. Possible values are:
|
scan | Optional | String | Indicates the status of scan. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
adapterAddress | Required | String | Indicates the address of the adapter. |
address | Required | String | Indicates the address (bdaddr) of the remote device. |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
106, 127, 136, 143, 144, 243, 244, 245, 246 | See API Error Codes Reference | See the "API Error Codes Reference" section. |
Example code
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/avrcp/setPlayerApplicationSettings '{
"address":"34:4d:f7:f9:52:f7",
"equalizer":"on",
"repeat":"on"
}'
Response:
{
"returnValue":true,
"adapterAddress":"00:00:9a:1d:89:5d"
}
API level 11
Supplies media metadata of the target to remote devices connected via AVRCP 1.3 profile.
Name | Required | Type | Description |
---|---|---|---|
requestId | Required | String | Indicates the unique ID of a request. Note: The format of requestId is "nnn", a three-digit number. |
metaData | Required | Object: bluetooth2MediaMetaData | Indicates the metaData of the media. |
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
adapterAddress | Optional | String | Indicates the address of the adapter. |
requestId | Optional | String | Indicates the unique ID of a request. Note: The format of requestId is "nnn", a three-digit number. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
errorCode | Optional | Number | The error code for the failed operation. |
Error Code | Error Text | Error Description |
---|---|---|
127, 143, 144, 186, 187, 188 | Depends on error code | For details of an error code, see API Error Codes Reference section. |
Example code
# luna-send -f -i luna://com.webos.service.bluetooth2/avrcp/supplyMediaMetaData '{
"requestId":"001",
"metaData":{
"title":"let it go",
"artist":"demi lovato",
"album":"disney frozen",
"genre":"pop",
"trackNumber":1,
"trackCount":3,
"duration":225
}
}'
Response:
{
"requestId":"001",
"adapterAddress":"00:00:c5:99:f5:87",
"returnValue":true
}
API level 11
Supplies media play status of the target to remote devices connected via AVRCP 1.3 profile.
Name | Required | Type | Description |
---|---|---|---|
requestId | Required | String | The unique ID of a request. The format of requestId is "nnn", a three-digit number. |
playbackStatus | Required | Object: bluetooth2PlayStatus | The information about play status of the media. |
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
adapterAddress | Optional | String | Indicates the address of the adapter. |
requestId | Optional | String | The unique ID of a request. The format of requestId is "nnn", a three-digit number. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
errorCode | Optional | Number | The error code for the failed operation. |
Error Code | Error Text | Error Description |
---|---|---|
127, 143, 144, 186, 187, 188 | Depends on error code | For details of an error code, see the API Error Codes Reference section. |
Example code
# luna-send -f -n 1 luna://com.webos.service.bluetooth2/avrcp/supplyMediaPlayStatus '{
"requestId":"001",
"playbackStatus":{
"duration":225,
"position":100,
"status":"playing"
}
}'
Response:
{
"requestId":"001",
"adapterAddress":"00:00:c5:99:f5:87",
"returnValue":true
}
API level 12
Gets the newly discovered Bluetooth device information known to the system.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
subscribe | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
subscribed | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
adapterAddress | Required | String | Indicates the address of the adapter. |
device | Required | Object: bluetooth2DeviceStatus | Contains the status information of a newly discovered device known to the system. |
Name | Required | Type | Description |
---|---|---|---|
subscribed | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation |
errorText | Optional | String | Indicates the reason for the failure of the operation |
adapterAddress | Required | String | Indicates the address of the adapter. |
device | Required | Object: bluetooth2DeviceStatus | Contains the status information of a newly discovered device known to the system. |
Error Code | Error Text | Error Description |
---|---|---|
101, 143, 144 | See API Error Codes Reference | See API Error Codes Reference |
Example scenario
# luna-send -i -f luna://com.webos.service.bluetooth2/device/getDiscoveredDevice '{
"subscribe":true
}'
Response:
{
"device":{
"serviceClasses":[
],
"trusted":false,
"connectedProfiles":[
],
"scanRecord":[
],
"pairing":false,
"rssi":-74,
"name":"CC-6E-A4-C2-C8-39",
"address":"cc:6e:a4:c2:c8:39",
"paired":false,
"typeOfDevice":"ble",
"manufacturerData":{
"companyId":[
0,
117
],
"data":[
66,
4,
1,
1,
6,
204,
110,
164,
194,
200,
57,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0
]
},
"adapterAddress":"5c:f3:70:97:5d:66",
"classOfDevice":0,
"blocked":false
},
"returnValue":true
}
API level 12
Gets a list of paired Bluetooth devices info, known to the system.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
subscribe | Required | String | Indicates if subscribed to get notifications. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
subscribed | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation |
errorText | Optional | String | Indicates the reason for the failure of the operation |
adapterAddress | Required | String | Indicates the address of the adapter. |
devices | Required | Object array: bluetooth2DeviceStatus | Contains the status information of paired devices known to the system. |
Name | Required | Type | Description |
---|---|---|---|
subscribed | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation |
errorText | Optional | String | Indicates the reason for the failure of the operation |
adapterAddress | Required | String | Indicates the address of the adapter. |
devices | Required | Object array: bluetooth2DeviceStatus | Contains the status information of paired devices known to the system. |
Error Code | Error Text | Error Description |
---|---|---|
101, 143, 144 | See API Error Codes Reference | See API Error Codes Reference |
Example scenario
# luna-send -i -f luna://com.webos.service.bluetooth2/device/getPairedDevices '{
"subscribe":true
}'
Response:
{
"returnValue":true,
"devices":[
{
"serviceClasses":[
{
"mnemonic":"OPP",
"category":"/opp"
},
{
"mnemonic":"A2DP-source",
"category":"/a2dp"
},
{
"mnemonic":"AVRCP-target",
"category":"/avrcp"
},
{
"mnemonic":"AVRCP-remote",
"category":"/avrcp"
},
{
"mnemonic":"HSP-AG"
},
{
"mnemonic":"NAP",
"category":"/pan"
},
{
"mnemonic":"HFP-AG",
"category":"/hfp"
},
{
"mnemonic":"PSE"
},
{
"mnemonic":"MAS",
"category":"/map"
},
{
"mnemonic":"PNP"
},
{
"mnemonic":"GAP"
},
{
"mnemonic":"GATT",
"category":"/gatt"
}
],
"trusted":false,
"connectedProfiles":[
],
"scanRecord":[
],
"pairing":false,
"rssi":-47,
"name":"hello",
"address":"00:57:c1:34:54:c7",
"paired":true,
"typeOfDevice":"bredr",
"manufacturerData":{
},
"adapterAddress":"5c:f3:70:97:5d:66",
"classOfDevice":5898764,
"blocked":false
}
]
}
API level 11
Gets the current status of remote Bluetooth devices known to the system.
Name | Required | Type | Description |
---|---|---|---|
subscribe | Optional | Boolean | Subscribe to this method if you require notifications about any changes in its response Possible values are:
|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
Name | Required | Type | Description |
---|---|---|---|
subscribed | Required | Boolean | Indicates status of subscription (check 'subscribe' parameter). |
returnValue | Required | Boolean | Indicates status of method execution. Possible values are:
|
adapterAddress | Required | String | Indicates the address of the adapter. |
devices | Required | Object array: bluetooth2DeviceStatus | Contains status information of all the devices known to the system, not just the ones whose status has been changed. |
Name | Required | Type | Description |
---|---|---|---|
subscribed | Required | Boolean | Indicates status of subscription (check 'subscribe' parameter). |
returnValue | Required | Boolean | Indicates status of method execution. |
adapterAddress | Required | String | Indicates the address of the adapter. |
devices | Required | Object array: bluetooth2DeviceStatus | Contains the status information of all the devices known to the system, and not just the ones whose status has been changed. |
Error Code | Error Text | Error Description |
---|---|---|
101, 143, 144, 162 | Depends on error code | For details of specific error code, see the 'API Error codes Reference' table |
Example: To get the list of all devices
# luna-send -i -f luna://com.webos.service.bluetooth2/device/getStatus '{}'
Response:
{
"subscribed":false,
"adapterAddress":"00:1a:7d:da:71:0a",
"returnValue":true,
"devices":[
{
"serviceClasses":[
{
"mnemonic":"OPP",
"category":"/opp"
},
{
"mnemonic":"A2DP-source",
"category":"/a2dp"
},
{
"mnemonic":"AVRCP-target",
"category":"/avrcp"
},
{
"mnemonic":"AVRCP-remote",
"category":"/avrcp"
},
{
"mnemonic":"HSP-AG"
},
{
"mnemonic":"PANU",
"category":"/pan"
},
{
"mnemonic":"NAP",
"category":"/pan"
},
{
"mnemonic":"HFP-AG",
"category":"/hfp"
},
{
"mnemonic":"PSE"
},
{
"mnemonic":"PNP"
},
{
"mnemonic":"MAS"
}
],
"trusted":false,
"connectedProfiles":[
],
"scanRecord":[
],
"pairing":false,
"rssi":-87,
"name":"OPPO A83(2018)",
"address":"e4:c4:83:ba:a0:00",
"paired":false,
"typeOfDevice":"bredr",
"manufacturerData":{
},
"adapterAddress":"",
"classOfDevice":5898764,
"blocked":false
},
{
"serviceClasses":[
],
"trusted":false,
"connectedProfiles":[
],
"scanRecord":[
22,
4,
248,
107,
3
],
"pairing":false,
"rssi":-85,
"name":"Charge 2",
"address":"d1:70:e8:cb:48:8a",
"paired":false,
"typeOfDevice":"ble",
"manufacturerData":{
},
"adapterAddress":"",
"classOfDevice":0,
"blocked":false
},
{
"serviceClasses":[
{
"mnemonic":"A2DP-source",
"category":"/a2dp"
},
{
"mnemonic":"AVRCP-target",
"category":"/avrcp"
},
{
"mnemonic":"AVRCP-remote",
"category":"/avrcp"
},
{
"mnemonic":"PNP"
}
],
"trusted":false,
"connectedProfiles":[
],
"scanRecord":[
],
"pairing":false,
"rssi":-99,
"name":"[LG] webOS TV WEBOS5.0",
"address":"20:3d:bd:de:49:51",
"paired":false,
"typeOfDevice":"bredr",
"manufacturerData":{
},
"adapterAddress":"",
"classOfDevice":533564,
"blocked":false
},
{
"serviceClasses":[
{
"mnemonic":"OPP",
"category":"/opp"
},
{
"mnemonic":"A2DP-source",
"category":"/a2dp"
},
{
"mnemonic":"AVRCP-target",
"category":"/avrcp"
},
{
"mnemonic":"AVRCP-remote",
"category":"/avrcp"
},
{
"mnemonic":"HSP-AG"
},
{
"mnemonic":"PANU",
"category":"/pan"
},
{
"mnemonic":"NAP",
"category":"/pan"
},
{
"mnemonic":"HFP-AG",
"category":"/hfp"
},
{
"mnemonic":"SAP"
},
{
"mnemonic":"PSE"
},
{
"mnemonic":"PNP"
},
{
"mnemonic":"MAS"
}
],
"trusted":false,
"connectedProfiles":[
],
"scanRecord":[
],
"pairing":false,
"rssi":-78,
"name":"Redmi N4",
"address":"f4:f5:db:bb:b2:88",
"paired":false,
"typeOfDevice":"bredr",
"manufacturerData":{
},
"adapterAddress":"",
"classOfDevice":5898764,
"blocked":false
}
]
}
Example: To get information of a particular device
# luna-send -i -f luna://com.webos.service.bluetooth2/device/getStatus '{}' | grep "LG HBS730" -C 10
Response:
{
"serviceClasses":[
{
"mnemonic":"A2DP-sink",
"category":"/a2dp"
},
{
"mnemonic":"AVRCP-remote",
"category":"/avrcp"
},
{
"mnemonic":"HFP-HF",
"category":"/hfp"
},
{
"mnemonic":"HSP-HS"
}
],
"trusted":false,
"connectedProfiles":[
],
"scanRecord":[
],
"pairing":false,
"rssi":-44,
"name":"LG HBS730",
"address":"00:18:6b:4e:47:03",
"paired":false,
"typeOfDevice":"unknown",
"manufacturerData":{
},
"adapterAddress":"",
"classOfDevice":2360324,
"blocked":false
}
API level 11
Sets the local values for the state of a remote device.
Name | Required | Type | Description |
---|---|---|---|
address | Required | String | Indicates the address (bdaddr) of the remote device. |
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
trusted | Optional | Boolean | Indicates whether to set a remote device as a trusted device. Possible values are:
|
blocked | Optional | Boolean | Indicates whether to block (if set) or unblock (if reset) a remote device for pairing and profile connections. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
adapterAddress | Required | String | Indicates the address of the adapter. |
Error Code | Error Text | Error Description |
---|---|---|
5, 6, 101, 105, 106, 143, 144, 148, 149 | Depends on error code | For details of specific error code, see the 'API Error codes Reference' table. |
Example code
# luna-send -f -n 1 luna://com.webos.service.bluetooth2/device/setState '{
"address":"34:4d:f7:f9:52:f7",
"trusted":true
}'
Response:
{
"returnValue":true
}
API level 11
Adds a new service definition to the local database.
Note: The new service will be directly exposed to clients which are discovering available services.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
service | Required | String | Indicates the unique identifier of the service. |
type | Required | String | Indicates the type of the service. Possible values are:
|
includes | Required | String array | Indicates an array that contains a list of UUIDs the service includes. |
characteristics | Required | Object array: bluetooth2GattCharacteristicInfo | Indicates the information about GATT characteristics of the service. |
serverId | Optional | String | Indicates the server identifier to add the service to. Note: If not specified, the default value of serverId is used automatically. |
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Required | String | Indicates the address of the adapter. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
serverId | Required | String | Indicates the server identifier to add the service. |
Error Code | Error Text | Error Description |
---|---|---|
127,143,144,175,170 | See API Error Codes Reference | See API Error Codes Reference. |
Example code
# luna-send -f -n 1 luna://com.webos.service.bluetooth2/gatt/addService '{
"service":"6161",
"type":"primary",
"includes":[
],
"characteristics":[
{
"characteristic":"1a4ef224-f27a-11e4-b9b2-1697f925ec7b",
"properties":{
"broadcast":true,
"read":true,
"indicate":true,
"write":true,
"notify":true
},
"permissions":{
"read":true,
"write":true
},
"value":{
"bytes":[
34,
0,
12,
99
]
},
"descriptors":[
{
"descriptor":"f000ffc1-0451-4000-b000-000000000000",
"value":{
"bytes":[
0
]
}
}
]
}
]
}'
Response:
{
"adapterAddress":"00:00:68:64:d1:30",
"returnValue":true,
"serverId":"006"
}
API level 11
Closes the BluetoothGattServer.
Name | Required | Type | Description |
---|---|---|---|
serverId | Required | String | Indicates the unique identifier of a server to remove on the stack. |
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
adapterAddress | Required | String | Indicates the address of the adapter. Note: If not specified, the address of the default adapter will be used. |
errorCode | Optional | String | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. |
Error Code | Error Text | Error Description |
---|---|---|
144 | See "API Error Codes Reference" | See the "API Error Codes Reference" section. |
279 | GATT remove server failed | The GATT connection with the remote Bluetooth device could not be closed. |
Example code
# luna-send -f -n 1 luna://com.webos.service.bluetooth2/gatt/closeServer '{
"serverId":"001"
}'
Response:
{
"adapterAddress":"00:00:9a:1d:89:5d",
"returnValue":true
}
Example: Close gatt server for specified adapter address
# luna-send -f -n 1 luna://com.webos.service.bluetooth2/gatt/closeServer '{
"adapterAddress":"b8:27:eb:06:e3:70",
"serverId":"002"
}'
Response:
{
"adapterAddress":"b8:27:eb:06:e3:70",
"returnValue":true
}
API level 11
Connects to the GATT profile on the specified remote device.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
address | Required | String | Indicates the address of the remote device. |
subscribe | Optional | Boolean | Indicates if subscribed to get the notifications. Possible values are:
Default: false Note: Disconnection can also happen when local adapter calls the gatt/disconnect method (initiated by the local user) |
autoConnect | Optional | Boolean | Indicates if the remote device is automatically connected. Possible values are:
Default: false |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
adapaterAddress | Required | String | Indicates the address of the adapter. |
address | Required | String | Indicates the address of the remote device. |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
clientId | Required | String | Indicates the unique ID of a remote device, which has the following format: "nnn", 3 digit number increasing sequentially. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
Note: returnValue will always contain false, indicating that the remote device has closed the connection. |
adapaterAddress | Required | String | Indicates the address of the adapter. |
address | Required | String | Indicates the address of the remote device. |
subscribed | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
Note: subscribed will always contain false, indicating that the service will not send any further subscription responses. |
disconnectByRemote | Optional | Boolean | Indicates if the remote device or the local user initiated the disconnect. Possible values are:
|
Error Code | Error Text | Error Description |
---|---|---|
102, 105, 106, 127, 143, 144 | See API Error Codes Reference | See API Error Codes Reference |
Example code
# luna-send -f -n 1 luna://com.webos.service.bluetooth2/gatt/connect '{
"address":"f6:04:af:d2:87:32"
}'
Response:
{
"address":"f6:04:af:d2:87:32",
"clientId":"007",
"subscribed":false,
"adapterAddress":"00:00:68:64:d1:30",
"returnValue":true
}
Response for a failed call:
{
"errorCode":130,
"returnValue":false,
"errorText":"Failed to connect with remote device"
}
API level 11
Drops the connection to the given remote device on GATT profile.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
clientId | Required | String | Indicates the unique identifier of the remote device. Format: "nnn", 3 digit number increasing sequentially. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
adapterAddress | Required | String | Indicates the address of the adapter. |
address | Required | String | Indicates the address of the remote device. |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
102, 105, 106, 127, 143, 144 | See API Error Codes Reference | See API Error Codes Reference. |
Example: Device connected to the profile
# luna-send -f -n 1 luna://com.webos.service.bluetooth2/gatt/disconnect '{
"clientId":"002"
}'
Response:
{
"adapterAddress":"00:00:68:64:d1:30",
"clientId":"002",
"returnValue":true
}
Example: Device not connected to the profile
# luna-send -f -n 1 luna://com.webos.service.bluetooth2/gatt/disconnect '{
"clientId":"002"
}'
Response:
{
"errorCode":136,
"returnValue":false,
"errorText":"Device is not connected to profile"
}
API level 11
Discovers available services for the given remote device.
Pre-requisite:
Note:
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
address | Optional | String | Indicates the address of the remote device. |
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Required | String | Indicates the address of the adapter. |
address | Optional | String | Indicates the address of the remote device. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
102, 105, 106, 127, 143, 144 | See API Error Codes Reference | See API Error Codes Reference. |
Example code
# luna-send -f -n 1 luna://com.webos.service.bluetooth2/gatt/discoverServices '{
"address":"f6:04:af:d2:87:32"
}'
Response:
{
"adapterAddress":"00:00:68:64:d1:30",
"address":"f6:04:af:d2:87:32",
"returnValue":true
}
Response for a failed call:
{
"errorCode":136,
"returnValue":false,
"errorText":"Device is not connected to profile"
}
API level 11
Gets available services for either the given local Bluetooth adapter or remote device.
Note:
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Required | String | Indicates the address of the adapter. Note:
|
address | Required | String | Indicates the address of the remote device. |
subscribe | Optional | Boolean | Indicates if subscribed to get notifications. Possible values are:
Default: false |
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Required | String | Indicates the address of the adapter. |
address | Required | String | Indicates the address of the remote device. |
services | Required | Object array: bluetooth2GattServiceInfo | Indicates the list of the available services. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
subscribed | Optional | Boolean | Indicates if subscribed to get the notifications. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Required | String | Indicates the address of the adapter. |
address | Required | String | Indicates the address of the remote device. |
services | Required | Object: bluetooth2GattServiceInfo | Indicates the list of the available services. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
subscribed | Optional | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
127,144,162,169,106,136 | See API Error Codes Reference | See API Error Codes Reference. |
Example code
# luna-send -f -n 1 luna://com.webos.service.bluetooth2/gatt/getServices '{
"address":"f6:04:af:d2:87:32"
}'
Response:
{
"adapterAddress":"00:00:68:64:d1:30",
"address":"f6:04:af:d2:87:32",
"returnValue":true,
"services":[
{
"characteristics":[
{
"permissions":{
},
"properties":{
"notify":false,
"read":true,
"writeWithoutResponse":false,
"indicate":false,
"authenticatedSignedWrites":false,
"write":false,
"broadcast":false,
"extendedProperties":false
},
"characteristic":"00002a00-0000-1000-8000-00805f9b34fb",
"value":{
"bytes":[
]
},
"descriptors":[
]
},
{
"permissions":{
},
"properties":{
"notify":false,
"read":true,
"writeWithoutResponse":false,
"indicate":false,
"authenticatedSignedWrites":false,
"write":false,
"broadcast":false,
"extendedProperties":false
},
"characteristic":"00002a01-0000-1000-8000-00805f9b34fb",
"value":{
"bytes":[
]
},
"descriptors":[
]
},
{
"permissions":{
},
"properties":{
"notify":false,
"read":true,
"writeWithoutResponse":false,
"indicate":false,
"authenticatedSignedWrites":false,
"write":false,
"broadcast":false,
"extendedProperties":false
},
"characteristic":"00002a04-0000-1000-8000-00805f9b34fb",
"value":{
"bytes":[
]
},
"descriptors":[
]
}
],
"service":"00001800-0000-1000-8000-00805f9b34fb",
"type":"primary",
"includes":[
]
},
{
"characteristics":[
],
"service":"00001801-0000-1000-8000-00805f9b34fb",
"type":"primary",
"includes":[
]
},
{
"characteristics":[
{
"permissions":{
},
"properties":{
"notify":true,
"read":true,
"writeWithoutResponse":false,
"indicate":false,
"authenticatedSignedWrites":false,
"write":false,
"broadcast":false,
"extendedProperties":false
},
"characteristic":"adabfb01-6e7d-4601-bda2-bffaa68956ba",
"value":{
"bytes":[
]
},
"descriptors":[
{
"permissions":{
},
"value":{
"bytes":[
]
},
"descriptor":"00002902-0000-1000-8000-00805f9b34fb"
}
]
},
{
"permissions":{
},
"properties":{
"notify":false,
"read":true,
"writeWithoutResponse":true,
"indicate":false,
"authenticatedSignedWrites":false,
"write":false,
"broadcast":false,
"extendedProperties":false
},
"characteristic":"adabfb02-6e7d-4601-bda2-bffaa68956ba",
"value":{
"bytes":[
]
},
"descriptors":[
]
}
],
"service":"adabfb00-6e7d-4601-bda2-bffaa68956ba",
"type":"primary",
"includes":[
]
},
{
"characteristics":[
{
"permissions":{
},
"properties":{
"notify":true,
"read":true,
"writeWithoutResponse":false,
"indicate":false,
"authenticatedSignedWrites":false,
"write":false,
"broadcast":false,
"extendedProperties":false
},
"characteristic":"558dfa01-4fa8-4105-9f02-4eaa93e62980",
"value":{
"bytes":[
]
},
"descriptors":[
{
"permissions":{
},
"value":{
"bytes":[
]
},
"descriptor":"00002902-0000-1000-8000-00805f9b34fb"
}
]
}
],
"service":"558dfa00-4fa8-4105-9f02-4eaa93e62980",
"type":"primary",
"includes":[
]
},
{
"characteristics":[
{
"permissions":{
},
"properties":{
"notify":false,
"read":true,
"writeWithoutResponse":false,
"indicate":false,
"authenticatedSignedWrites":false,
"write":false,
"broadcast":false,
"extendedProperties":false
},
"characteristic":"00002a29-0000-1000-8000-00805f9b34fb",
"value":{
"bytes":[
]
},
"descriptors":[
{
"permissions":{
},
"value":{
"bytes":[
]
},
"descriptor":"00002904-0000-1000-8000-00805f9b34fb"
}
]
},
{
"permissions":{
},
"properties":{
"notify":false,
"read":true,
"writeWithoutResponse":false,
"indicate":false,
"authenticatedSignedWrites":false,
"write":false,
"broadcast":false,
"extendedProperties":false
},
"characteristic":"0000fb00-0000-1000-8000-00805f9b34fb",
"value":{
"bytes":[
]
},
"descriptors":[
]
}
],
"service":"0000180a-0000-1000-8000-00805f9b34fb",
"type":"primary",
"includes":[
]
},
{
"characteristics":[
{
"permissions":{
},
"properties":{
"notify":true,
"read":true,
"writeWithoutResponse":false,
"indicate":false,
"authenticatedSignedWrites":false,
"write":false,
"broadcast":false,
"extendedProperties":false
},
"characteristic":"00002a19-0000-1000-8000-00805f9b34fb",
"value":{
"bytes":[
]
},
"descriptors":[
{
"permissions":{
},
"value":{
"bytes":[
]
},
"descriptor":"00002902-0000-1000-8000-00805f9b34fb"
}
]
}
],
"service":"0000180f-0000-1000-8000-00805f9b34fb",
"type":"primary",
"includes":[
]
}
]
}
Response for a failed call:
{
"errorCode":136,
"returnValue":false,
"errorText":"Device is not connected to profile"
}
API level 11
Returns the status of GATT connection to the given remote device.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
address | Required | String | Indicates the address of the remote device. |
subscribe | Optional | Boolean | Indicates if subscribed to get the notifications. Possible values are:
Default: false |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
adapterAddress | Required | String | Indicates the address of the adapter. |
address | Required | String | Indicates the address of the remote device. |
connecting | Required | Boolean | Indicates if the connection request is currently being processed. Possible values are:
|
connected | Required | Boolean | Indicates if the connection is open. Possible values are:
|
discoveringServices | Required | Boolean | Indicates if the discovery service request is currently being processed for the given remote device. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
subscribed | Required | Boolean | Indicates if subscribed to get the notifications. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
Note: returnValue will contain true until the final response is sent by the service before stopping. |
adapterAddress | Required | String | Indicates the address of the adapter. |
address | Required | String | Indicates the address of the remote device. |
connecting | Required | String | Indicates if the connection request is currently being processed. Possible values are:
|
connected | Required | Boolean | Indicates if the connection is open. Possible values are:
|
discoveringServices | Required | Boolean | Indicates if the discovery service request is currently being processed for the given remote device. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
subscribed | Required | Boolean | Indicates if subscribed to get the notifications. Possible values are:
|
Error Code | Error Text | Error Description |
---|---|---|
102, 105, 106, 127, 143, 144 | See API Error Codes Reference | See API Error Codes Reference. |
Example code
# luna-send -f -n 1 luna://com.webos.service.bluetooth2/gatt/getStatus '{
"address":"f6:04:af:d2:87:32"
}'
Response:
{
"discoveringServices":false,
"adapterAddress":"00:00:68:64:d1:30",
"address":"f6:04:af:d2:87:32",
"connected":false,
"subscribed":false,
"returnValue":true,
"connecting":false
}
API level 11
Monitors specific characteristic value changes.
Note:
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
service | Optional | String | Indicates the UUID of the service the characteristic belongs to. Note: Either this and characteristic, or instanceId is required. |
characteristic | Optional | String | Indicates the UUID of the characteristic to be monitored. Note: Either this and service, or instanceId is required. |
InstanceId | Optional | String | Indicates the unique identifier of a characteristic to monitored, which has the following format: "nnn". Note: Either this, or service and characteristic are required. |
serverId | Optional | String | Indicates the identifier of server to get the characteristic from.
|
clientId | Optional | String | Indicates the identifier of the remote device (client) to get the characteristic from.
|
subscribe | Optional | Boolean | Indicates if subscribed to get notifications. Possible values are:
Note: Must set subscribe to true. |
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Required | String | Indicates the address of the adapter. |
address | Optional | String | Indicates the address of the remote. |
subscribed | Optional | Boolean | Indicates if subscribed to get the notifications. Possible values are:
|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
errorCode | Optional | String | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
subscribed | Required | Boolean | Indicates if subscribed to get the notifications. Possible values are:
|
adapterAddress | Required | String | Indicates the address of the adapter. |
address | Optional | String | Indicates the address of the remote device. |
changed | Required | Object: bluetooth2GattCharacteristicValueInfo | Indicates the object containing the information about the characteristic uuid and value. |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
105, 106, 127, 136, 143 , 144, 105, 162, 163, 166, 173, 176, 177 | See API Error Codes Reference | See the "API Error Codes Reference" section. |
Example code
# luna-send -f -i luna://com.webos.service.bluetooth2/gatt/monitorCharacteristic '{
"clientId":"007",
"service":"7905f431-b5ce-4e99-a40f-4b1e122d00d0",
"characteristic":"9fbf120d-6301-42d9-8c58-25e699a21dbd",
"subscribe":true
}'
Response:
{
"address":"79:ef:2d:a8:31:2c",
"subscribed":true,
"adapterAddress":"00:00:68:64:d1:30",
"returnValue":true
}
Subscription response:
{
"changed":{
"characteristic":"9fbf120d-6301-42d9-8c58-25e699a21dbd",
"value":{
"bytes":[
0,
21,
0,
1,
0,
0,
0,
0
]
}
},
"address":"79:ef:2d:a8:31:2c",
"subscribed":true,
"adapterAddress":"00:00:68:64:d1:30",
"returnValue":true
}
API level 11
Monitors specific characteristic value changes.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
service | Required | String | Indicates the UUID of the service to which the characteristic belongs to. |
characteristics | Required | String array | Indicates an array of strings where each string is a UUID of a characteristic to be monitored. |
subscribe | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
serverId | Optional | String | Indicates the identifier of the server to get the characteristic from. Note:
|
clientId | Optional | String | Indicates the identifier of the remote device (client) to get the characteristics from. Note:
|
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Required | String | Indicates the address of the adapter. |
address | Optional | String | Indicates the address of the remote device. |
subscribed | Required | Boolean | Indicates if subscribed to get the notifications. Possible values are:
|
returnValue | Required | String | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
subscribed | Required | Boolean | Indicates if subscribed to get the notifications. Possible values are:
|
adapterAddress | Required | String | Indicates the address of the adapter the operation was performed on. |
address | Optional | String | Indicates the address of the remote device. |
adapterAddress | Required | String | The address of the adapter the operation was performed on. Note: If adapterAddress input parameter was not specified, the address of the default adapter will be returned. |
changed | Required | Object: bluetooth2GattCharacteristicValueInfo | Object containing information about the characteristic uuid and values. |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
105, 106, 127, 136, 143 , 144, 105, 162, 163, 166, 173, 176, 177 | See API Error Codes Reference | See the "API Error Codes Reference" section. |
Example code
# luna-send -f -i luna://com.webos.service.bluetooth2/gatt/monitorCharacteristics '{
"clientId":"007",
"service":"7905f431-b5ce-4e99-a40f-4b1e122d00d0",
"characteristics":["9fbf120d-6301-42d9-8c58-25e699a21dbd"],
"subscribe":true
}'
Response:
{
"address":"79:ef:2d:a8:31:2c",
"subscribed":true,
"adapterAddress":"00:00:68:64:d1:30",
"returnValue":true
}
Subscription response:
{
"changed":{
"characteristic":"9fbf120d-6301-42d9-8c58-25e699a21dbd",
"value":{
"bytes":[
0,
21,
0,
1,
0,
0,
0,
0
]
}
},
"address":"79:ef:2d:a8:31:2c",
"subscribed":true,
"adapterAddress":"00:00:68:64:d1:30",
"returnValue":true
}
API level 11
Opens the BluetoothGattServer managing services.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
adapterAddress | Required | String | Indicates the address of the adapter. |
serverId | Required | String | Indicates the unique identifier of a server, which has the following format: "nnn", 3 digit number increasing sequentially. |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
Example code
# luna-send -f -n 1 luna://com.webos.service.bluetooth2/gatt/openServer '{}'
Response:
{
"adapterAddress":"00:00:9a:1d:89:5d",
"serverId":"001",
"returnValue":true
}
Example: Open gatt server with specified adapter address
# luna-send -f -n 1 luna://com.webos.service.bluetooth2/gatt/openServer '{
"adapterAddress":"b8:27:eb:06:e3:70"
}'
Response:
{
"adapterAddress":"b8:27:eb:06:e3:70",
"returnValue":true,
"serverId":"002"
}
API level 11
Reads the value of a specific characteristic.
Note:
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
service | Optional | String | Indicates the unique identifier of the service the characteristic belongs to. Note: Either this and characteristic, or instanceId is required. |
characteristic | Optional | String | Indicates the unique identifier of the characteristic to read. Note: Either this and service, or instanceId is required. |
instanceId | Optional | String | Indicates the unique ID of the characteristic to read, which has the following format: "nnn". Note: Either this, or service and characteristic are required. |
serverId | Optional | String | Indicates the identifier of server to get the characteristic from.
|
clientId | Optional | String | Indicates the identifier of the remote device (client) to get the characteristic from.
|
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Required | String | Indicates the address of the adapter. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
address | Optional | String | Indicates the address of the remote device. |
service | Required | String | Indicates the unique identifier of the service the characteristic belongs to. |
value | Required | Object: bluetooth2GattCharacteristicInfo | Indicates the value for requested characteristic. |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
106,127,136,143,144,162,163,166,173,174 | See API Error Codes Reference | See API Error Codes Reference. |
Example code
# luna-send -f -n 1 luna://com.webos.service.bluetooth2/gatt/readCharacteristicValue '{
"address":"b4:99:4c:64:be:fe",
"service":"f000aa00-0451-4000-b000-000000000000",
"characteristic":"f000aa01-0451-4000-b000-000000000000"
}'
Response:
{
"adapterAddress":"00:00:68:64:d1:30",
"address":"b4:99:4c:64:be:fe",
"returnValue":true,
"service":"f000aa00-0451-4000-b000-000000000000",
"value":{
"permissions":{
},
"properties":{
"notify":true,
"read":true,
"writeWithoutResponse":false,
"indicate":false,
"authenticatedSignedWrites":false,
"write":false,
"broadcast":false,
"extendedProperties":false
},
"characteristic":"f000aa01-0451-4000-b000-000000000000",
"value":{
"bytes":[
13,
255,
140,
12
]
},
"descriptors":[
{
"permissions":{
},
"value":{
"bytes":[
]
},
"descriptor":"00002901-0000-1000-8000-00805f9b34fb"
},
{
"permissions":{
},
"value":{
"bytes":[
]
},
"descriptor":"00002902-0000-1000-8000-00805f9b34fb"
}
]
}
}
API level 11
Reads the value of a specific characteristic.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
service | Required | String | Indicates the unique identifier of the service the characteristic belongs to. |
characteristics | Required | String array | Indicates the unique identifiers of the characteristics to read. |
serverId | Optional | String | Indicates the identifier of server to get the characteristic from. Note:
|
clientId | Optional | String | Indicates the identifier of the remote device (client) to get the characteristic from. Note:
|
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Required | String | Indicates the address of the adapter. |
address | Optional | String | Indicates the address of the remote device. |
service | Optional | String | Indicates the unique identifier of the service the characteristic belongs to. |
values | Optional | Object: bluetooth2GattCharacteristicInfo | Indicates the values of the characteristic. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
106,127,136,143,144,162,163,166,173,174 | See API Error Codes Reference | See API Error Codes Reference. |
Example code
# luna-send -f -n 1 luna://com.webos.service.bluetooth2/gatt/readCharacteristicValues '{
"clientId":"001",
"service":"f000aa00-0451-4000-b000-000000000000",
"characteristics":["f000aa01-0451-4000-b000-000000000000"]
}'
Response:
{
"adapterAddress":"00:00:68:64:d1:30",
"address":"b4:99:4c:64:be:fe",
"returnValue":true,
"service":"f000aa00-0451-4000-b000-000000000000",
"values":[
{
"permissions":{
},
"properties":{
"notify":true,
"read":true,
"writeWithoutResponse":false,
"indicate":false,
"authenticatedSignedWrites":false,
"write":false,
"broadcast":false,
"extendedProperties":false
},
"characteristic":"f000aa01-0451-4000-b000-000000000000",
"value":{
"bytes":[
13,
255,
140,
12
]
},
"descriptors":[
{
"permissions":{
},
"value":{
"bytes":[
]
},
"descriptor":"00002901-0000-1000-8000-00805f9b34fb"
},
{
"permissions":{
},
"value":{
"bytes":[
]
},
"descriptor":"00002902-0000-1000-8000-00805f9b34fb"
}
]
}
]
}
API level 11
Reads the value of descriptor of a service characteristic either in the local adapter or the remote device.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
service | Optional | String | Indicates the unique identifier of the service the characteristic belongs to. Note: Either this and characteristic and descriptor, or instanceId is required. |
characteristic | Optional | String | Indicates the unique identifier of the characteristic the descriptor belongs to. Note: Either this and service and descriptor, or instanceId is required. |
descriptor | Optional | String | Indicates the Uuid of descriptor. Note: Either this and service and characteristic, or instanceId is required. |
instanceId | Optional | String | Unique identifier of the descriptor to read, which has the following format: "nnn". Either this, or service and characteristic, descriptor are required. |
serverId | Optional | String | Indicates the identifier of server to get the descriptors from. Note:
|
clientId | Optional | String | Indicates the identifier of remote device (client) to get the descriptors from. Note:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
adapterAddress | Required | String | Indicates the address of the adapter. |
address | Optional | String | Indicates the address of the remote device. |
service | Required | String | Indicates the unique identifier of the service the descriptor belongs to. |
characteristic | Required | String | Indicates the unique identifier of the characteristic the descriptor belongs to. |
value | Required | Object: bluetooth2GattDescriptorInfo | Indicates the value for the requested descriptor. |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
106,127,136,143,144,162,163,166,173,174 | See API Error Codes Reference | See API Error Codes Reference. |
Example: Reading a descriptor value from the local adapter
# luna-send -f -n 1 luna://com.webos.service.bluetooth2/gatt/readDescriptorValue '{
"service":"f000aa40-0451-4000-b000-000000000000",
"characteristic":"f000aa41-0451-4000-b000-000000000000"
"descriptor":"00002902-0000-1000-8000-00805f9b34fc"
}'
Response:
{
"adapterAddress": "00:00:ba:87:d1:a7",
"characteristic": "f000aa41-0451-4000-b000-000000000000",
"returnValue": true,
"service": "f000aa40-0451-4000-b000-000000000000",
"value":
{
"permissions": {
},
"value": {
"bytes": [0, 0]
},
"descriptor": "00002902-0000-1000-8000-00805f9b34fb"
}
}
API level 11
Read the value of descriptor(s) of a service characteristic either in the local adapter or the remote device.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
service | Required | String | Indicates the unique identifier of the service the descriptor belongs to. |
characteristic | Required | String | Indicates the unique identifier of the characteristic the descriptor belongs to. |
descriptors | Required | String array | Indicates the array of descriptors UUIDs. |
serverId | Optional | String | Indicates the identifier of server to get the descriptors from. Note:
|
clientId | Optional | String | Indicates the identifier of the remote device (client) to get the descriptors from. Note:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
adapterAddress | Required | String | Indicates the address of the adapter. |
address | Optional | String | Indicates the address of the remote device. |
service | Required | String | Indicates the unique identifier of the service the descriptor belongs to. |
characteristic | Required | String | Indicates the unique identifier of the characteristic the descriptor belongs to. |
values | Required | Object array: bluetooth2GattDescriptorInfo | Indicates the values for requested descriptors. |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
Example: Reading a descriptor value from the local adapter
# luna-send -f -n 1 luna://com.webos.service.bluetooth2/gatt/readDescriptorValues '{
"serverId":"001",
"service":"f000aa40-0451-4000-b000-000000000000",
"characteristic":"f000aa41-0451-4000-b000-000000000000",
"descriptors":["00002902-0000-1000-8000-00805f9b34fc"]
}'
Response:
{
"adapterAddress": "00:00:ba:87:d1:a7",
"characteristic": "f000aa41-0451-4000-b000-000000000000",
"returnValue": true,
"service": "f000aa40-0451-4000-b000-000000000000",
"values": [
{
"permissions": {
},
"value": {
"bytes": [0, 0]
},
"descriptor": "00002902-0000-1000-8000-00805f9b34fb"
}
]
}
Example: Reading a descriptor value from the remote device
# luna-send -f -n 1 luna://com.webos.service.bluetooth2/gatt/readDescriptorValues '{
"clientId":"001",
"service":"f000aa40-0451-4000-b000-000000000000",
"characteristic":"f000aa41-0451-4000-b000-000000000000",
"descriptors":["00002902-0000-1000-8000-00805f9b34fb"]
}'
Response:
{
"adapterAddress": "00:00:ba:87:d1:a7",
"address": "b4:99:4c:64:30:46",
"characteristic": "f000aa41-0451-4000-b000-000000000000",
"returnValue": true,
"service": "f000aa40-0451-4000-b000-000000000000",
"values": [
{
"permissions": {
},
"value": {
"bytes": [0, 0]
},
"descriptor": "00002902-0000-1000-8000-00805f9b34fb"
}
]
}
API level 11
Remove a service definition from the local database. All characteristics which belong to the service will be also removed.
If the given service is included by another service, the method will fail.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
service | Required | String | Indicates the unique identifier of the service. |
serverId | Optional | String | Indicates the identifier of server to remove the service from. Note:
|
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Required | String | Indicates the address of the adapter. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Boolean | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
127,143,163,144,171 | See API Error Codes Reference | See API Error Codes Reference. |
Example code
# luna-send -f -n 1 luna://com.webos.service.bluetooth2/gatt/removeService '{
"service":"6161"
}'
Response:
{
"adapterAddress":"00:00:68:64:d1:30",
"returnValue":true
}
API level 11
Writes the value for a local or remote characteristic.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
service | Optional | String | Indicates the UUID of the service the characteristic belongs to. Note: Either this and service, or instanceId is required. |
characteristic | Optional | String | Indicates the UUID (unique identifier) of the characteristic. Note: Either this and service, or instanceId is required. |
instanceId | Optional | String | Indicates the unique identifier of the descriptors to read, which has the following format: "nnn". Note: Either this, or service and characteristic are required. |
value | Required | Object: bluetooth2GattValueInfo | Indicates the value of the characteristic. Note: A value can only have one type and depending on this type one of the fields "string", "number" or "bytes" should be passed. If multiple fields are passed, the method will fail. |
serverId | Optional | String | Indicates the identifier of server to get the characteristic from. Note:
|
clientId | Optional | String | Indicates the identifier of the remote device (client) to get the characteristic from. Note:
|
writeType | Optional | String | Indicates the writeType of the characteristic. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Required | String | Indicates the address of the adapter. |
address | Optional | String | Indicates the address of the remote device. |
returnValue | Optional | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
106,127,136,143,144,162,163,164,165,173,172,175 | See API Error Codes Reference | See API Error Codes Reference. |
Example code
# luna-send -f -n 1 luna://com.webos.service.bluetooth2/gatt/writeCharacteristicValue '{
"clientId":"001",
"service":"f000aa00-0451-4000-b000-000000000000",
"characteristic":"f000aa02-0451-4000-b000-000000000000",
"value":{"bytes":[1]}
}'
Response:
{
"adapterAddress":"00:00:68:64:d1:30",
"address":"b4:99:4c:64:be:fe",
"returnValue":true
}
API level 11
Writes the value of a specific descriptor of a service characteristic either in the local adapter or the remote device.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
service | Optional | String | Indicates the unique identifier of the service the descriptor belongs to. Note: Either this and characteristic and descriptor, or instanceId is required. |
characteristic | Optional | String | Indicates the unique identifier of the characteristic the descriptor belongs to. Note: Either this and service and descriptor, or instanceId is required. |
descriptor | Optional | String | Indicates the unique identifier of the descriptor. Note: Either this and service and characteristic, or instanceId is required. |
instanceId | Optional | String | Indicates the unique identifier of the descriptors to read, which has the following format: "nnn". Note: Either this, or service and characteristic are required. |
value | Required | Object: bluetooth2GattValueInfo | Indicates the value of the descriptor. Note:
|
serverId | Optional | String | Indicates the identifier of server to get the descriptor from. Note:
|
clientId | Optional | String | Indicates the identifier of the remote device (client) to get the descriptor from. Note:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
adapterAddress | Required | String | Indicates the address of the adapter. |
address | Optional | String | Indicates the address of the remote device. |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
Example: Writing a descriptor value in the remote device
# luna-send -f -n 1 luna://com.webos.service.bluetooth2/gatt/writeDescriptorValue '{
"clientId":"001",
"service":"f000aa40-0451-4000-b000-000000000000",
"characteristic":"f000aa41-0451-4000-b000-000000000000", "descriptor":"00002902-0000-1000-8000-00805f9b34fb",
"value":{"bytes":[1, 0]}
}'
Response:
{
"adapterAddress":"00:00:ba:87:d1:a7",
"returnValue":true
}
Example: Writing a descriptor value in the local adapter
# luna-send -f -n 1 luna://com.webos.service.bluetooth2/gatt/writeDescriptorValue '{
"serverId": "001",
"service":"1a4eeedc-f27a-11e4-b9b2-1697f925ec7b",
"characteristic":"1a4ef224-f27a-11e4-b9b2-1697f925ec7b",
"descriptor":"f000ffc1-0451-4000-b000-000000000000",
"value":{"bytes":[65,99,99,46,32,80,101,114,105,111,100]}
}'
Response:
{
"adapterAddress":"00:00:ba:87:d1:a7",
"returnValue":true
}
API level 12
Opens a HFP connection to a remote device.
Name | Required | Type | Description |
---|---|---|---|
address | Required | String | Indicates the address (bdaddr) of the remote device. |
subscribe | Optional | Boolean | Indicates if subscribed to get notifications. Possible values are:
Default: false |
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
subscribed | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
adapterAddress | Required | String | Indicates the address of the adapter. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
errorCode | Optional | Number | The error code for the failed operation. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | String | Indicates the status of the operation. Possible values are:
|
subscribed | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
disconnectByRemote | Required | Boolean |
|
adapterAddress | Required | String | Indicates the address of the adapter. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
errorCode | Optional | Number | The error code for the failed operation. |
Error Code | Error Text | Error Description |
---|---|---|
102, 103, 105, 106, 127, 143, 144 | See API Error Codes Reference | See API Error Codes Reference. |
128 | Device is already connecting | The remote Bluetooth device is already connecting to HFP profile, so another connection cannot be opened. |
129 | Device is not paired | The remote Bluetooth device is not paired, so HFP connection cannot be opened. |
130 | Failed to connect with remote device | The remote Bluetooth device cannot be connected to the HFP profile. |
131 | Already connected | The remote Bluetooth device is already connected to the adapter's FTP profile, so another connection cannot be opened. |
Example code
# luna-send -i -f luna://com.webos.service.bluetooth2/hfp/connect
{
"address":"34:4d:f7:f9:52:f7",
"subscribe":true
}
Response:
{
"returnValue":true,
"subscribed":false,
"adapterAddress":"00:00:45:0e:48:9b"
}
Subscription response:
{
"returnValue":true,
"subscribed":true,
"disconnectByRemote":false,
"adapterAddress":"00:00:45:0e:48:9b"
}
API level 12
Drops the connection to the given remote device on the HFP profile.
Name | Required | Type | Description |
---|---|---|---|
address | Required | String | Indicates the address (bdaddr) of the remote device. |
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
Name | Required | Type | Description |
---|---|---|---|
returnValues | Required | Boolean | Indicates the status of the operation. Possible values are:
|
adapterAddress | Required | String | Indicates the address of the adapter. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
errorCode | Optional | Number | The error code for the failed operation. |
Error Code | Error Text | Error Description |
---|---|---|
102, 105, 106, 127, 143, 144 | See API Error Codes Reference | See API Error Codes Reference. |
132 | Failed to disconnect from remote device | The HFP connection with the remote Bluetooth device could not be closed. |
Example code
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/hfp/disconnect'{
"address":"34:4d:f7:f9:52:f7"
}'
Response:
{
"returnValue":true,
"adapterAddress":"00:00:45:0e:48:9b"
}
API level 11
Returns the status of a HFP connection to a remote device.
If address input parameter is not specified, the method will return the information of the device whose connection status has been changed.
Name | Required | Type | Description |
---|---|---|---|
address | Required | String | Indicates the address (bdaddr) of the remote device. |
subscribe | Optional | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
subscribed | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
connecting | Required | Boolean | Indicates if the connection request is currently being processed. Possible values are:
|
connected | Required | Boolean | Indicates if the connection is open. Possible values are:
|
sco | Required | Boolean | Indicates the status of the SCO connection. Possible values are:
|
adapterAddress | Required | String | Indicates the address of the adapter. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
errorCode | Optional | Number | The error code for the failed operation. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
subscribed | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
connecting | Required | Boolean | Indicates if the connection request is currently being processed. Possible values are:
|
connected | Required | Boolean | Indicates if the connection is open. Possible values are:
|
sco | Required | Boolean | Indicates the status of the SCO connection. Possible values are:
|
adapterAddress | Required | String | Indicates the address of the adapter. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
errorCode | Optional | Number | The error code for the failed operation. |
Error Code | Error Text | Error Description |
---|---|---|
102, 105, 106, 127, 143, 144 | See API Error Codes Reference | See API Error Codes Reference. |
133 | Failed to retrieve state for remote device | The HFP connection status of the remote Bluetooth device cannot be retrieved. |
Example code
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/hfp/getStatus'{
"address":"34:4d:f7:f9:52:f7",
"subscribe":false
}'
Response:
{
"returnValue":true,
"subscribed":false,
"connecting":"fasle",
"connected":true,
"sco":true,
"adapterAddress":"00:00:45:0e:48:9b"
}
Subscription response:
{
"returnValue":true,
"subscribed":true,
"connecting":false,
"connected":true,
"sco":true,
"adapterAddress":"00:00:45:0e:48:9b"
}
API level 11
Starts scanning only dot ble devices.
Name | Required | Type | Description |
---|---|---|---|
address | Optional | String | MAC address |
subscribe | Required | Boolean | Subscribe for notifications on status of remote devices. Possible values are:
Default value: false |
name | Optional | String | Device name |
serviceUuid | Optional | Object: bluetooth2LeServiceUuidObject | Object containing information about a service uuid to be advertised |
serviceData | Optional | Object: bluetooth2LeServiceDataObject | Object containing information about a service data to be advertised |
manufacturerData | Optional | Object: bluetooth2LeManufacturerData | Object containing information about a manufacturer data |
advertisingType | Optional | Number | Advertising type |
Name | Required | Type | Description |
---|---|---|---|
subscribe | Required | Boolean | Indicates if subscribed to get notified.
|
returnValue | Required | Boolean | returnValue will always contain true unless the request for subscription fails. |
adapterAddress | Required | String | The address of the default adapter will be always returned. |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
Name | Required | Type | Description |
---|---|---|---|
subscribe | Required | Boolean | Indicates if subscribed to get notified.
|
returnValue | Required | Boolean | returnValue will always contain true unless the request for subscription fails. |
adapterAddress | Required | String | The address of the default adapter will be always returned. |
device | Required | Object array: bluetooth2DeviceStatus | devices will contain status information for all the devices known to the system, not just the ones whose status has been changed. |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
device | Required | Object: bluetooth2DeviceStatus | Contains status information of ONLY SINGLE DEVICE detected in scan environment during the le/startScan API call. The device is listed for following reasons:
|
Error Code | Error Text | Error Description |
---|---|---|
101,143,144 | See API Error Codes Reference | See the "API Error Codes Reference" section. |
Example code
Scan and list all the bluetoothLE devices with specified serviceUuid
# luna-send -f -i luna://com.webos.service.bluetooth2/le/internal/startScan '{
"subscribe":true,
"serviceUuid":{"uuid":"aaaaffe3-aaaa-1000-8000-00805f9b34fc"},
"advertisingType":38
}'
Response:
{
"subscribed": true,
"adapterAddress": "b8:27:eb:1b:4f:01",
"returnValue": true
}
Subscription Response: When nRF Connect Application advertisement button turned ON (Case when new device is detected in the scan environment)
{
"device": {
"serviceClasses": [
],
"trusted": false,
"connectedProfiles": [
],
"scanRecord": [
],
"pairing": false,
"rssi": -68,
"name": "Moto G (4)",
"address": "58:01:5f:a3:f7:f0",
"paired": false,
"typeOfDevice": "ble",
"manufacturerData": {
},
"adapterAddress": "",
"classOfDevice": 0,
"blocked": false
},
"returnValue": true,
"devices": [
{
"serviceClasses": [
],
"trusted": false,
"connectedProfiles": [
],
"scanRecord": [
],
"pairing": false,
"rssi": -68,
"name": "Moto G (4)",
"address": "58:01:5f:a3:f7:f0",
"paired": false,
"typeOfDevice": "ble",
"manufacturerData": {
},
"adapterAddress": "",
"classOfDevice": 0,
"blocked": false
}
]
}
Subscription Response: When the device property has changed [Note: In this case, rssi strength is effected].
{
"device": {
"serviceClasses": [
],
"trusted": false,
"connectedProfiles": [
],
"scanRecord": [
],
"pairing": false,
"rssi": -80,
"name": "Moto G (4)",
"address": "42:f9:06:f5:b3:86",
"paired": false,
"typeOfDevice": "ble",
"manufacturerData": {
},
"adapterAddress": "",
"classOfDevice": 0,
"blocked": false
},
"returnValue": true,
"devices": [
{
"serviceClasses": [
],
"trusted": false,
"connectedProfiles": [
],
"scanRecord": [
],
"pairing": false,
"rssi": -80,
"name": "Moto G (4)",
"address": "42:f9:06:f5:b3:86",
"paired": false,
"typeOfDevice": "ble",
"manufacturerData": {
},
"adapterAddress": "",
"classOfDevice": 0,
"blocked": false
},
{
"serviceClasses": [
],
"trusted": false,
"connectedProfiles": [
],
"scanRecord": [
],
"pairing": false,
"rssi": -68,
"name": "Moto G (4)",
"address": "58:01:5f:a3:f7:f0",
"paired": false,
"typeOfDevice": "ble",
"manufacturerData": {
},
"adapterAddress": "",
"classOfDevice": 0,
"blocked": false
}
]
}
API level 11
Starts broadcasting the Bluetooth Low Energy advertisement.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | The address of the adapter executing this method. If not specified, the default adapter will be used. |
subscribe | Required | Boolean | Since subscription ends only when the client chooses to close it, subscribed will always contain true. Multiple advertisement must set to true this value. |
settings | Optional | Object: bluetooth2AdvertiseSettings | Defines the format for advertiser setting parameters. |
advertiseData | Optional | Object: bluetooth2AdvertiseData | Defines the format for scan request data parameters. |
scanResponse | Optional | Object: bluetooth2AdvertiseData | Defines the format for scan response data parameters. |
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Required | String | The address of the adapter the operation was performed on. If adapterAddress input parameter was not specified, the address of the default adapter will be returned. |
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
advertiserId | Required | Number | The handle ID of a specific advertiser. Multiple advertisement can update with this value. |
Error Code | Error Text | Error Description |
---|---|---|
1, 101 | See API Codes Reference | See API Error Codes Reference. |
Example code
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/le/startAdvertising '{
"subscribe":true,
"advertiseData":
{
"manufacturerData":[1,2,3,4],
"proprietaryData":[{"type":27,"data":[5,6,7,8]}],
"includeTxPower":true,
"services":[{"uuid":"aada","data":[7,8,9,0]}],
"includeName":false
}
}'
Example response for successful call:
{
"adapterAddress": "00:00:9a:1d:89:5d",
"advertiserId": 1234,
"subscribed": true,
"returnValue": true
}
Example response for a failed call: if default adapter is not valid.
{
"adapterAddress": "00:00:9a:1d:89:5d",
"returnValue": false
"errorCode": 101
"errorText": "Bluetooth adapter is not available"
}
Subscription return: If advertiser cancel subscription ,
{
"adapterAddress": "00:00:9a:1d:89:5d,
"advertiserId": 1234,
"subscribed": false,
"returnValue": true
}
API level 11
Starts scanning only ble devices.
Name | Required | Type | Description |
---|---|---|---|
address | Optional | String | Indicates the MAC address. |
subscribe | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
Default: false |
name | Optional | String | Indicates the name of the device. |
serviceUuid | Optional | Object: bluetooth2LeServiceUuidObject | Object containing information about the serviceUuid to be advertised. |
serviceData | Optional | Object: bluetooth2LeServiceDataObject | Object containing information about a serviceData to be advertised. |
manufacturerData | Optional | Object: bluetooth2LeManufacturerData | Object containing information about a manufacturerData. |
adapterAddress | Optional | String | Indicates the address of the adapter. Note: If not specified, the address of the default adapter will be used. |
Name | Required | Type | Description |
---|---|---|---|
subscribed | Required | Boolean | Indicates if subscribed to get notifications.
|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
Note: returnValue will always contain true unless the request for subscription fails. |
adapterAddress | Required | String | Indicates the address of the adapter. Note: If not specified, the address of the default adapter will be returned. |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
Name | Required | Type | Description |
---|---|---|---|
subscribed | Required | Boolean | Indicates if subscribed to get notifications.
|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
Note: returnValue will always contain true unless the request for subscription fails. |
adapterAddress | Required | String | Indicates the address of the adapter. Note: If not specified, the address of the default adapter will be returned. |
devices | Required | Object array: bluetooth2DeviceStatus | Contains status information for all the devices known to the system. Note: The object includes information about devices who status have been changed/unchanged. |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
device | Required | Object: bluetooth2DeviceStatus | Contains status information of only a single device detected in scan environment during the le/startScan API call. The device is listed for following reasons:
|
Error Code | Error Text | Error Description |
---|---|---|
101,143,144 | See API Error Codes Reference | See the "API Error Codes Reference" section. |
Example: Scan and list all the bluetoothLE devices with specified serviceUuid
# luna-send -f -i luna://com.webos.service.bluetooth2/le/startScan '{
"subscribe":true,
"serviceUuid":{"uuid":"aaaaffe3-aaaa-1000-8000-00805f9b34fc"}
}'
Response:
{
"subscribed": true,
"adapterAddress": "b8:27:eb:1b:4f:01",
"returnValue": true
}
Subscription response: When nRF Connect Application advertisement button turned ON (Case when new device is detected in the scan environment)
{
"device": {
"serviceClasses": [
],
"trusted": false,
"connectedProfiles": [
],
"scanRecord": [
],
"pairing": false,
"rssi": -68,
"name": "Moto G (4)",
"address": "58:01:5f:a3:f7:f0",
"paired": false,
"typeOfDevice": "ble",
"manufacturerData": {
},
"adapterAddress": "",
"classOfDevice": 0,
"blocked": false
},
"returnValue": true,
"devices": [
{
"serviceClasses": [
],
"trusted": false,
"connectedProfiles": [
],
"scanRecord": [
],
"pairing": false,
"rssi": -68,
"name": "Moto G (4)",
"address": "58:01:5f:a3:f7:f0",
"paired": false,
"typeOfDevice": "ble",
"manufacturerData": {
},
"adapterAddress": "",
"classOfDevice": 0,
"blocked": false
}
]
}
Subscription response: When the device property has changed [Note: In this case, rssi strength is effected].
{
"device": {
"serviceClasses": [
],
"trusted": false,
"connectedProfiles": [
],
"scanRecord": [
],
"pairing": false,
"rssi": -80,
"name": "Moto G (4)",
"address": "42:f9:06:f5:b3:86",
"paired": false,
"typeOfDevice": "ble",
"manufacturerData": {
},
"adapterAddress": "",
"classOfDevice": 0,
"blocked": false
},
"returnValue": true,
"devices": [
{
"serviceClasses": [
],
"trusted": false,
"connectedProfiles": [
],
"scanRecord": [
],
"pairing": false,
"rssi": -80,
"name": "Moto G (4)",
"address": "42:f9:06:f5:b3:86",
"paired": false,
"typeOfDevice": "ble",
"manufacturerData": {
},
"adapterAddress": "",
"classOfDevice": 0,
"blocked": false
},
{
"serviceClasses": [
],
"trusted": false,
"connectedProfiles": [
],
"scanRecord": [
],
"pairing": false,
"rssi": -68,
"name": "Moto G (4)",
"address": "58:01:5f:a3:f7:f0",
"paired": false,
"typeOfDevice": "ble",
"manufacturerData": {
},
"adapterAddress": "",
"classOfDevice": 0,
"blocked": false
}
]
}
Example: Scan and list all the bluetoothLE devices with specified adapter address
# luna-send -f -i luna"://com.webos.service.bluetooth2/le/startScan '{
"subscribe":true,
"adapterAddress":"5c:f3:70:97:5c:a2"
}'
Response:
{
"subscribed":true,
"adapterAddress":"5c:f3:70:97:5c:a2",
"returnValue":true
}
{
"returnValue":true,
"devices":[
{
"serviceClasses":[
],
"trusted":false,
"connectedProfiles":[
],
"scanRecord":[
171,
205
],
"pairing":false,
"rssi":-72,
"name":"52-C2-72-AB-5C-80",
"address":"52:c2:72:ab:5c:80",
"paired":false,
"typeOfDevice":"ble",
"manufacturerData":{
"companyId":[
187,
187
],
"data":[
187,
187
]
},
"adapterAddress":"",
"classOfDevice":0,
"blocked":false
},
{
"serviceClasses":[
],
"trusted":false,
"connectedProfiles":[
],
"scanRecord":[
],
"pairing":false,
"rssi":-53,
"name":"37-99-2F-72-F2-5F",
"address":"37:99:2f:72:f2:5f",
"paired":false,
"typeOfDevice":"ble",
"manufacturerData":{
"companyId":[
0,
6
],
"data":[
1,
9,
32,
2,
117,
37,
248,
212,
19,
108,
112,
194,
70,
133,
142,
151,
196,
98,
251,
184,
60,
46,
78,
247,
242,
208,
152
]
},
"adapterAddress":"",
"classOfDevice":0,
"blocked":false
}
]
}
{
"returnValue":true,
"devices":[
{
"serviceClasses":[
],
"trusted":false,
"connectedProfiles":[
],
"scanRecord":[
],
"pairing":false,
"rssi":-65,
"name":"2F-8B-19-DD-C5-EF",
"address":"2f:8b:19:dd:c5:ef",
"paired":false,
"typeOfDevice":"ble",
"manufacturerData":{
"companyId":[
0,
6
],
"data":[
1,
9,
32,
2,
146,
47,
224,
26,
251,
123,
158,
54,
235,
224,
104,
172,
236,
79,
217,
46,
77,
37,
220,
219,
204,
101,
91
]
},
"adapterAddress":"",
"classOfDevice":0,
"blocked":false
}
]
}
{
"returnValue":true,
"devices":[
{
"serviceClasses":[
],
"trusted":false,
"connectedProfiles":[
],
"scanRecord":[
171,
205
],
"pairing":false,
"rssi":-76,
"name":"5E-05-4E-3D-8B-EC",
"address":"5e:05:4e:3d:8b:ec",
"paired":false,
"typeOfDevice":"ble",
"manufacturerData":{
"companyId":[
187,
188
],
"data":[
187,
189
]
},
"adapterAddress":"",
"classOfDevice":0,
"blocked":false
},
{
"serviceClasses":[
],
"trusted":false,
"connectedProfiles":[
],
"scanRecord":[
],
"pairing":false,
"rssi":-65,
"name":"2F-8B-19-DD-C5-EF",
"address":"2f:8b:19:dd:c5:ef",
"paired":false,
"typeOfDevice":"ble",
"manufacturerData":{
"companyId":[
0,
6
],
"data":[
1,
9,
32,
2,
146,
47,
224,
26,
251,
123,
158,
54,
235,
224,
104,
172,
236,
79,
217,
46,
77,
37,
220,
219,
204,
101,
91
]
},
"adapterAddress":"",
"classOfDevice":0,
"blocked":false
}
]
}
API level 12
Connects to the MAS Instance of the specified remote device.
Note: The method is available only for MCE.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
address | Required | String | Indicates the address of the remote device (MSE). |
instanceName | Optional | String | Indicates the specific MAS instance of the MSE required for the connection to be initiated. Note:
|
subscribe | Optional | Boolean | Indicates if subscribed to get the notifications. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
subscribed | Required | Boolean | Indicates if subscribed to get the notifications. Possible values are:
|
address | Required | String | Indicates the address of the remote device (MSE). |
adapterAddress | Required | String | Indicates the address of the adapter. |
instanceName | Required | String | Indicates the specific MAS instance name of the MSE to which it is connected. |
sessionId | Optional | String | Indicates the allocated Obex sessionId, which shall be used for further API call. Note:
|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
subscribed | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
disconnectByRemote | Required | Boolean | Indicates if the remote device or the local user has initiated the disconnect. Possible values are:
|
address | Required | String | Indicates the address of the remote device (MSE). |
adapterAddress | Required | String | Indicates the address of the adapter. |
instanceName | Required | String | Indicates the specific MAS instance name of the MSE. |
sessionId | Required | String | Indicates the allocated Obex sessionId, which shall be used for further API call. Note:
|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
Error Code | Error Text | Error Description |
---|---|---|
1,101,105,106,127,128,129,143,144,162 | See API Error Codes Reference | See API Error Codes Reference. |
296 | The supplied instance does not exist | The supplied instance does not exist |
305 | The supplied instance already connected | The supplied instance already connected |
map/connect
# luna-send -i -f luna://com.webos.service.bluetooth2/map/connect '{
"adapterAddress":"b8:27:eb:13:68 :c0",
"address":"64:a2:f9:7e:e7:a7",
"instanceName":"SMS/MMS",
"subscribe":true
}'
Response:
{
"sessionId": "session2",
"instanceName": "SMS/MMS",
"address": "64:a2:f9:7e:e7:a7",
"subscribed": true,
"adapterAddress": "b8:27:eb:13:68:c0",
"returnValue": true
}
Subscription response:
{
"instanceName": "SMS/MMS",
"sessionId": "session2",
"address": "64:a2:f9:7e:e7:a7",
"subscribed": false,
"disconnectByRemote": true,
"returnValue": true,
"adapterAddress": "b8:27:eb:13:68:c0"
}
API level 12
Disconnects from the MAS Instance on the specified remote device.
Note: The method is available only for MCE.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
address | Required | String | Indicates the address of the remote device. |
sessionId | Required | String | Indicates the unique identifier of the session which was received as a connection response from the map/connect. |
Name | Required | Type | Description |
---|---|---|---|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
address | Required | String | Indicates the address of the remote device. |
adapterAddress | Required | String | Indicates the address of the adapter. |
instanceName | Required | String | Indicates the specific MAS instance name of the MSE. |
sessionId | Required | String | Indicates the unique identifier of the session which was received as a connection response from the map/connect. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
Error Code | Error Text | Error Description |
---|---|---|
1,101,105,106,127,129,143,144,162, 297, 298 | See API Error Codes Reference | See API Error Codes Reference. |
132 | Failed to disconnect from remote device | Failed to disconnect from remote device |
map/disconnect
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/map/disconnect '{
"adapterAddress":"b8:27:eb: 13:68:c0",
"address":"64:a2:f9:7e:e7:a7",
"sessionId":"session1"
}'
Response:
{
"instanceName": "SMS/MMS",
"sessionId": "session1",
"adapterAddress": "b8:27:eb:13:68:c0",
"address": "64:a2:f9:7e:e7:a7",
"returnValue": true
}
API level 12
Lists the available folders of the connected MAS instance of the MSE device.
Note: This method is available only for MCE.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
address | Required | String | Indicates the remote Bluetooth device address(MSE). |
sessionId | Required | String | Indicates the unique identifier of the session which was received as a connection response from map/connect. |
startOffset | Optional | Number | Indicates the Offset of the first item. Default: 0 |
maxListCount | Optional | Number | Indicates the maximum number of items. Default: 1024 |
Name | Required | Type | Description |
---|---|---|---|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
address | Required | String | Indicates the remote Bluetooth device address(MSE). |
adapterAddress | Required | String | Indicates the address of the adapter. |
folders | Optional | String array | Indicates the list of the available folder names for the current directory. |
instanceName | Optional | String | Indicates the name of the MAS instance for the requested getFolderList. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
Error Code | Error Text | Error Description |
---|---|---|
1,6,101,105,127,143,144,162,297, 298 | See API Error Codes Reference | See API Error Codes Reference |
map/getFolderList
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/map/getFolderList '{
"adapterAddress":"b8:27:eb :13:68:c0",
"address":"64:a2:f9:7e:e7:a7",
"sessionId":"session2"
}'
Response:
{
"instanceName":"SMS/MMS",
"adapterAddress":"b8:27:eb:13:68:c0",
"address":"64:a2:f9:7e:e7:a7",
"returnValue":true,
"folders":[
"deleted",
"draft",
"inbox",
"outbox",
"sent"
]
}
API level 12
Retrieves the MAS instance details of a MSE device. MAP MSE devices may present one or several MAS Instances to the MCE, each providing the overall MAP MSE server functionality.
Note: The method is available only for MCE.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
address | Required | String | Indicates the address of the remote Bluetooth device address(MSE). |
Name | Required | Type | Description |
---|---|---|---|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
address | Required | String | Indicates the address of the remote Bluetooth device (MSE). |
adapterAddress | Required | String | Indicates the address of the adapter. |
masInstances | Required | Object array: bluetooth2MasInstances | Indicates the list of the supported MAS instances. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
Error Code | Error Text | Error Description |
---|---|---|
101,105,106,127,129,143,144,162 | See API Error Codes Reference | See API Error Codes Reference. |
map/getMASInstances
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/map/getMASInstances '{
"adapterAddress":"b8:2 7:eb:13:68:c0",
"address":"64:a2:f9:7e:e7:a7"
}'
Response:
{
"adapterAddress":"b8:27:eb:13:68:c0",
"address":"64:a2:f9:7e:e7:a7",
"masInstances":[
{
"instanceName":"SMS/MMS",
"supportedMessageTypes":[
"SMS_GSM",
"SMS_CDMA",
"MMS"
]
}
],
"returnValue":true
}
API level 12
Downloads the specific message based on the message handle.
Note: This method is available only for MCE.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
address | Required | String | Indicates the remote Bluetooth device address(MSE). |
handle | Required | String | Indicates the message handle. |
destinationFile | Optional | String | Indicates the name of the destination file. Note: If not provided, it will be set as per the message handle. |
attachment | Optional | Boolean | Indicates if attachments are included in the bMessage object returned by the MSE. Possible values are:
Default: false |
sessionId | Required | String | Indicates the unique identifier of the session which was received as a connection response from the map/connect. |
Name | Required | Type | Description |
---|---|---|---|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
address | Required | String | Indicates the remote Bluetooth device address(MSE). |
adapterAddress | Required | String | Indicates the address of the adapter. |
destinationFile | Optional | String | Returns the absolute path of the destination file rooted at /media/internal/map. Note: This must be a path to a file and not a directory. Example: /media/internal/map/<device-address>/<messageHandle> |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
Error Code | Error Text | Error Description |
---|---|---|
1,6,101,105,106,127,129,143,144,162,297, 298 | See API Error Codes Reference | See API Error Codes Reference |
27 | Requested message handle is not found | Requested message handle is not found |
139 | Supplied destination path does not exist or is invalid | Supplied destination path <destinationFile> does not exist or is invalid |
304 | Required 'handle' parameter is not supplied | Required 'handle' parameter is not supplied |
map/getMessage
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/map/getMessage '{
"adapterAddress":"b8:27:eb: 13:68:c0",
"address":"64:a2:f9:7e:e7:a7",
"sessionId":"session2",
"handle":"message288230376151723506"
}'
Response:
{
"adapterAddress":"b8:27:eb:13:68:c0",
"address":"64:a2:f9:7e:e7:a7",
"destinationFile":"/media/internal/map/64_a2_f9_7e_e7_a7/message288230376151723506",
"returnValue":true
}
API level 12
Returns all the available fields that can be used in the fields filter of the getMessageList.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
address | Required | String | Indicates the remote Bluetooth device address(MSE). |
sessionId | Required | String | Indicates the unique identifier of the session which was received as a connection response from the map/connect. |
Name | Required | Type | Description |
---|---|---|---|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
address | Required | String | Indicates the remote bluetooth device address(MSE). |
adapterAddress | Required | String | Indicates the address of the adapter. |
filters | Optional | String array | Indicates the list of all the available filter fields supported by the Bluetooth stack. |
instanceName | Optional | String | Indicates the name of the MAS instance for the requested getFolderList. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
Error Code | Error Text | Error Description |
---|---|---|
1,6,101,105,106,127,129,143,144,162,297, 298 | See API Error Codes Reference | See API Error Codes Reference |
map/getMessageFilters
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/map/getMessageFilters '{
"adapterAddress":"b8:2 7:eb:13:68:c0",
"address":"64:a2:f9:7e:e7:a7",
"sessionId":"session2"
}'
Response:
{
"instanceName":"SMS/MMS",
"adapterAddress":"b8:27:eb:13:68:c0",
"address":"64:a2:f9:7e:e7:a7",
"returnValue":true,
"filters":[
"subject",
"timestamp",
"sender",
"sender-address",
"recipient",
"recipient-address",
"type",
"size",
"status",
"text",
"attachment",
"priority",
"read",
"sent",
"protected",
"replyto"
]
}
API level 12
Gets the message list of the specific folder of the connected MAS instance of the MSE device.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
address | Required | String | Indicates the remote Bluetooth device address(MSE). |
sessionId | Required | String | Indicates the unique identifier of the session which was received as a connection response from the map/connect. |
folder | Optional | String | Indicates the name of the sub folder for the API service to be executed. Note: If empty the API service will be executed for current folder. |
filters | Optional | Object: bluetooth2MessageFilters | Indicates the list of the filters which can be used for the API. |
Name | Required | Type | Description |
---|---|---|---|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
address | Required | String | Indicates the remote Bluetooth device address(MSE). |
adapterAddress | Required | String | Indicates the address of the adapter. |
instanceName | Optional | String | Indicates the name of the MAS instance for the requested getFolderList. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
messages | Optional | Object array: bluetooth2MessageList | Returns the messages with the handle and the properties from the selected folder. |
Error Code | Error Text | Error Description |
---|---|---|
1,6,101,105,127,143,144,162,297, 298 | See API Error Codes Reference | See API Error Codes Reference |
map/getMessageList
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/map/getMessageList '{
"adapterAddress":"b8:27 :eb:13:68:c0",
"address":"64:a2:f9:7e:e7:a7",
"sessionId":"session2",
"folder":"sent",
"filter":{
"maxCount":1
}
}'
Response:
{
"instanceName":"SMS/MMS",
"adapterAddress":"b8:27:eb:13:68:c0",
"address":"64:a2:f9:7e:e7:a7",
"returnValue":true,
"messages":[
{
"properties":{
"status":"complete",
"priority":false,
"recipientName":"!¡Møm!¡",
"type":"sms-gsm",
"read":true,
"subject":"Hi",
"recipientAddress":"+919924990527",
"textType":true,
"sent":true,
"senderName":"",
"protected":false,
"senderAddress":"",
"dateTime":"20200805T172125",
"folder":"/telecom/msg/sent"
},
"handle":"message288230376151723506"
}
]
}
API level 12
Receives the message notification from the MSE device.
Note: This method is available only for MCE.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
address | Required | String | Indicates the remote Bluetooth device address(MSE). |
sessionId | Required | String | Indicates the unique identifier of the session which was received as a connection response from the map/connect. |
subscribe | Required | Boolean | Indicates if subscribed to get the notifications on the message event from the MSE. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
address | Required | String | Indicates the remote Bluetooth device address(MSE). |
adapterAddress | Required | String | Indicates the address of the adapter. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
subscribed | Required | Boolean | Indicates if subscribed to get the notifications on the message event from the MSE. Possible values are:
|
sessionId | Required | String | Indicates the unique identifier of the session which was received as a connection response from the map/connect. |
Name | Required | Type | Description |
---|---|---|---|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
adapterAddress | Required | String | Indicates the address of the adapter. |
address | Required | String | Indicates the remote Bluetooth device address(MSE). |
subscribed | Required | Boolean | Indicates if subscribed to get the notifications on the message event from the MSE. Possible values are:
|
sessionId | Required | String | Indicates the unique identifier of the session which was received as a connection response from the map/connect. |
notificationType | Optional | String | Indicates the type of the message notification. Possible values are:
|
message | Optional | Object: bluetooth2Message | Returns the message with the handle and properties. |
Error Code | Error Text | Error Description |
---|---|---|
101,105,106,127,129,143,144,162,297, 298 | See API Error Codes Reference | See API Error Codes Reference |
103 | Method needs to be subscribed | Method needs to be subscribed |
map/getMessageNotification
# luna-send -i -f luna://com.webos.service.bluetooth2/map/getMessageNotification '{
"adapterAddress":"b8:27:eb:13:68:c0",
"address":"64:a2:f9:7e:e7:a7",
"sessionId":"session3",
"subscribe":true
}'
Response:
{
"sessionId":"session3",
"adapterAddress":"b8:27:eb:13:68:c0",
"address":"64:a2:f9:7e:e7:a7",
"subscribed":true,
"returnValue":true
}
Subscription response:
{
"sessionId":"session3",
"subscribed":true,
"adapterAddress":"b8:27:eb:13:68:c0",
"notificationType":"MessageDeleted",
"address":"64:a2:f9:7e:e7:a7",
"messages":{
"properties":{
"folder":"/telecom/msg/sent",
"type":"sms-gsm"
},
"handle":"message288230376151723627"
},
"returnValue":true
}
API level 12
Returns the status of the MAS connection with a remote device.
Note: The method is available only for MCE.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
address | Required | String | Indicates the address of the remote device. |
instanceName | Optional | String | Indicates a specific MAS instance name. Note: If not provided, all MAS instances details will be provided |
subscribe | Optional | Boolean | Indicates if subscribed to get the notifications. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
subscribed | Required | Boolean | Indicates if subscribed to get the notifications. Possible values are:
|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
adapterAddress | Required | String | Indicates the address of the adapter. |
address | Required | String | Indicates the address (bdaddr) of the remote device |
status | Required | Object array: bluetooth2MasInstancesStatus | Indicates an array of MAS instances with connection details. |
Name | Required | Type | Description |
---|---|---|---|
subscribed | Required | Boolean | Indicates if subscribed to get the notifications. Possible values are:
|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
adapterAddress | Required | String | Indicates the address of the adapter. |
address | Required | String | Indicates the address (bdaddr) of the remote device |
status | Required | Object array: bluetooth2MasInstancesStatus | Indicates the array of MAS instances with connection details. |
Error Code | Error Text | Error Description |
---|---|---|
101,105,106,127,129,143,144,162 | See API Error Codes Reference | See API Error Codes Reference. |
Example scenario
# luna-send -i -f luna://com.webos.service.bluetooth2/map/getStatus '{
"adapterAddress":"b8:27:eb:13: 68:c0",
"address":"64:a2:f9:7e:e7:a7",
"subscribe":true
}'
Response:
{
"adapterAddress":"b8:27:eb:13:68:c0",
"subscribed":false,
"status":[
{
"instanceName":"SMS/MMS",
"sessionId":"session1",
"Connected":true,
"Connecting":false
}
],
"address":"64:a2:f9:7e:e7:a7",
"returnValue":true
}
Subscription response:
{
"adapterAddress":"b8:27:eb:13:68:c0",
"subscribed":false,
"status":[
{
"instanceName":"SMS/MMS",
"Connected":false,
"Connecting":false
}
],
"address":"64:a2:f9:7e:e7:a7",
"returnValue":true
}
API level 12
Sends the message.
Example: Sending an SMS.
Note: The API is designed based on MAP 1.0 specification.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
address | Required | String | Indicates the remote Bluetooth device address(MSE). |
sessionId | Required | String | Indicates the unique identifier of the session which was received as a connection response from the map/connect. |
sourceFile | Required | String | Indicates the location of the file containing message body in the bMessage format. Note: Get sample file using map/getMessage API. |
folder | Required | String | Indicates the folder name with the absolute path. Possible inputs :
|
transparent | Optional | Boolean | Indicates to the MSE that no copy of the message shall be kept in the 'sent' folder after the message was sent. Default: false |
retry | Optional | Boolean | Indicates if successive attempts at sending the message shall be carried out in case of the cellular network. Default: true |
charset | Optional | String | Indicates the type of content delivered in the iMessage Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
address | Required | String | Indicates the remote Bluetooth device address(MSE). |
adapterAddress | Required | String | Indicates the address of the adapter. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
handle | Optional | String | Indicates the message handle. Note: map/getMessageNotificationEvent API will use this return parameter to know the status change for a specific message handle. |
Error Code | Error Text | Error Description |
---|---|---|
1,6,101,105,106,127,129,143,144,162,297, 298 | See API Error Codes Reference | See API Error Codes Reference |
137 | Required parameter 'sourceFile' is not supplied | Required parameter 'sourceFile' is not supplied |
142 | Supplied file does not exist or is invalid | Supplied file <sourceFile> does not exist or is invalid |
299 | Required 'folder' parameter is not supplied | Required 'folder' parameter is not supplied |
map/pushMessage
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/map/pushMessage '{
"adapterAddress":"b8:27:eb :13:68:c0",
"address":"64:a2:f9:7e:e7:a7",
"sessionId":"session5",
"sourceFile":"/media/internal/map/64_a2_f9_7e_e7_a7/message2882303761 51723506",
"folder":"outbox"
}'
Response:
{
"adapterAddress": "b8:27:eb:13:68:c0",
"address": "64:a2:f9:7e:e7:a7",
"returnValue": true,
"handle": "message288230376151723660"
}
API level 12
Returns to the child folder of the current directory of the connected MAS instance of the MSE device.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
address | Required | String | Indicates the remote Bluetooth device address(MSE). |
sessionId | Required | String | Indicates the unique identifier of the session which was received as a connection response from the map/connect. |
folder | Required | String | Indicates the name or the absolute path of the child folder. Possible inputs:
|
Name | Required | Type | Description |
---|---|---|---|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
address | Required | String | Indicates the remote Bluetooth device address(MSE). |
adapterAddress | Required | String | Indicates the address of the adapter. |
instanceName | Optional | String | Indicates the name of the MAS instance for the requested setFolder. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
Error Code | Error Text | Error Description |
---|---|---|
1,6,101,105,127,143,144,162,297, 298 | See API Error Codes Reference | See API Error Codes Reference |
26 | Requested folder is not found | Requested folder is not found |
299 | Required 'folder' parameter is not supplied | Required 'folder' parameter is not supplied |
map/setFolder
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/map/setFolder '{
"adapterAddress":"b8:27:eb:1 3:68:c0",
"address":"64:a2:f9:7e:e7:a7",
"sessionId":"session2",
"folder":"/telecom/msg/inbox"
}'
Response:
{
"instanceName":"SMS/MMS",
"adapterAddress":"b8:27:eb:13:68:c0",
"address":"64:a2:f9:7e:e7:a7",
"returnValue":true
}
API level 12
Modifies the status of a message on the MSE.
Note: This method is available only for MCE
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
address | Required | String | Indicates the remote Bluetooth device address(MSE). |
sessionId | Required | String | Indicates the unique identifier of the session which was received as a connection response from the map/connect. |
handle | Required | String | Indicates the message handle. The handle shall be represented by a null-terminated unicode text string with 16 hexadecimal digits. |
statusIndicator | Required | String | Indicates the status of the information to be modified. Possible values are:
|
statusValue | Required | Boolean | Indicates the status value.
|
Name | Required | Type | Description |
---|---|---|---|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
address | Required | String | Indicates the remote Bluetooth device address(MSE). |
adapterAddress | Required | String | Indicates the address of the adapter. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
Error Code | Error Text | Error Description |
---|---|---|
1,6,101,105,106,127,129,143,144,162,297, 298 | See API Error Codes Reference | See API Error Codes Reference |
27 | Requested message handle is not found | Requested message handle is not found |
304 | Required 'handle' parameter is not supplied | Required 'handle' parameter is not supplied |
306 | Required 'statusIndicator' parameter is not supplied | Required 'statusIndicator' parameter is not supplied |
307 | Required 'statusValue' parameter is not supplied | Required 'statusValue' parameter is not supplied |
map/setMessageStatus
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/map/setMessageStatus '{
"adapterAddress":"b8: 27:eb:13:68:c0",
"address":"64:a2:f9:7e:e7:a7",
"sessionId":"session2",
"handle":"message288230376151723506",
"statusIndicator":"delete",
"statusValue":true
}'
Response:
{
"adapterAddress": "b8:27:eb:13:68:c0",
"address": "64:a2:f9:7e:e7:a7",
"returnValue": true
}
API level 13
Requests to generate a new application key.
This call affects the local key database only. To update the remote config server, use mesh/model/config/set.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | The address of the adapter to be used. |
bearer | Optional | String | The underlying bearer to use. Possible values are:
|
netKeyIndex | Optional | Number | The net key to be bound to the application key. Note: If netKeyIndex value is not passed the primary netKeyIndex (i.e. 000) is used. Call mesh/getMeshInfo to get the available netKeyIndexes. |
appKeyIndex | Optional | Number | The app key index to add. Note: If appKeyIndex value is not passed, Bluetooth service creates appKeyIndex. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | The reason for the failure of the operation. |
adapterAddress | Required | String | The address of the adapter. |
netKeyIndex | Optional | Number | The net key index bound to application key. |
appKeyIndex | Optional | Number | The created app key index. |
Error Code | Error Text | Error Description |
---|---|---|
1, 15, 17, 101, 28, 29,41 | See API Error Codes section for reference | See API Error Codes section for reference |
Example scenario
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/mesh/createAppKey '{"bearer":"PB-ADV", "netKeyIndex":0, "appKeyIndex":0}'
Response:
{
"adapterAddress": "b8:27:eb:e6:5b:e5",
"returnValue": true,
"appKeyIndex": 0,
"netKeyIndex": 0
}
API level 13
This is the first API that must be called by the application to create a network and to become a provisioner. This is called once for every network and the token returned should be stored securely by the application.
This API should not be called if the local node is not acting as the provisioner.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | The address of the adapter to be used. |
bearer | Optional | String | The underlying bearer to use. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | The reason for the failure of the operation. |
adapterAddress | Required | String | The address of the adapter. |
networkId | Required | String | The unique identifier for the local network. |
Error Code | Error Text | Error Description |
---|---|---|
1, 6 , 17, 39, 101 | See API Error Codes section for reference | See API Error Codes section for reference |
Example
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/mesh/createNetwork '{}'
Response:
{
"adapterAddress": "b8:27:eb:fa:92:76",
"returnValue": true,
"networkId": "13062059374388537380"
}
API level 13
Gets mesh network-related information.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | The address of the adapter to be used. |
bearer | Optional | String | The underlying bearer to use. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | The reason for the failure of the operation. |
adapterAddress | Required | String | The address of the adapter. |
meshInfo | Required | Object: BleMeshInfo | Details of the mesh network. |
Error Code | Error Text | Error Description |
---|---|---|
1, 6, 41, 101, 103 | See API Error Codes Reference | See the API Error Codes Reference section. |
Example scenario
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/mesh/getMeshInfo '{}'
Response:
{
"adapterAddress": "b8:27:eb:0a:fc:70",
"returnValue": true,
"meshInfo": {
"name": "Mesh Network",
"provisioners": [
{
"name": "BLE Mesh",
"unicastAddress": 1
}
],
"appKeys": [
{
"boundNetKeyIndex": 0,
"index": 0
}
],
"netKeys": [
{
"keyRefresh": false,
"index": 0
}
]
}
}
API level 14
Refreshes the mesh network key and associated app keys.
Name | Required | Type | Description |
---|---|---|---|
subscribe | Required | Boolean | Subscribe for notifications about any failure during the key refresh procedure. Possible values are:
For example: If app key update to the remote node fails during the key refresh procedure, it informs the application using subscription response and the key refresh procedure continues for the remaining nodes. |
adapterAddress | Optional | String | The address of the adapter. Note: If not specified, the default adapter is used. |
bearer | Optional | String | The underlying bearer to use. Possible values are:
|
blacklistedNodes | Optional | Number array | Provide a list of blacklistedNodes, represented by the primary element address of the node. Note: Blacklisted nodes will not receive new app/network keys during the keyRefresh process. |
waitTimeout | Optional | Number | The total duration (in seconds) to wait for each phase to complete during keyRefresh process. The application has to provide a time considering the low power nodes in the network as they may take longer to respond. Note: If not specified, a default timeout time of 2 seconds is used. |
refreshAppKeys | Optional | Boolean | Indicates whether to refresh appkeys associated with net key indicated by netKeyIndex
Note: If not specified, the default value false is used. Use case 1: When an application had called removeNode API to remove a node from the network, it can refresh only those app keys that were known to the removed node. In that case:
Use case 2: When an application wants to refresh all the keys to prevent any security threat:
Use case 3: When an application wants to refresh only Netkeys to prevent any security threat:
|
appKeyIndexes | Optional | Number array | Provide app key indexes to refresh. This parameter is ignored if refreshAppKeys is false. Note:
|
Name | Required | Type | Description |
---|---|---|---|
subscribed | Optional | Boolean | Indicates if subscribed to get notifications. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | The reason for the failure of the operation. See the 'Error Codes' section of this method for details. |
adapterAddress | Required | String | The address of the adapter. |
Name | Required | Type | Description |
---|---|---|---|
subscribed | Required | Boolean | Indicates if subscribed to get notifications. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | The reason for the failure of the operation. See the 'Error Codes' section of this method for details. |
adapterAddress | Required | String | Indicates the address of the adapter. |
netKeyIndex | Required | Number | Indicates the network key index to which the key refresh result belongs. |
status | Required | String | Indicates the status of the KeyRefresh process. Possible values are :
|
keyRefreshPhase | Required | Number | Key refresh phase currently the network is in. Possible values are:
|
keyUpdateResponse | Optional | Object: BleMeshKeyUpdateResponse | Object representing the intermediate response during key update to nodes in the network. |
Error Code | Error Text | Error Description |
---|---|---|
1 | The operation failed for an unspecified or generic reason | The operation failed for an unspecified or generic reason |
5 | The requested operation is not supported by the stack or device | Error if the bearer is not supported by the Bluetooth stack. |
6 | Invalid value passed for one of the parameters | Invalid value passed for one of the parameters |
28 | netKeyIndex does not exist | netKeyIndex does not exist |
101 | Bluetooth adapter is not available | Bluetooth adapter is not available |
327 | Mesh network is not created | Mesh network is not created |
335 | Key refresh is already in progress | Key refresh is already in progress |
Example : keyRefresh procedure
# luna-send -n i -f luna://com.webos.service.bluetooth2/mesh/keyRefresh '{
"subscribe" : true,
"waitTimeout" : 2,
"netKeyIndex" : 0,
"refreshAppKeys" : true,
"blacklistedNodes":[170]
}'
Response:
{
"subscribed": true,
"returnValue": true,
"adapterAddress": "b8:27:eb:e6:5b:e5"
}
Subscription Response:
{
"subscribed": true,
"status": "idle",
"returnValue": true,
"adapterAddress": "b8:27:eb:e6:5b:e5",
"keyRefreshPhase": 0,
"netKeyIndex": 0
}
{
"subscribed": true,
"status": "active",
"returnValue": true,
"adapterAddress": "b8:27:eb:e6:5b:e5",
"keyRefreshPhase": 1,
"netKeyIndex": 0
}
{
"subscribed": true,
"status": "active",
"returnValue": true,
"adapterAddress": "b8:27:eb:e6:5b:e5",
"keyRefreshPhase": 2,
"netKeyIndex": 0
}
{
"subscribed": true,
"status": "active",
"returnValue": true,
"adapterAddress": "b8:27:eb:e6:5b:e5",
"keyRefreshPhase": 3,
"netKeyIndex": 0
}
{
"subscribed": false,
"status": "completed",
"returnValue": true,
"adapterAddress": "b8:27:eb:e6:5b:e5",
"keyRefreshPhase": 0,
"netKeyIndex": 0
}
API level 14
Gets a list of provisioned nodes.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | The address of the adapter. Note: If not specified, the default adapter is used. |
bearer | Optional | String | The underlying bearer to use. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | The reason for the failure of the operation. See the 'Error Codes' section of this method for details. |
adapterAddress | Required | String | The address of the adapter. |
nodes | Required | Object array: BleMeshNode | Array of provisioned nodes in the network. |
Error Code | Error Text | Error Description |
---|---|---|
5 | The requested operation is not supported by the stack or device | Error if the bearer is not supported by the Bluetooth stack. |
6 | Invalid value passed for one of the parameters | Invalid value passed for one of the parameters |
101 | Bluetooth adapter is not available | Bluetooth adapter is not available |
127 | Profile backend is not available | Profile backend is not available |
327 | Mesh network is not created | Mesh network is not created |
Example : List provisioned nodes
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/mesh/listProvisionedNodes '{}'
Response:
{
"adapterAddress":"b8:27:eb:fa:92:76",
"returnValue":true,
"nodes":[
{
"appKeyIndexes":0,
"uuid":"1ef4354ffbbe43b5a8a7fbe94ec7746d",
"numberOfElements":1,
"netKeyIndex":0,
"primaryElementAddress":170
}
]
}
API level 13
Gets various configuration parameters provided by configuration model.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | The address of the adapter to be used. |
bearer | Optional | String | The underlying bearer to use. Possible values are:
|
subscribe | Required | Boolean | Subscribe for notifications on changes. Possible values are:
|
destAddress | Required | Number | The unicast address of the destination. |
config | Required | String | The configurations to be retrieved. Possible values are:
|
netKeyIndex | Optional | Number | The index of the net key. This parameter is mandatory if config field is APPKEYINDEX and ignored for others. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | The reason for the failure of the operation. |
adapterAddress | Required | String | The address of the adapter. |
subscribed | Required | Boolean | Indicates if subscribed to get notifications. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. |
adapterAddress | Required | String | The address of the adapter. |
subscribed | Required | Boolean | Indicates if subscribed to get notifications. |
config | Required | String | The configuration that is requested to be retrieved. |
appKeyIndexes | Optional | Number array | A list of AppKey indexes that are bound to the NetKey identified by netKeyIndex passed during API call. Note: This information will be sent when config is APPKEYINDEX |
ttl | Optional | Number | The default TTL for the outgoing messages. Values will be in the range: 0x00, 0x02–0x7F Note: This information will be sent when config is DEFAULT_TTL |
gattProxyState | Optional | Number | The GATT proxy state. Possible values are:
Note: This information will be sent when config is GATT_PROXY |
relayStatus | Optional | Object: BleMeshConfigRelayStatus | The Current Relay and Relay Retransmit states of a node. Note: This information will be sent when config is RELAY |
Error Code | Error Text | Error Description |
---|---|---|
1, 6, 17 ,31, 37 ,41, 101, 103 | See API Error Codes Reference | See API Error Codes Reference |
309 | Required 'netKeyIndex' parameter missing | Required 'netKeyIndex' parameter missing |
310 | Required 'appKeyIndex' parameter missing | Required 'appKeyIndex' parameter missing |
311 | Required 'destAddress' parameter missing | Required 'destAddress' parameter missing |
config/get
# luna-send -i -f luna://com.webos.service.bluetooth2/mesh/model/config/get '{
"destAddress":173,
"config":"GATT_PROXY",
"netKeyIndex": 0,
"subscribe":true
}'
Response:
{
"adapterAddress": "b8:27:eb:fa:92:76",
"returnValue": true,
"subscribed": true
}
Subscription Response:
{
"subscribed": true,
"returnValue": true,
"adapterAddress": "b8:27:eb:fa:92:76",
"config": "GATT_PROXY",
"gattProxyState": 1
}
API level 13
Gets composition data of a mesh node. The composition data contains information about a node, the elements it includes, and the supported models.
Note: The naming convention for this method is taken from the specification.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | The address of the adapter to be used. |
bearer | Optional | String | The underlying bearer to use. Possible values are:
|
destAddress | Required | Number | The destination address. |
subscribe | Required | Boolean | Subscribe for notifications on changes. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | The reason for the failure of the operation. |
adapterAddress | Required | String | The address of the adapter. |
subscribed | Required | Boolean | Indicates if subscribed to get notifications. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | String | Indicates the status of the operation. |
adapterAddress | Required | String | The address of the adapter. |
subscribed | Required | Boolean | Indicates if subscribed to get notifications. |
compositionData | Required | Object: BleMeshCompositionData | Composition data information about a requested node. |
Error Code | Error Text | Error Description |
---|---|---|
1, 6, 37, 31, 41, 101, 103, 311 | See API Error Codes Reference | See the API Error Codes Reference section. |
Example scenario
# luna-send -i -f luna://com.webos.service.bluetooth2/mesh/model/config/getCompositionData '{
"bearer":"PB-ADV",
"destAddress" : 170,
"subscribe" : true
}'
Response:
{
"adapterAddress": "b8:27:eb:0a:fc:70",
"returnValue": true,
"subscribed": true
}
{
"subscribed": true,
"returnValue": true,
"adapterAddress": "b8:27:eb:0a:fc:70",
"compositionData": {
"companyId": 89,
"numRplEnteries": 40,
"elements": [
{
"numS": 6,
"sigModelIds": [
0,
2,
4096,
4100,
4611,
4612
],
"loc": 0,
"numV": 0,
"vendorModelIds": [
]
}
],
"productId": 0,
"versionId": 0,
"features": {
"proxy": true,
"relay": true,
"friend": true,
"lowPower": false
}
}
}
API level 13
Sets various configuration parameters provided by the configuration model.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | The address of the adapter to be used. |
bearer | Optional | String | The underlying bearer to use. Possible values are:
|
subscribe | Required | Boolean | Subscribe for notifications on changes. Possible values are:
|
destAddress | Required | Number | The unicast address of the destination. |
config | Required | String | The configuration to be set. Possible values are:
|
netKeyIndex | Optional | Number | The net key index. Note: Mandatory parameter if config is APPKEY_ADD, APPKEY_DELETE, APPKEY_UPDATE, APPKEY_UNBIND |
appKeyIndex | Optional | Number | The app key index. Note: Mandatory parameter if config is APPKEY_ADD, APPKEY_DELETE, APPKEY_UPDATE, APPKEY_BIND, APPKEY_UNBIND. |
modelId | Optional | Number | SIG Model ID or Vendor Model ID. Note: Mandatory parameter if config is APPKEY_BIND, APPKEY_UNBIND. |
ttl | Optional | Number | The default TTL to set for the outgoing message. Values can be in the range: 0x00, 0x02–0x7F Note: Mandatory parameter if config is DEFAULT_TTL. |
gattProxyState | Optional | Number | The GATT proxy state to set. Possible values are:
Note: Mandatory parameter if config is GATT_PROXY. |
relayStatus | Optional | Object: BleMeshConfigRelayStatus | The Current Relay and Relay Retransmit states of a node. Note: Mandatory parameter if config is RELAY. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | The reason for the failure of the operation. |
adapterAddress | Required | String | The address of the adapter. |
subscribed | Required | Boolean | Indicates if subscribed to get notifications. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. |
adapterAddress | Required | String | The address of the adapter. |
subscribed | Required | Boolean | Indicates if subscribed to get notifications. |
config | Required | String | The configuration which is updated. |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | The reason for the failure of the operation. See the 'API Error Codes Reference' section for details. |
Error Code | Error Text | Error Description |
---|---|---|
1, 6, 17, 31, 37, 41, 101, 103 | See API Error Codes Reference | See API Error Codes Reference |
309 | Required 'netKeyIndex' parameter missing | Required 'netKeyIndex' parameter missing |
310 | Required 'appKeyIndex' parameter missing | Required 'appKeyIndex' parameter missing |
311 | Required 'destAddress' parameter missing | Required 'destAddress' parameter missing |
316 | Required 'modelId' parameter missing | Required 'modelId' parameter missing |
317 | Required 'ttl' parameter missing | Required 'ttl' parameter missing |
318 | Required 'gattProxyState' parameter missing | Required 'gattProxyState' parameter missing |
321 | errormessage3786 | Required 'relayStatus' parameter missing |
Example : With APPKEY_ADD
# luna-send -i -f luna://com.webos.service.bluetooth2/mesh/model/config/set '{
"destAddress":170,
"config":"APPKEY_ADD",
"netKeyIndex": 0,
"appKeyIndex": 0,
"subscribe":true
}'
Response:
{
"subscribed": true,
"returnValue": true,
"adapterAddress": "b8:27:eb:fa:92:76"
}
Subscription Response:
{
"subscribed": true,
"returnValue": true,
"adapterAddress": "b8:27:eb:fa:92:76",
"config": "APPKEY_ADD"
}
Example : With APPKEY_UNBIND
# luna-send -i -f luna://com.webos.service.bluetooth2/mesh/model/config/set '{
"destAddress":1,
"config":"APPKEY_UNBIND",
"netKeyIndex":0,
"appKeyIndex":0,
"modelId":4097,
"subscribe":true
}'
Response:
{
"subscribed": true,
"returnValue": true,
"adapterAddress": "b8:27:eb:e6:5b:e5"
}
Subscription Response:
{
"subscribed": true,
"returnValue": true,
"adapterAddress": "b8:27:eb:e6:5b:e5",
"config": "APPKEY_UNBIND"
}
Example : With APPKEY_DELETE
# luna-send -i -f luna://com.webos.service.bluetooth2/mesh/model/config/set '{
"destAddress":1,
"config":"APPKEY_DELETE",
"netKeyIndex":0,
"appKeyIndex":0,
"subscribe":true
}'
Response:
{
"subscribed": true,
"returnValue": true,
"adapterAddress": "b8:27:eb:e6:5b:e5"
}
Subscription Response:
{
"subscribed": true,
"returnValue": true,
"adapterAddress": "b8:27:eb:e6:5b:e5",
"config": "APPKEY_DELETE"
}
API level 13
Sets the on/off state of the remote node using a generic on-off model.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | The address of the adapter to be used |
bearer | Optional | String | The underlying bearer to use. Possible values are:
|
destAddress | Required | Number | The destination address. |
appKeyIndex | Required | Number | The application key index to used for encoding. |
state | Required | Boolean | The state of the remote node. Possible values are:
|
subscribe | Optional | Boolean | Subscribe for notifications on changes. Possible values are:
Note: If not subscribed, unacknowledged on/off message is sent to the remote node, acknowledged message is sent otherwise. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | The reason for the failure of the operation. |
adapterAddress | Required | String | The address of the adapter. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. |
adapterAddress | Required | String | The address of the adapter. |
onoFF | Required | Boolean | The state of the remote node. |
subscribed | Required | Boolean | Indicates if subscribed to get notifications. |
Error Code | Error Text | Error Description |
---|---|---|
1, 6, 101, 311, 30, 31, 41 | See API Error Codes Reference | See the API Error Codes Reference section. |
325 | Required 'onoff' parameter is missing | Required 'onoff' parameter is missing |
Example : Without subscription
# luna-send -i -f -a com.webos.service.test luna://com.webos.service.bluetooth2/mesh/model/onOff/set '{
"destAddress":170,
"appKeyIndex": 0,
"state": true,
"subscribe":false
}'
Response:
{
"adapterAddress": "b8:27:eb:0a:fc:70",
"returnValue": true
}
Example : With subscription
# luna-send -i -f -a com.webos.service.test luna://com.webos.service.bluetooth2/mesh/model/onOff/set '{
"destAddress":170,
"appKeyIndex": 0,
"state": false,
"subscribe":true
}'
Response:
{
"adapterAddress": "b8:27:eb:0a:fc:70",
"returnValue": true
}
Subscription Response:
{
"subscribed": true,
"returnValue": true,
"onOFF": false,
"adapterAddress": "b8:27:eb:0a:fc:70"
}
API level 13
Receives messages addressed to the application.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | The address of the adapter to be used. |
bearer | Optional | String | The underlying bearer to use. Possible values are:
|
appKeyIndex | Required | Number | The application key to be used for decrypting the message. The appKeyIndex must be valid for that element. |
subscribe | Required | Boolean | Subscribe for notifications on changes. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | The reason for the failure of the operation. |
adapterAddress | Required | String | The address of the adapter. |
subscribed | Required | Boolean | Indicates if subscribed to get notifications. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. |
adapterAddress | Required | String | The address of the adapter. |
subscribed | Required | Boolean | Indicates if subscribed to get notifications. |
srcAddress | Required | Number | The unicast address of the remote node-element that sent the message. |
destAddress | Required | Number | The destination address of received message. |
data | Required | Number (uint8_t) array | The incoming message. |
Error Code | Error Text | Error Description |
---|---|---|
1, 6 , 17, 41, 101, 103 | See API Error Codes Reference | See API Error Codes Reference |
310 | Required 'appKeyIndex' parameter missing | Required 'appKeyIndex' parameter missing |
Example : mesh/model/receive
# luna-send -i -f -a com.webos.service.test luna://com.webos.service.bluetooth2/mesh/model/receive '{"appKeyIndex": 0, "subscribe":true}'
Response:
{
"subscribed": true,
"returnValue": true,
"adapterAddress": "b8:27:eb:fa:92:76"
}
Subscription Response:
{
"data": [
6,
0
],
"subscribed": true,
"srcAddress": 173,
"adapterAddress": "b8:27:eb:fa:92:76",
"returnValue": true,
"destAddress": 0
}
API level 13
Sends a message originated by a local model.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | The address of the adapter. |
bearer | Optional | String | The underlying bearer to use. Possible values are:
|
srcAddress | Required | Number | The unicast address of the source element. |
destAddress | Required | Number | The destination unicast address or group address. |
appKeyIndex | Required | Number | The application key to use for encrypting the message. The appKeyIndex must be valid for that element Note: The application which has created the appKeyIndex will only receive messages belonging to that application |
command | Required | String | The command that corresponds to the message being sent in the payload. Possible values are:
Note: webos-bluetooth-service with the help of the underlying stack just encrypts and sends the payload when the command is passThrough. The application sends the payload that is in the packet format as mentioned in the specification. The bluetooth service and the underlying stack do not do any processing of the payload. |
payload | Required | Object: BleMeshPayload - for "passthrough" command | Payload object when "command" = "passthrough". |
payload | Required | Object: BleMeshPayload - for "onOff" command | Payload object when "command" = "onOff". |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation |
errorText | Optional | String | The reason for the failure of the operation. |
adapterAddress | Required | String | The address of the adapter. |
Error Code | Error Text | Error Description |
---|---|---|
1,6, 17, 101, 311, 310, 312, 315, 321, 37, 38, 40, 41 | See API Error Codes section for reference | See API Error Codes section for reference |
Example : onOff command
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/mesh/model/send '{
"srcAddress":1,
"destAddress":170,
"appKeyIndex": 0,
"command":"onOff",
"payload":{"value":true}
}'
Response:
{
"adapterAddress": "b8:27:eb:0a:fc:70",
"returnValue": true
}
Example : passThrough command
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/mesh/model/send '{
"srcAddress":1,
"destAddress":170,
"appKeyIndex": 0,
"command":"passThrough",
"payload":{"value":[130,2,0,118]}
}'
Response:
{
"adapterAddress": "b8:27:eb:0a:fc:70",
"returnValue": true
}
API level 13
Initiates provisioning of a device.
Once a mesh device is discovered using mesh/scanUnprovisionedDevices API, the discovered device can be provisioned using this method. After the provisioning, the device becomes a node in the mesh network.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | The address of the adapter to be used. |
bearer | Optional | String | The underlying bearer to use. Possible values are:
|
timeout | Optional | Number (uint16_t) | Provision request timeout in seconds. Default value: 60 sec Note: Authentication data must be supplied in this interval if required |
subscribe | Required | String | Subscribe for notifications on changes. Possible values are:
|
uuid | Required | String | Device UUID for provisioning device. UUID is received as part of the subscription response of mesh/scanUnprovisionedDevices API. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | The reason for the failure of the operation. |
adapterAddress | Required | String | The address of the adapter. |
subscribed | Required | Boolean | Indicates if subscribed to get notifications. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. |
adapterAddress | Required | String | The address of the adapter. |
subscribed | Required | Boolean | Indicates if subscribed to get notifications. |
request | Required | String | Indicates the type of user interaction required to complete provisioning. Possible values are:
|
stringToDisplay | Optional | String | The string to display to the user when "request"="displayString" |
numberToDisplay | Optional | Number (uint32_t) | The number to display when "request"="displayNumeric". |
numberDisplayType | Optional | String | Indicates how the number should be displayed when "request"="displayNumeric". Possible values are:
|
promptType | Optional | String | The input method (how the number to supply is shown) when "request"="promptNumeric". Possible values are:
|
unicastAddress | Optional | Number | The unicast address of the node provisioned when the provisioning is success and "request"="endProvision". |
uuid | Required | String | The uuid of the device. |
Error Code | Error Text | Error Description |
---|---|---|
1, 6, 17, 31, 38, 41, 101, 103 | See API Error Codes section for reference | See API Error Codes section for reference |
32 | Bad PDU | Bad PDU |
33 | Provision confirmation failed | Provision confirmation failed |
34 | Cannot assign addresses | Cannot assign addresses |
35 | Remote device not found | Remote device not found |
314 | uuid parameter missing | uuid parameter missing |
Example
# luna-send -i -f luna://com.webos.service.bluetooth2/mesh/provision '{"uuid":"1ef4354ffbbe43b5a8a7fbe94ec7746d", "subscribe":true}'
Response:
{
"subscribed": true,
"returnValue": true,
"adapterAddress": "b8:27:eb:fa:92:76"
}
Subscription Response:
{
"subscribed": true,
"returnValue": true,
"uuid": "1ef4354ffbbe43b5a8a7fbe94ec7746d",
"adapterAddress": "b8:27:eb:fa:92:76",
"request": "promptStatic"
}
{
"subscribed": true,
"returnValue": true,
"uuid": "1ef4354ffbbe43b5a8a7fbe94ec7746d",
"adapterAddress": "b8:27:eb:fa:92:76",
"request": "endProvision",
"unicastAddress": 171
}
API level 14
Removes the node from the network.
Multiple nodes can be removed by calling this API multiple times. After the required nodes are removed from the mesh network, key refresh procedure for the corresponding app keys and net key must be initiated by the application using mesh/keyRefresh API to avoid compromising network security.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | The address of the adapter. Note: If not specified, the default adapter is used. |
bearer | Optional | String | The underlying bearer to use. Possible values are:
|
primaryElementAddress | Required | Number | Unicast address of the primary element of the node to be removed from the network. Valid Range: 1 to 32767. Note: Removing local node not allowed |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | The reason for the failure of the operation. See the 'Error Codes' section of this method for details. |
adapterAddress | Required | String | The address of the adapter. |
primaryElementAddress | Required | Number | Unicast address of the node which is removed from the network. |
Error Code | Error Text | Error Description |
---|---|---|
5 | The requested operation is not supported by the stack or device | Error if the bearer is not supported by the Bluetooth stack. |
6 | Invalid value passed for one of the parameters | Invalid value passed for one of the parameters |
17 | Performed operation is not allowed | Performed operation is not allowed |
327 | Mesh network is not created | Mesh network is not created |
333 | Supplied node Address does not exist or is invalid | Supplied node Address does not exist or is invalid |
334 | Required 'primaryElementAddress' parameter missing | Required 'primaryElementAddress' parameter missing |
Example : Remove node
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/mesh/removeNode '{"primaryElementAddress":170}'
Response:
{
"adapterAddress":"b8:27:eb:fa:92:76",
"returnValue":true,
"primaryElementAddress":170
}
API level 13
Scans for mesh devices to provision when the local node is provisioner.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | The address of the adapter to be used. |
bearer | Optional | String | The underlying bearer to use. Possible values are:
|
scanTimeout | Optional | Number (uint16_t) | Scan timeout in seconds. The scan continues until mesh/unprovisionedScanCancel is called or for scanTimeout seconds (if non-zero). Default value: 20 sec |
subscribe | Required | Boolean | Subscribe for notifications on changes. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | The reason for the failure of the operation. |
adapterAddress | Required | String | The address of the adapter. |
subscribed | Required | Boolean | Indicates if subscribed to get notifications. |
devices | Required | Object array: BleMeshUnprovisionedDevice | Array of BLE Mesh devices that are known to the system and that are not yet provisioned by the system. Note: Contains information for all the devices known to the system. |
device | Required | Object: BleMeshUnprovisionedDevice | BLE Mesh device that is known to the system and that is not yet provisioned by the system. Note: Contains information of only a single device detected in the scan environment during the mesh/scanUnprovisionedDevices API call. The device is listed for the following reasons: New device detected in the scan environment. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | The reason for the failure of the operation. |
adapterAddress | Required | String | The address of the adapter. |
subscribed | Required | Boolean | Indicates if subscribed to get notifications. |
devices | Required | Object array: BleMeshUnprovisionedDevice | Array of BLE Mesh devices that are known to the system and that are not yet provisioned by the system. Note: Contains information for all the devices known to the system. |
device | Required | Object: BleMeshUnprovisionedDevice | BLE Mesh device that is known to the system and that is not yet provisioned by the system. Note: Contains information of only a single device detected in the scan environment during the mesh/scanUnprovisionedDevices API call. The device is listed for the following reasons: New device detected in the scan environment. |
Error Code | Error Text | Error Description |
---|---|---|
1, 4, 6, 17, 38, 41,101, 103 | See API Error Codes section for reference | See API Error Codes section for reference |
Example
# luna-send -i -f luna://com.webos.service.bluetooth2/mesh/scanUnprovisionedDevices '{"scanTimeout":10, "subscribe":true}'
Response:
{
"subscribed": true,
"returnValue": true,
"adapterAddress": "b8:27:eb:fa:92:76",
"devices": [
]
}
Subscription Response:
{
"subscribed": true,
"returnValue": true,
"adapterAddress": "b8:27:eb:fa:92:76",
"devices": [
{
"uuid": "1ef4354ffbbe43b5a8a7fbe94ec7746d",
"rssi": -32
}
],
"device": {
"uuid": "1ef4354ffbbe43b5a8a7fbe94ec7746d",
"rssi": -32
}
}
API level 13
Provides decimal number for authentication during provisioning; when "request" = "promptNumeric" in the subscription response of mesh/provision API.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | The address of the adapter to be used. |
bearer | Optional | String | The underlying bearer to use. Possible values are:
|
number | Required | Number | The numeric data. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | The reason for the failure of the operation. |
adapterAddress | Required | String | The address of the adapter. |
Error Code | Error Text | Error Description |
---|---|---|
1, 6, 17, 41, 101 | See API Error Codes section for reference | See API Error Codes section for reference |
42 | Provisioning not started | Provisioning not started |
43 | Provisioning authentication not started | Provisioning authentication not started |
323 | Required 'number' parameter is missing | Required 'number' parameter is missing |
Example
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/mesh/supplyProvisioningNumeric '{"number":1234}'
Response:
{
"adapterAddress": "b8:27:eb:fa:92:76",
"returnValue": true
}
API level 13
Supplies the static OOB data required during provision; when "request" = "promptStatic" in the subscription response of mesh/provision API.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | The address of the adapter to be used. |
bearer | Optional | String | The underlying bearer to use. Possible values are:
|
oobData | Required | String | The static OOB data which is 16 octet byte array. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | The reason for the failure of the operation. |
adapterAddress | Required | String | The address of the adapter. |
Error Code | Error Text | Error Description |
---|---|---|
1, 6, 17, 41, 101 | See API Error Codes section for reference | See API Error Codes section for reference |
42 | Provisioning not started | Provisioning not started |
43 | Provisioning authentication not started | Provisioning authentication not started |
324 | Required 'oobData' parameter is missing | Required 'oobData' parameter is missing |
Example
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/mesh/supplyProvisioningOob '{"oobData":"6E6F726469635F6578616D706C655F31"}'
Response:
{
"adapterAddress": "b8:27:eb:fa:92:76",
"returnValue": true
}
API level 13
Cancels scanning for unprovisioned BLE mesh devices.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | The address of the adapter to be used. |
bearer | Optional | String | The underlying bearer to use. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | The reason for the failure of the operation. |
adapterAddress | Required | String | The address of the adapter. |
Error Code | Error Text | Error Description |
---|---|---|
1, 6, 17, 38, 41, 101 | See API Error Codes section for reference | See API Error Codes section for reference |
Example
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/mesh/unprovisionedScanCancel '{}'
Response:
{
"adapterAddress": "b8:27:eb:fa:92:76",
"returnValue": true
}
API level 11
Accept a Bluetooth object push request. This method is available only for a push server.
Name | Required | Type | Description |
---|---|---|---|
requestId | Required | String | The unique ID of a request. |
adapaterAddress | Optional | String | The address of the adapter executing this method. If not specified, the default adapter will be used. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
adapterAddress | Required | String | The address of the adapter the operation was performed on. If adapterAddress input parameter was not specified, the address of the default adapter will be returned. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
errorCode | Optional | Number | The error code for the failed operation. |
Error Code | Error Text | Error Description |
---|---|---|
127, 143, 144 | See API Error Codes Reference | See API Error Codes Reference. |
155 | Transfers are currently not allowed | OPP file transfers from the remote Bluetooth device are currently not allowed. |
156 | Required 'requestId' parameter is not supplied | The requestId parameter is mandatory to this method, but was not supplied by the caller of the method. |
157 | Failed to retrieve state for remote device | The confirmation of object push request from remote Bluetooth device failed. |
158 | The requestId does not exist | The supplied requestId does not exist, hence the method cannot be completed. |
159 | These pushRequest already received the file | The confirmation of object push request from remote Bluetooth device is already done. |
Example code
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/opp/acceptTransferRequest '{"requestId":"001"}'
Response:
{
"returnValue":true,
"adapterAddress":"00:00:45:0e:48:9b"
}
API level 11
Await incoming transfer requests from push clients. This method is available only for a push server.
Name | Required | Type | Description |
---|---|---|---|
subscribe | Required | Boolean | Subscribe and get notifications. Possible values are:
Note: The caller MUST subscribe to this method. |
adapterAddress | Optional | String | The address of the adapter executing this method. If not specified, the default adapter will be used. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
adapterAddress | Required | String | The address of the adapter the operation was performed on. If adapterAddress input parameter was not specified, the address of the default adapter will be returned. |
subscribed | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
Since subscription ends only when the client chooses to close it, subscribed will always contain true. |
request | Optional | Object: bluetooth2PushRequest | A request information including request ID, client name, client address, file name, and file size. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
errorCode | Optional | Number | The error code for the failed operation. |
Error Code | Error Text | Error Description |
---|---|---|
101, 103, 104, 143, 144 | See API Error Codes Reference | See API Error Codes Reference. |
161 | Adapter is turned off | The Bluetooth adapter is turned off. |
Example code
# luna-send -i -f luna://com.webos.service.bluetooth2/opp/awaitTransferRequest '{ "subscribe":true }'
Response:
{
"subscribed":true,
"returnValue":true,
"adapterAddress":"00:00:45:0e:48:9b"
}
Subscription return: If remote device sends file to OPP server
{
"request":{
"requestId":"001",
"address":"34:4d:f7:f9:52:f7",
"fileSize":3909991,
"fileName":"20150411_162012.jpg",
"name":"Jone Doe's G3"
}
}
API level 11
Cancel an ongoing file transfer. This method is available only for a push server. In a client side, LSCallCancel() is used to cancel the transfer.
Name | Required | Type | Description |
---|---|---|---|
requestId | Required | String | The unique ID of a request. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
errorCode | Optional | Number | The error code for the failed operation. |
Error Code | Error Text | Error Description |
---|---|---|
127, 143, 144 | See API Error Codes Reference | See API Error Codes Reference. |
155 | Transfers are currently not allowed | OPP file transfers from the remote Bluetooth device are currently not allowed. |
156 | Required 'requestId' parameter is not supplied | The requestId parameter is mandatory to this method, but was not supplied by the caller of the method. |
157 | Failed to retrieve state for remote device | The confirmation of object push request from remote Bluetooth device failed. |
158 | The requestId does not exist | The supplied requestId does not exist, hence the method cannot be completed. |
Example code
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/opp/cancelTransfer '{ "requestId":"001" }'
Response:
{
"returnValue":true
}
API level 11
Open (or initialize) an OPP connection to a remote Bluetooth device.
In some cases of such as using BSA stack, only initialization of OPP capability is done by this method and the actual Bluetooth connection is created through the opp/pushFile method.
If the client calls LSCallCancel(), the connection is closed and OPP setup is deinitialized (the opp/disconnect method also can be used for the disconnection). This method is available only for a push client.
Name | Required | Type | Description |
---|---|---|---|
address | Required | String | The address (bdaddr) of the remote device. |
subscribe | Optional | Boolean | Subscribe and get notified when connection is closed. Possible values are:
Default value: false |
Name | Required | Type | Description |
---|---|---|---|
subscribed | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
errorCode | Optional | Number | The error code for the failed operation. |
Name | Required | Type | Description |
---|---|---|---|
disconnectByRemote | Required | String | Indicates whether the remote device or local user initiated the disconnect. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
returnValue | Required | Boolean |
|
subscribed | Required | Boolean |
|
Error Code | Error Text | Error Description |
---|---|---|
102, 103, 105, 106, 127, 143, 144 | See API Error Codes Reference | See API Error Codes Reference. |
128 | Device is already connecting | The remote Bluetooth device is already connecting to OPP profile, so another connection cannot be open. |
130 | Failed to connect with remote device | The remote Bluetooth device cannot be connected to the OPP profile. |
131 | Already connected | The remote Bluetooth device is already connected to the adapter's OPP profile, so another connection cannot be open. |
Example code
luna-send -i -f luna://com.webos.service.bluetooth2/opp/connect
'{
"address":"34:4d:f7:f9:52:f7",
"subscribe":true
}'
Example response for a successful call:
{
"subscribed": true,
"adapterAddress": "00:00:c5:99:f5:87",
"returnValue": true
}
Example response for a failed call: If address is not valid,
{
"errorCode": 106,
"returnValue": false,
"errorText": "Device with supplied address is not available"
}
Subscription return: If connection is successful,
{
"subscribed": true,
"adapterAddress": "00:00:c5:99:f5:87",
"returnValue": true
}
API level 11
Close (or deinitialize) the connection to the given remote device on OPP profile.
In some cases of such as using BSA stack, this method performs only deinitialization of the OPP-related setup and the actual Bluetooth connection is dropped after finishing file transfer. This method is available only for a push client.
Name | Required | Type | Description |
---|---|---|---|
address | Required | String | The address (bdaddr) of the remote device. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | If the connection is successfully closed (or deinitialized), returnValue will contain true. Otherwise, returnValue will contain false. |
errorText | Optional | String | errorText contains the error text if the method fails. The method will return errorText only if it fails. See the Error Codes Reference of this method for more details. |
errorCode | Optional | Number | errorCode contains the error code if the method fails. The method will return errorCode only if it fails. See the Error Codes Reference of this method for more details. |
Error Code | Error Text | Error Description |
---|---|---|
102, 105, 106, 127, 143, 144 | See API Error Codes Reference | See API Error Codes Reference. |
132 | Failed to disconnect from remote device | The OPP connection with the remote Bluetooth device could not be closed. |
Example code
luna-send -n 1 luna://com.webos.service.bluetooth2/opp/disconnect
'{
"address":"34:4d:f7:f9:52:f7"
}'
Example response for a successful call:
{
"adapterAddress":"00:00:1c:93:51:b8",
"returnValue":true
}
Example response for a failed call: If address is not valid,
{
"errorCode": 106,
"returnValue": false,
"errorText": "Device with supplied address is not available"
}
Subscription return: If disconnection is successful,
{
"adapterAddress":"00:00:1c:93:51:b8",
"returnValue":true
}
API level 11
Return the status of an OPP connection to a remote Bluetooth device. This method is available for both of client and server.
Name | Required | Type | Description |
---|---|---|---|
address | Required | String | The address (bdaddr) of the remote device. |
subscribe | Optional | Boolean |
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean |
|
connecting | Required | Boolean |
|
connected | Required | Boolean |
|
errorText | Optional | String | errorText contains the error text if the method fails. The method will return errorText only if it fails. See the Error Codes Reference of this method for more details. |
errorCode | Optional | Number | errorCode contains the error code if the method fails. The method will return errorCode only if it fails. See the Error Codes Reference of this method for more details. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean |
|
subscribed | Required | Boolean |
|
connecting | Required | Boolean |
|
connected | Required | Boolean |
|
errorText | Optional | String | errorText contains the error text if the method fails. The method will return errorText only if it fails. See the Error Codes Reference of this method for more details. |
errorCode | Optional | Number | errorCode contains the error code if the method fails. The method will return errorCode only if it fails. See the Error Codes Reference of this method for more details. |
Error Code | Error Text | Error Description |
---|---|---|
102, 105, 106, 127, 143, 144 | See API Error Codes Reference | See API Error Codes Reference. |
133 | Failed to retrieve state for remote device | The OPP connection status of the remote Bluetooth device cannot be retrieved. |
Example code
luna-send -i -f luna://com.webos.service.bluetooth2/opp/getStatus
'{
"address":"34:4d:f7:f9:52:f7",
"subscribe":true
}'
Example response for a successful call:
{
"adapterAddress": "00:00:1c:93:51:b8",
"connected": false,
"subscribed": true,
"returnValue": true,
"connecting": false
}
Example response for a failed call: If address is not valid,
{
"errorCode": 106,
"returnValue": false,
"errorText": "Device with supplied address is not available"
}
Subscription return: If user connects to remote device, connected field is changed from false to true when remote device is connected.
{
"adapterAddress": "00:00:1c:93:51:b8",
"connected": false,
"subscribed": true,
"returnValue": true,
"connecting": true
}
{
"adapterAddress": "00:00:1c:93:51:b8",
"connected": true,
"subscribed": true,
"returnValue": true,
"connecting": false
}
Subscription return : If user disconnects the connected device,
{
"subscribed": false,
"disconnectByRemote": true,
"returnValue": false
}
API level 11
Return the status of ongoing file transfer requests. This method is only available for server.
Name | Required | Type | Description |
---|---|---|---|
subscribe | Required | Boolean | Must set subscribe to true. |
adapterAddress | Optional | String | The address of the adapter executing this method call. If not specified, the default adapter will be used. |
Name | Required | Type | Description |
---|---|---|---|
subscribed | Required | Boolean | subscribed will always contain true since subscription ends only when the client chooses to close it. |
returnValue | Required | Boolean |
|
adapterAddress | Required | String | The address of the adapter the operation was performed on. If adapterAddress input parameter was not specified, the address of the default adapter will be returned. |
transfers | Optional | Object array: bluetooth2PushRequest | Request information including data size transferred so far. |
errorText | Optional | String | errorText contains the error text if the method fails. The method will return errorText only if it fails. See the Error Codes Reference of this method for more details. |
errorCode | Optional | Number | errorCode contains the error code if the method fails. The method will return errorCode only if it fails. See the Error Codes Reference of this method for more details |
Error Code | Error Text | Error Description |
---|---|---|
101, 103, 143, 144 | See API Error Codes Reference | See API Error Codes Reference. |
161 | Adapter is turned off | The Bluetooth adapter is turned off. |
Example code
luna-send -i -f luna://com.webos.service.bluetooth2/opp/monitorTransfer
'{
"subscribe":true
}'
Example response for a successful call:
{
"subscribed": true,
"returnValue": true,
"adapterAddress": "00:00:45:0e:48:9b"
}
Example response for a failed call: If subscribe parameter is not used,
{
"errorCode": 103,
"returnValue": false,
"errorText": "Method needs to be subscribed"
}
Subscription return: If file transfer is on going,
{
"subscribed": true,
"returnValue": true,
"adapterAddress": "00:00:45:0e:48:9b",
"transfers": [
{
"transferred": 32693,
"requestId": "002",
"address": "34:4d:f7:f9:52:f7",
"fileSize": 73805,
"fileName": "001.jpg",
"name": "Jone Doe's G3"
}
]
}
{
"subscribed": true,
"returnValue": true,
"adapterAddress": "00:00:45:0e:48:9b",
"transfers": [
{
"transferred": 65386,
"requestId": "002",
"address": "34:4d:f7:f9:52:f7",
"fileSize": 73805,
"fileName": "001.jpg",
"name": "Jone Doe's G3"
}
]
}
{
"subscribed": true,
"returnValue": true,
"adapterAddress": "00:00:45:0e:48:9b",
"transfers": [
{
"transferred": 73805,
"requestId": "002",
"address": "34:4d:f7:f9:52:f7",
"fileSize": 73805,
"fileName": "001.jpg",
"name": "Jone Doe's G3"
}
]
}
API level 11
Push a file to a remote Bluetooth device. This method is available only for push client. If the client calls LSCallCancel(), the file transfer is cancelled.
Name | Required | Type | Description |
---|---|---|---|
address | Required | String | The address (bdaddr) of the remote device. |
sourceFile | Required | String | Absolute path of the source file, rooted at /media/internal. |
subscribe | Optional | Boolean |
|
adapterAddress | Optional | String | The address of the adapter executing this method. If not specified, the default adapter will be used. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean |
|
adapterAddress | Required | String | The address of the adapter the operation was performed on. If adapterAddress input parameter was not specified, the address of the default adapter will be returned. |
subscribed | Required | Boolean |
|
errorText | Optional | String | errorText contains the error text if the method fails. The method will return errorText only if it fails. See the Error Codes Reference of this method for more details. |
errorCode | Optional | Number | errorCode contains the error code if the method fails. The method will return errorCode only if it fails. See the Error Codes Reference of this method for more details |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean |
|
adapterAddress | Required | String | The address of the adapter the operation was performed on. If adapterAddress input parameter was not specified, the address of the default adapter will be returned. |
subscribed | Required | Boolean |
|
transferred | Optional | Number | Number of bytes transferred so far. |
size | Optional | Number | Size in bytes of the source file. |
errorText | Optional | String | errorText contains the error text if the method fails. The method will return errorText only if it fails. See the Error Codes Reference of this method for more details. |
errorCode | Optional | Number | errorCode contains the error code if the method fails. The method will return errorCode only if it fails. See the Error Codes Reference of this method for more details. |
Error Code | Error Text | Error Description |
---|---|---|
105, 106, 137, 143, 144 | See API Error Codes Reference | See API Error Codes Reference. |
142 | Supplied file does not exist or is invalid | The supplied source file path either does not exist at /media/internal on the device or is invalid. Hence the push operation cannot be completed. |
154 | Device is not connected | The remote Bluetooth device is not connected to our Bluetooth adapter via the OPP profile. |
Example code
luna-send -i -f luna://com.webos.service.bluetooth2/opp/pushFile
'{
"address":"34:4d:f7:f9:52:f7",
"sourceFile":"music.mp3",
"subscribe":true
}'
Example response for a successful call:
subscription return
{
"transferred": 0,
"subscribed": true,
"returnValue": true,
"adapterAddress": "00:00:45:0e:48:9b"
}
Example response for a failed call: If subscribe parameter is not used,
{
"errorCode": 103,
"returnValue": false,
"errorText": "Method needs to be subscribed"
}
Subscription return: If file transfer starts, subscription return comes immediately.
{
"transferred": 0,
"subscribed": true,
"returnValue": true,
"adapterAddress": "00:00:45:0e:48:9b"
}
{
"transferred": 32693,
"size": 4983744,
"subscribed": true,
"returnValue": true,
"adapterAddress": "00:00:45:0e:48:9b"
}
{
"transferred": 65386,
"size": 4983744,
"subscribed": true,
"returnValue": true,
"adapterAddress": "00:00:45:0e:48:9b"
}
..............................................................................
{
"transferred": 4983744,
"size": 4983744,
"subscribed": true,
"returnValue": true,
"adapterAddress": "00:00:45:0e:48:9b"
}
{
"transferred": 4983744,
"size": 4983744,
"subscribed": false,
"returnValue": true,
"adapterAddress": "00:00:45:0e:48:9b"
}
API level 11
Reject a Bluetooth object push request. This method is available only for a push server.
Name | Required | Type | Description |
---|---|---|---|
requestId | Required | String | The unique ID of a request. |
adapterAddress | Optional | String | The address of the adapter executing this method. If not specified, the default adapter will be used. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean |
|
adapterAddress | Required | String | The address of the adapter the operation was performed on. If adapterAddress input parameter was not specified, the address of the default adapter will be returned. |
errorText | Optional | String | errorText contains the error text if the method fails. The method will return errorText only if it fails. See the Error Codes Reference of this method for more details. |
errorCode | Optional | Number | errorCode contains the error code if the method fails. The method will return errorCode only if it fails. See the Error Codes Reference of this method for more details. |
Error Code | Error Text | Error Description |
---|---|---|
127, 143, 144 | See API Error Codes Reference | See API Error Codes Reference. |
155 | Transfers are currently not allowed | OPP file transfers from the remote Bluetooth device are currently not allowed. |
156 | Required 'requestId' parameter is not supplied | The requestId parameter is mandatory to this method, but was not supplied by the caller of the method. |
157 | Failed to retrieve state for remote device | The confirmation of object push request from remote Bluetooth device failed. |
158 | The requestId does not exist | The supplied requestId does not exist, hence the accept operation cannot be completed. |
159 | These pushRequest already received the file | The confirmation of object push request from remote Bluetooth device is already done. |
Example code
luna-send -n 1 -f luna://com.webos.service.bluetooth2/opp/rejectTransferRequest '{"requestId":"001"}'
'{
"requestId":"001"
}'
Example response for a successful call: If OPP server awaits for file transfer,
{
"returnValue": true,
"adapterAddress": "00:00:45:0e:48:9b"
}
Example response for a failed call: If requestId is not valid,
{
"errorCode": 158,
"returnValue": false,
"errorText": "The requestId does not exist"
}
API level 12
Connects to the PBAP profile on the specified remote device.
Note: This method is available only for PCE.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
address | Required | String | Indicates the address of the remote device. |
subscribe | Optional | Boolean | Indicates if subscribed to get notifications. Possible values are:
Default: false |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
subscribed | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
adapterAddress | Required | String | Indicates the address of the adapter. |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
address | Required | String | Indicates the address of the remote device. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
subscribed | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
disconnectByRemote | Required | String | Indicates whether the remote device or the local user initiated the disconnect. Possible values are:
|
adapterAddress | Required | String | Indicates the address of the adapter. |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
address | Required | String | Indicates the address of the remote device. |
Error Code | Error Text | Error Description |
---|---|---|
102, 103, 105, 106, 127, 143, 144 | See API Error Codes Reference | See API Error Codes Reference. |
128 | Device is already connecting | Indicates that the remote Bluetooth device is already connected to the PBAP profile, hence another connection cannot be opened. |
129 | Device is not paired | Indicates that the remote Bluetooth device is not paired, hence PBAP profile connection cannot be opened. |
130 | Failed to connect with remote device | Indicates that the remote Bluetooth device cannot be connected to PBAP profile. |
131 | Already connected | Indicates that the remote Bluetooth device is already connected to the PBAP profile, hence another connection cannot be opened. |
Example code
# luna-send -i -f luna://com.webos.service.bluetooth2/pbap/connect '{
"address":"64:a2:f9:7e:e7:a7",
"subscribe":true
}'
Response:
{
"address": "64:a2:f9:7e:e7:a7",
"subscribed": true,
"adapterAddress": "00:1a:7d:da:71:10",
"returnValue": true
}
Subscription response:
{
"subscribed": false,
"adapterAddress": "00:1a:7d:da:71:10",
"address": "64:a2:f9:7e:e7:a7"
"disconnectByRemote": true,
"returnValue": true
}
API level 12
Disconnects from the PBAP profile on the specified remote device.
Note: This method is available only for PCE.
Name | Required | Type | Description |
---|---|---|---|
address | Required | String | Indicates the address (bdaddr) of the remote device. |
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
adapterAddress | Required | String | Indicates the address of the adapter. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
errorCode | Optional | Number | The error code for the failed operation. |
address | Required | String | Indicates the address (bdaddr) of the remote device. |
Error Code | Error Text | Error Description |
---|---|---|
102, 105, 106, 127, 143, 144 | See API Error Codes Reference | See API Error Codes Reference. |
132 | Failed to disconnect from remote device | Indicates that the PBAP connection with the remote Bluetooth device could not be closed. |
Example code
# luna-send -i -f luna://com.webos.service.bluetooth2/pbap/disconnect '{
"address":"aa:bb:cc:dd:ee:00"
}'
Response:
{
"adapterAddress":"11:22:33:44:55:66",
"address":"aa:bb:cc:dd:ee:00"
"returnValue":true
}
API level 12
Gets the supported PBAP profile properties from PSE device.
Note: This method is available only for PCE.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
address | Required | String | Indicates the address of the remote device. |
subscribe | Optional | Boolean | Indicates if subscribed to get notifications. Possible values are:
Default: false |
Name | Required | Type | Description |
---|---|---|---|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
address | Required | String | Indicates the address of the remote device. |
adapterAddress | Required | String | Indicates the address of the adapter. |
properties | Required | Object: bluetooth2PbapProperties | Returns the supported properties from the PSE device. Note: Properties will return only when the repository is selected else properties will be updated in subscription return. |
subscribed | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
Default: false |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
properties | Optional | Object: bluetooth2PbapProperties | Returns supported properties from the PSE device. |
adapterAddress | Required | String | Indicates the address of the adapter. |
address | Required | String | Indicates the address of the remote device. |
subscribed | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
Error Code | Error Text | Error Description |
---|---|---|
1,17,101,102,105,106,127,143,144 | See API Error Codes Reference | See API Error Codes Reference. |
136 | Device is not connected to profile | The device is not connected to PBAP profile. |
Example code
# luna-send -i -f luna://com.webos.service.bluetooth2/pbap/getPhoneBookProperties '{
"adapterAddress":"b8:27:eb:13:68:c0",
"address":"64:a2:f9:7e:e7:a7",
"subscribe":true
}'
Response:
{
"adapterAddress":"b8:27:eb:13:68:c0",
"address":"64:a2:f9:7e:e7:a7",
"subscribed":true,
"returnValue":true
}
Subscription Response :
{
"adapterAddress":"b8:27:eb:13:68:c0",
"address":"64:a2:f9:7e:e7:a7",
"properties":{
"secondaryVersionCounter":"00000000000000000000000000004AB1",
"repository":"/telecom/pb",
"primaryVersionCounter":"00000000000000000000000000007F53",
"databaseIdentifier":"0000000000000000000001718279836B",
"fixedImageSize":true
},
"subscribed":true,
"returnValue":true
}
API level 12
Gets the total number of vcf entries from the selected phonebook path.
Note: This method is available only for PCE.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
address | Required | String | Indicates the address of the remote device. |
Name | Required | Type | Description |
---|---|---|---|
errorCode | Optional | Number | Indicates the error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
size | Required | Number | Indicates the total number of vcf entries in the selected phonebook path. |
adapterAddress | Required | String | Indicates the address of the adapter. |
address | Required | String | Indicates the address of the remote device. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
Error Code | Error Text | Error Description |
---|---|---|
1, 17, 101, 102, 105, 127, 143, 144 | See API Error Codes Reference | See API Error Codes Reference. |
23 | No repository is selected | No repository is selected, call PBAP/setPhoneBook method before the folder section. |
136 | Device is not connected to profile | Device is not connected to PBAP profile. |
Example code
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/pbap/getSize '{
"adapterAddress":"b8:27:eb:13:68:c0",
"address":"64:a2:f9:7e:e7:a7"
}'
Response:
{
"size": 2035,
"adapterAddress": "b8:27:eb:13:68:c0",
"address": "64:a2:f9:7e:e7:a7",
"returnValue": true
}
API level 12
Returns the status of a PBAP connection to a remote Bluetooth device.
Note: The method is available for both client and server.
Name | Required | Type | Description |
---|---|---|---|
address | Required | String | Indicates the address (bdaddr) of the remote device. |
subscribe | Optional | Boolean | Indicates if subscribed to get the notifications. Possible values are:
Default: false. |
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
connecting | Required | Boolean | Indicates the status of connection. Possible values are:
|
connected | Required | Boolean | Indicates if the connection is open. Possible values are:
|
adapterAddress | Required | String | Indicates the address of the adapter. |
subscribed | Required | Boolean | Indicates if subscribed to get the notifications. Possible values are:
|
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
errorCode | Optional | Number | Indicates the error code for the failed operation. |
address | Required | String | Indicates the address (bdaddr) of the remote device. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
subscribed | Required | Boolean | Indicates if subscribed to get the notifications. Possible values are:
|
connecting | Required | Boolean | Indicates the status of connection. Possible values are:
|
connected | Required | Boolean | Indicates if the connection is open. Possible values are:
|
adapterAddress | Required | String | Indicates the address of the adapter. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
errorCode | Optional | Number | Indicates the error code for the failed operation. |
address | Required | String | Indicates the address (bdaddr) of the remote device. |
Error Code | Error Text | Error Description |
---|---|---|
102, 105, 106, 127, 143, 144 | See API Error Codes Reference | See API Error Codes Reference. |
185 | Failed to retrieve state for remote device | The PBAP connection status of the remote Bluetooth device cannot be retrieved. |
Example code
# luna-send -i -f luna://com.webos.service.bluetooth2/pbap/getStatus '{
"address":"70:bb:e9:7e:c2:7d",
"subscribe":true
}'
Subscription return: If user connects to remote device, connected field is changed from false to true when remote device is connected.
Response:
{
"adapterAddress":"5c:f3:70:94:25:d4",
"address":"70:bb:e9:7e:c2:7d",
"connected":false,
"subscribed":true,
"returnValue":true,
"connecting":true
}
{
"adapterAddress":"5c:f3:70:94:25:d4",
"address":"70:bb:e9:7e:c2:7d",
"connected":true,
"subscribed":true,
"returnValue":true,
"connecting":false
}
API level 12
Displays all the available vcard filters supported by Bluetooth stack.
Note: The method is available only for PCE.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
address | Required | String | Indicates the address (bdaddr) of the remote device. |
Name | Required | Type | Description |
---|---|---|---|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
adapterAddress | Required | String | Indicates the address of the adapter. |
address | Required | String | Indicates the address of the remote device. |
filters | Required | String array | Returns a list of supported vCard filters. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
Error Code | Error Text | Error Description |
---|---|---|
1, 17, 101, 102, 105, 106, 127, 143, 144 | See API Error Codes Reference | See API Error Codes Reference. |
136 | Device is not connected to profile | The device is not connected to the PBAP profile. |
Example code
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/pbap/getvCardFilters '{
"adapterAddress":"b8:27:eb:13:68:c0",
"address":"64:a2:f9:7e:e7:a7"
}'
Response:
{
"adapterAddress":"b8:27:eb:13:68:c0",
"address":"64:a2:f9:7e:e7:a7",
"returnValue":true,
"filters":[
"VERSION",
"FN",
"N",
"PHOTO",
"BDAY",
"ADR",
"LABEL",
"TEL",
"EMAIL",
"MAILER",
"TZ",
"GEO",
"TITLE",
"ROLE",
"LOGO",
"AGENT",
"ORG",
"NOTE",
"REV",
"SOUND",
"URL",
"UID",
"KEY",
"NICKNAME",
"CATEGORIES",
"PROID",
"CLASS",
"SORT-STRING",
"X-IRMC-CALL-DATETIME",
"X-BT-SPEEDDIALKEY",
"X-BT-UCI",
"X-BT-UID"
]
}
API level 12
Retrieves all (given maxcount) the phonebook entries from a given startoffset and stores it in a local file.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
address | Required | String | Indicates the address (bdaddr) of the remote device. |
subscribe | Required | Boolean | Indicates if the user is subscribed to get the notifications. Possible values are:
Default: false |
destinationFile | Required | String | Indicates the absolute path of the destination file rooted at /media/internal/pbap. Note: This must be a path to a file, not a directory. Example: /media/internal/pbap/<device-address>/<foldername>/<vcf file name> |
startOffset | Optional | Number | Indicates the Offset of the first item. Default: 0 |
maxListCount | Optional | Number | Indicates the maximum number of items. Default: unlimited (65535) |
vCardVersion | Optional | String | Indicates the vCard format versions. Possible values are:
Default: 2.1 |
filterFields | Optional | String array | Provide vCard with fields as specified in the filter.
Note:
|
Name | Required | Type | Description |
---|---|---|---|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
address | Required | String | Indicates the address of the remote device. |
adapterAddress | Required | String | Indicates the address of the adapter. |
destinationFile | Required | String | Indicates the absolute path of the destination file rooted at /media/internal/pbap. Note: This must be a path to a file, not a directory. Example: /media/internal/pbap/<device-address>/<foldername>/<vcf file name> |
subscribed | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
adapterAddress | Required | String | Indicates the address of the adapter. |
address | Required | String | Indicates the address of the remote device for the requested operation. |
destinationFile | Required | String | Indicates the absolute path of the destination file rooted at /media/internal/pbap. Note: This must be a path to a file, not a directory. Example: /media/internal/pbap/<device-address>/<foldername>/<vcf file name> |
status | Required | String | Indicates the status of the phonebook download. Possible values are :
|
subscribed | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
returnValue | Required | Number | Indicates the status of the operation. Possible values are:
|
Error Code | Error Text | Error Description |
---|---|---|
1, 6, 17, 101, 102, 105, 127, 143, 144 | See API Error Codes Reference | See API Error Codes Reference. |
23 | No repository is selected | No repository is selected, call PBAP/setPhoneBook method to select the repository. |
136 | Device is not connected to profile | The device is not connected to PBAP profile. |
139 | Supplied destination path does not exist or is invalid | The supplied destination file path either does not exist at /media/internal on the device or is invalid, hence the pull operation cannot be completed. |
Example code
# luna-send -i -f luna://com.webos.service.bluetooth2/pbap/pullPhoneBook '{
"adapterAddress":"5c:f3:70:87:3a:89",
"address":"98:09:cf:15:4e:67",
"destinationFile":"mycontacts.vcf",
"subscribe":true
}'
Response:
{
"subscribed": true,
"adapterAddress": "5c:f3:70:87:3a:89",
"destinationFile": "/media/internal/pbap/70_bb_e9_7e_c2_7d/internal/pb/mycontacts.vcf",
"address": "98:09:cf:15:4e:67",
"returnValue": true
}
Subscription Response :
{
"adapterAddress":"5c:f3:70:87:3a:89",
"address":"98:09:cf:15:4e:67",
"destinationFile":"/media/internal/pbap/70_bb_e9_7e_c2_7d/internal/pb/mycontacts.vcf",
"subscribed":true,
"status":"idle",
"returnValue": true
}
{
"adapterAddress":"5c:f3:70:87:3a:89",
"address":"98:09:cf:15:4e:67",
"destinationFile":"/media/internal/pbap/70_bb_e9_7e_c2_7d/internal/pb/mycontacts.vcf",
"subscribed":true,
"status":"active",
"returnValue": true
}
{
"adapterAddress":"5c:f3:70:87:3a:89",
"address":"98:09:cf:15:4e:67",
"destinationFile":"/media/internal/pbap/70_bb_e9_7e_c2_7d/internal/pb/mycontacts.vcf",
"subscribed":false,
"status":"completed",
"returnValue": true
}
API level 12
Given a vcard handle, retrieves the vcard in the current phonebook object and store it in a local file.
Note: This method is available only for PCE.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
address | Required | String | Indicates the address of the remote device. |
destinationFile | Optional | String | Indicates destination file name. Note: If not provided, it will be set as vCardHandle. |
vCardHandle | Required | String | Indicates vCard handle for vcf file. |
vCardVersion | Optional | String | Indicates vCard format version. Possible values are :
Default: 2.1 |
filterFields | Optional | String array | Provides vCard with fields as specified in the filter.
Note:
|
Name | Required | Type | Description |
---|---|---|---|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
adapterAddress | Required | String | Indicates the address of the adapter. |
address | Required | String | Indicates the address of the remote device. |
destinationFile | Required | String | Indicates the absolute path of the destination file rooted at /media/internal/pbap. Note: This must be a path to a file and not a directory. Example: /media/internal/pbap/<device-address>/<repository>/<vcf file name>. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
Error Code | Error Text | Error Description |
---|---|---|
1, 6, 17, 101, 102, 105, 127, 143, 144 | See API Error Codes Reference | See API Error Codes Reference. |
136 | Device is not connected to profile | The device is not connected to PBAP profile. |
139 | Supplied destination path does not exist or is invalid | The supplied destination file path either does not exist at /media/internal on the device or is invalid, hence the pull operation cannot be completed. |
293 | Required 'vCardHandle' parameter is not supplied | Required vCardHandle parameter is not supplied |
Example code
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/pbap/pullvCard '{
"adapterAddress":"b8:27:eb:13:68:c0",
"address":"64:a2:f9:7e:e7:a7",
"vCardHandle":"123.vcf",
"vCardVersion":"2.1",
"filterFields":[
"BDAY",
"FN"
]
}'
Response:
{
"adapterAddress":"b8:27:eb:13:68:c0",
"address":"64:a2:f9:7e:e7:a7",
"destinationFile":"/media/internal/pbap/64_a2_f9_7e_e7_a7/internal/ich/123.vcf",
"returnValue":true
}
API level 12
Searches for entries matching the given condition and returns an object of vcard-listing data where every entry consists of a pair of strings containing the vcard handle and the contact name.
Note: This method is available only for PCE.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
address | Required | String | Indicates the address of the remote device. |
order | Optional | String | Displays the search results based on the given order. Possible values are:
|
filter | Required | Object: bluetooth2PbapSearchFilter | Filter with key & value pair to search the phonebook. |
Name | Required | Type | Description |
---|---|---|---|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
adapterAddress | Required | String | Indicates the address of the adapter. |
address | Required | String | Indicates the address of the remote device. |
vcfHandles | Required | Object: bluetooth2PbapVcfHandles | Returns vcf files entries with name and vcf handle from selected phone-book path. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
Error Code | Error Text | Error Description |
---|---|---|
1, 17, 101, 102, 105, 127, 143, 144 | See API Error Codes Reference | See API Error Codes Reference. |
23 | No repository is selected | No repository is selected, call PBAP/setPhoneBook method to select repository |
136 | Device is not connected to profile | The device is not connected to the PBAP profile. |
294 | Required 'filter' parameter is not supplied | The required 'filter' parameter is not supplied. |
Example code
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/pbap/searchPhoneBook '{
"adapterAddress":"b8:27:eb:13:68:c0",
"address":"64:a2:f9:7e:e7:a7",
"order":"indexed",
"filter":{
"key":"name",
"value":"LG"
}
}'
Response:
{
"adapterAddress":"b8:27:eb:13:68:c0",
"address":"64:a2:f9:7e:e7:a7",
"vcfHandles":[
{
"Name":"LG",
"Handle":"81164.vcf"
}
],
"returnValue":true
}
API level 12
Sets the phonebook object for other operations.
Note: This method is available only for PCE.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
address | Required | String | Indicates the address of the remote device required for the connection. |
repository | Required | String | Indicates the type of repository that stores the phonebook. Possible inputs :
Default: internal. |
object | Required | String | Indicates the path of the phonebook object. Possible inputs :
|
Name | Required | Type | Description |
---|---|---|---|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
address | Required | String | Indicates the address of the remote device. |
adapterAddress | Required | String | Indicates the address of the adapter. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
Error Code | Error Text | Error Description |
---|---|---|
1,6,17, 101, 102, 105, 127, 143, 144 | See API Error Codes Reference | See API Error Codes Reference. |
136 | Device is not connected to profile | The device is not connected to PBAP profile. |
290 | Required 'repository' parameter is not supplied | Required 'repository' parameter is not supplied. |
291 | Required 'object' parameter is not supplied | Required 'object' parameter is not supplied. |
Example code
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/pbap/setPhoneBook '{
"adapterAddress":"b8:27:eb:13:68:c0",
"address":"64:a2:f9:7e:e7:a7",
"repository":"internal",
"object":"pb"
}'
Response:
{
"adapterAddress":"b8:27:eb:13:68:c0",
"address":"64:a2:f9:7e:e7:a7",
"returnValue":true
}
API level 12
Displays the total number of vcf file entries from the selected phonebook path.
Note: This method is available only for PCE.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Optional | String | Indicates the address of the adapter. Note:
|
address | Required | String | Indicates the address of the remote device for the requested operation. |
Name | Required | Type | Description |
---|---|---|---|
errorCode | Optional | Number | Returns the error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
vcfHandles | Required | Object array: bluetooth2PbapVcfHandles | Returns vcf files entries with name and vcf handle from selected phonebook path. |
adapterAddress | Required | String | Indicates the address of the adapter. |
address | Required | String | Indicates the address of the remote device. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
Error Code | Error Text | Error Description |
---|---|---|
1, 17, 101, 102, 105, 127, 143, 144 | See API Error Codes Reference | See API Error Codes Reference. |
23 | No repository is selected | No repository is selected, call PBAP/setPhoneBook method before the folder section. |
136 | Device is not connected to profile | The device is not connected to the PBAP profile. |
Example code
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/pbap/vCardListing '{
"adapterAddress":"b8:27 :eb:13:68:c0",
"address":"64:a2:f9:7e:e7:a7"
}'
Response:
{
"adapterAddress":"b8:27:eb:13:68:c0",
"address":"64:a2:f9:7e:e7:a7",
"vcfHandles":[
{
"Name":"ASHISH PATEL",
"Handle":"0.vcf"
},
{
"Name":"Card No My",
"Handle":"23974.vcf"
},
{
"Name":"LG",
"Handle":"24155.vcf"
}
],
"returnValue":true
}
API level 11
Open a SPP connection to a remote Bluetooth device.
Name | Required | Type | Description |
---|---|---|---|
address | Required | String | The address (bdaddr) of the remote device. |
uuid | Required | String | The UUID used when the server application opens its SPP channel. |
subscribe | Optional | Boolean |
|
adapterAddress | Optional | String | The address of the adapter executing this method call. If not specified, the default adapter will be used. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean |
|
adapterAddress | Required | String | The address of the adapter the operation was performed on. If adapterAddress input parameter was not specified, the address of the default adapter will be returned. |
subscribed | Required | Boolean |
|
address | Required | String | The address (bdaddr) of the remote device. |
channelId | Optional | String | Unique ID of a SPP channel, which has the following format: "nnn", 3 digit number increasing sequentially. |
errorText | Optional | String | errorText contains the error text if the method fails. The method will return errorText only if it fails. See the Error Codes Reference of this method for more details. |
errorCode | Optional | Number | errorCode contains the error code if the method fails. The method will return errorCode only if it fails. See the Error Codes Reference of this method for more details. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean |
|
subscribed | Required | Boolean |
|
adapterAddress | Required | String | The address of the adapter the operation was performed on. If adapterAddress input parameter was not specified, the address of the default adapter will be returned. |
disconnectByRemote | Required | Boolean |
|
address | Optional | String | The address (bdaddr) of the remote device. |
channelId | Optional | String | The unique ID of a SPP channel, which has the following format: "nnn", 3 digit number increasing sequentially. |
errorText | Optional | String | errorText contains the error text if the method fails. The method will return errorText only if it fails. See the Error Codes Reference of this method for more details. |
errorCode | Optional | Number | errorCode contains the error code if the method fails. The method will return errorCode only if it fails. See the Error Codes Reference of this method for more details. |
Error Code | Error Text | Error Description |
---|---|---|
102, 103, 105, 106, 127, 143, 144 | See API Error Codes Reference | See API Error Codes Reference. |
128 | Device is already connecting | The remote Bluetooth device is already connecting to SPP profile, so another connection cannot be opened. |
129 | Device is not paired | The remote Bluetooth device is not paired, so SPP connection cannot be opened. |
130 | Failed to connect with remote device | The remote Bluetooth device cannot be connected to SPP profile. |
131 | Already connected | The remote Bluetooth device is already connected to the adapter's SPP profile, so another connection cannot be opened. |
Example code
Example:
# luna-send -i -f -a "com.domain.app.testapp" luna://com.webos.service.bluetooth2/spp/connect '{
"address":"b4:f1:da:6c:7e:67",
"uuid":"00001101-0000-1000-8000-00805f9b34fb",
"subscribe":true
}'
Response:
{
"channelId":"001",
"address":" b4:f1:da:6c:7e:67",
"subscribed":true,
"adapterAddress":"b8:27:eb:6d:d1:ab",
"returnValue":true
}
Subscription Response:
{
"subscribed":false,
"adapterAddress":"b8:27:eb:c8:52:ee",
"disconnectByRemote":true,
"returnValue":true
}
API level 11
Register a service record in the device service record database with the specified UUID and name. The channel can be removed through LSCallCancel().
Name | Required | Type | Description |
---|---|---|---|
name | Required | String | An identifiable name of a SPP service in the server, which the system will automatically write to a new Service Discovery Protocol (SDP) database entry on the device (the name is arbitrary and can simply be your application name). |
uuid | Required | String | The UUID is also included in the SDP entry and will be the basis for the connection agreement with the client device. That is, when the client attempts to connect with this device, it will carry a UUID that uniquely identifies the service with which it wants to connect. These UUIDs must match in order for the connection to be accepted. |
subscribe | Required | Boolean | Must set subscribe to true to be notified of changes to the channel (e.g., connection of client, removal of the channel). |
adapterAddress | Optional | String | The address of the adapter executing this method. If not specified, the default adapter will be used. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean |
|
adapterAddress | Required | String | The address of the adapter the operation was performed on. If adapterAddress input parameter was not specified, the address of the default adapter will be returned. |
subscribed | Required | Boolean | subscribe will always contain true. |
errorText | Optional | String | errorText contains the error text if the method fails. The method will return errorText only if it fails. See the Error Codes Reference of this method for more details. |
errorCode | Optional | Number | errorCode contains the error code if the method fails. The method will return errorCode only if it fails. See the Error Codes Reference of this method for more details. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean |
|
subscribed | Required | Boolean |
|
adapterAddress | Required | String | The address of the adapter the operation was performed on. If adapterAddress input parameter was not specified, the address of the default adapter will be returned. |
channelId | Required | String | Unique ID of a SPP channel, which has the following format: "nnn", 3 digit number increasing sequentially. |
connected | Required | Boolean |
|
address | Optional | String | The address (bdaddr) of the device. |
errorText | Optional | String | errorText contains the error text if the method fails. The method will return errorText only if it fails. See the Error Codes Reference of this method for more details. |
errorCode | Optional | Number | errorCode contains the error code if the method fails. The method will return errorCode only if it fails. See the Error Codes Reference of this method for more details. |
Error Code | Error Text | Error Description |
---|---|---|
102, 105, 106, 127, 143, 144 | See API Error Codes Reference | See API Error Codes Reference. |
203 | Required 'uuid' parameter is not supplied | This method is required the "UUID" parameter. |
205 | Required 'name' parameter is not supplied | This method is required the "name" parameter. |
Example code
Example:
# luna-send -i -f -a "com.domain.app.testapp" luna://com.webos.service.bluetooth2/spp/createChannel '{
"name":"service1",
"uuid":"00001101-0000-1000-8000-00805f9b34fb",
"subscribe":true
}'
Response:
{
"adapterAddress":"b8:27:eb:c8:52:ee",
"subscribed":true,
"returnValue":true
}
Subscription Response:
{
"channelId":"001",
"adapterAddress":"b8:27:eb:c8:52:ee",
"subscribed":true,
"connected":true,
"address":"B4:F1:DA:6C:7E:67",
"returnValue":true
}
API level 11
Drop the connection to the given remote device on SPP profile.
Name | Required | Type | Description |
---|---|---|---|
channelId | Required | String | Unique ID of a SPP channel, which has the following format: "nnn", 3 digit number increasing sequentially. |
adapterAddress | Optional | String | The address of the adapter executing this method. If not specified, the default adapter will be used. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean |
|
adapterAddress | Required | String | The address of the adapter the operation was performed on. If adapterAddress input parameter was not specified, the address of the default adapter will be returned. |
errorText | Optional | String | errorText contains the error text if the method fails.The method will return errorText only if it fails.See the Error Codes Reference of this method for more details. |
errorCode | Optional | Number | errorCode contains the error code if the method fails. The method will return errorCode only if it fails. See the Error Codes Reference of this method for more details. |
Error Code | Error Text | Error Description |
---|---|---|
102, 105, 106, 127, 143, 144 | See API Error Codes Reference | See API Error Codes Reference. |
132 | Failed to disconnect from remote device | The SPP connection with the remote Bluetooth device could not be closed |
Example code
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/spp/disconnect '{ "channelId": "001" }'
Example response for a successful call:
{
"returnValue": true,
"adapterAddress": "00:00:c5:99:f5:87"
}
Example response for a failed call: If address is not valid,
{
"errorCode": 132,
"returnValue": false,
"errorText": "Failed to disconnect from remote device."
}
API level 11
Return the status of a SPP connection to a remote device.
Name | Required | Type | Description |
---|---|---|---|
address | Required | String | The address (bdaddr) of the remote device. |
subscribe | Optional | Boolean |
|
adapterAddress | Optional | String | The address of the adapter executing this method call. When the field is not set, the default adapter is used for it. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean |
|
connecting | Required | Boolean |
|
connected | Required | Boolean |
|
adapterAddress | Required | String | The address of the adapter the operation was performed on. If adapterAddress input parameter was not specified, the address of the default adapter will be returned. |
connectedChannels | Required | String array | Array of channel IDs which are connected currently. |
subscribed | Required | Boolean |
|
errorText | Optional | String | errorText contains the error text if the method fails. The method will return errorText only if it fails. See the Error Codes Reference of this method for more details. |
errorCode | Optional | Number | errorCode contains the error code if the method fails. The method will return errorCode only if it fails. See the Error Codes Reference of this method for more details. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean |
|
subscribed | Optional | Boolean |
|
connecting | Required | Boolean |
|
connected | Required | Boolean |
|
adapterAddress | Required | String | The address of the adapter the operation was performed on. If adapterAddress input parameter was not specified, the address of the default adapter will be returned. |
connectedChannels | Required | String array | Array of channel IDs which are connected currently. |
errorText | Optional | String | errorText contains the error text if the method fails. The method will return errorText only if it fails. See the Error Codes Reference of this method for more details. |
errorCode | Optional | Number | errorCode contains the error code if the method fails. The method will return errorCode only if it fails. See the Error Codes Reference of this method for more details. |
Error Code | Error Text | Error Description |
---|---|---|
102, 105, 106, 127, 143, 144 | See API Error Codes Reference | See API Error Codes Reference. |
133 | Failed to retrieve state for remote device | The SPP connection status of the remote Bluetooth device cannot be retrieved. |
Example code
# luna-send -n 1 -f luna://com.webos.service.bluetooth2/spp/getStatus '{
"address": "34:4d:f7:f9:52:f7",
"subscribe": false
}'
Example response for a successful call:
{
"returnValue": true,
"connecting": false,
"connected": true,
"connectedChannels": "["001"]"
"adapterAddress": "00:00:c5:99:f5:87",
"subscribed": false
}
Example response for a failed call: If address is not valid,
{
"errorCode": 133,
"returnValue": false,
"errorText": "Failed to retrieve state for remote device"
}
Subscription return: If connection is successful,
{
"returnValue": true,
"connecting": false,
"connected": true,
"connectedChannels": "["001"]"
"adapterAddress": "00:00:c5:99:f5:87",
"subscribed": false
}
API level 11
Receive data from the connected remote device.
Name | Required | Type | Description |
---|---|---|---|
channelId | Optional | String | Unique ID of a SPP channel. If channelId is not specified, all connected channel IDs from which the caller received data will be returned. |
subscribe | Optional | Boolean |
|
timeout | Optional | Number | The receive timeout in seconds. It is available only when subscribe is set to true. After timeout seconds, the subscription is canceled. A value of 0 means that the timeout is disabled. |
adapterAddress | Optional | String | The address of the adapter executing this method. If not specified, the default adapter will be used. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean |
|
adapterAddress | Required | String | The address of the adapter the operation was performed on. If adapterAddress input parameter was not specified, the address of the default adapter will be returned. |
subscribed | Required | Boolean |
|
channelId | Required | String | Unique ID of a SPP channel. |
data | Optional | String | BASE64-encoded string data received from the remote device. Before using the data, BASE64 decoding is needed. |
errorText | Optional | String | errorText contains the error text if the method fails. The method will return errorText only if it fails. See the Error Codes Reference of this method for more details. |
errorCode | Optional | Number | errorCode contains the error code if the method fails. The method will return errorCode only if it fails. See the Error Codes Reference of this method for more details. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean |
|
subscribed | Required | Boolean |
|
adapterAddress | Required | String | The address of the adapter the operation was performed on. If adapterAddress input parameter was not specified, the address of the default adapter will be returned. |
channelId | Required | String | Unique ID of a SPP channel. |
data | Optional | String | BASE64-encoded string data received from the remote device. Before using the data, BASE64 decoding is needed. |
errorText | Optional | String | errorText contains the error text if the method fails. The method will return errorText only if it fails. See the Error Codes Reference of this method for more details. |
errorCode | Optional | Number | errorCode contains the error code if the method fails. The method will return errorCode only if it fails. See the Error Codes Reference of this method for more details. |
Error Code | Error Text | Error Description |
---|---|---|
102, 105, 106, 127, 143, 144 | See API Error Codes Reference | See API Error Codes Reference. |
209 | The supplied 'channelId' is not available | The channelId is not opened or does not exist. |
211 | The supplied 'timeout' is not available | If value of timeout is smaller than zero, this error is returned. The value of timeout must be greater than zero. |
212 | Permission denied | The supplied channel is not connected or there is no authority. |
Example code
Example:
# luna-send -i -f -a "com.domain.app.testapp" luna://com.webos.service.bluetooth2/spp/readData '{"channelId": "001”,"subscribe":true}'
Response:
{
"channelId":"001",
"adapterAddress":"b8:27:eb:6d:d1:ab",
"subscribed":true,
"returnValue":true,
"data":"aGVsbG8K"
}
Subscription Response:
{
"channelId":"001",
"adapterAddress":"b8:27:eb:6d:d1:ab",
"subscribed":true,
"returnValue":true,
"data":"aGVsbG8K"
}
API level 11
Transfer data to the connected remote device.
Name | Required | Type | Description |
---|---|---|---|
channelId | Required | String | Unique ID of a SPP channel. |
data | Required | String | Data to send. This string data should be encoded to BASE64. |
adapterAddress | Optional | String | The address of the adapter executing this method. If not specified, the default adapter will be used. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean |
|
adapterAddress | Required | String | The address of the adapter the operation was performed on. If adapterAddress input parameter was not specified, the address of the default adapter will be returned. |
errorText | Optional | String | errorText contains the error text if the method fails. The method will return errorText only if it fails. See the Error Codes Reference of this method for more details. |
errorCode | Optional | Number | errorCode contains the error code if the method fails. The method will return errorCode only if it fails. See the Error Codes Reference of this method for more details. |
Error Code | Error Text | Error Description |
---|---|---|
102, 105, 106, 127, 143, 144 | See API Error Codes Reference | See API Error Codes Reference. |
204 | Required 'channelId' parameter is not supplied | This method is required the "channelId" parameter. |
206 | Required 'data' parameter is not supplied | This method is required the "data" parameter. |
207 | Required 'size' parameter is not supplied | This method is required the "size" parameter. |
208 | Failed to write data | Writing Data is failed. |
209 | The supplied 'channelId' is not available | The channelId is not opened or does not exist. |
210 | The supplied 'size' is not available | The supplied size is smaller than zero or greater than max_buffer_size. |
212 | Permission denied | The supplied channel is not connected or there is no authority. |
Example code
Example:
# luna-send -i -f -a "com.domain.app.testapp" luna://com.webos.service.bluetooth2/spp/writeData '{"channelId": "001”,"data": "R29vZCBEYXkNCg=="}'
Response:
{
"adapterAddress":"b8:27:eb:6d:d1:ab",
"returnValue":true
}
Object gives the info related to app-key used/created by the application
Name | Required | Type | Description |
---|---|---|---|
index | Required | Number | App key index |
boundNetKeyIndex | Required | Number | Net key index to which this app key is bound. |
Provides composition data information about a requested node.
Name | Required | Type | Description |
---|---|---|---|
companyId | Required | Number | Company identifier assigned by the Bluetooth SIG |
productId | Required | Number | Vendor-assigned product identifier |
versionId | Required | Number | Vendor-assigned product version identifier |
numRplEnteries | Required | Number | Minimum number of replay protection list entries in a device |
features | Required | Object: BleMeshFeature | Contains information indicating the device features |
elements | Required | Object array: BleMeshElement | Contains a sequence of element descriptions |
provide node relay information
Name | Required | Type | Description |
---|---|---|---|
relay | Required | Number | Provide relay information |
retransmitIntervalSteps | Required | Number | Provide retransmitIntervalSteps information |
retransmitCount | Required | Number | provide retransmitCount information |
Object provides sequence of element descriptions
Name | Required | Type | Description |
---|---|---|---|
loc | Required | Number | Location descriptor |
numS | Required | String | Number of SIG Model IDs in this element |
sigModelIds | Required | Number array | Sequence of SIG Model IDs |
numV | Required | Number | Number of Vendor Model IDs in this element |
vendorModelIds | Required | Number array | Sequence of NumV Vendor Model IDs |
Object information indicating the device features.
Name | Required | Type | Description |
---|---|---|---|
relay | Required | Boolean | Relay feature support. Possible values are:
|
proxy | Required | Boolean | Proxy feature support. Possible values are:
|
friend | Required | Boolean | Friend feature support. Possible values are:
|
lowPower | Required | Boolean | Low Power feature support. Possible values are:
|
Object provides mesh network information
Name | Required | Type | Description |
---|---|---|---|
name | Required | String | The name of the mesh network. |
netKeys | Required | Object array: BleMeshNetKeys | Network key information. |
appKeys | Required | Object array: BleMeshAppKeys | Application keys information. |
provisioners | Required | Object array: BleMeshProvisioner | Provisioner-related information, which includes the unicast address of the provisioner and the address range that the provisioner can use to assign unicast addresses to the nodes. |
Object representing the intermediate response during key update to nodes in the network.
Name | Required | Type | Description |
---|---|---|---|
responseCode | Required | Number | Code for the response. Possible values are:
|
responseText | Required | String | Description of the response (check responseCode field) |
primaryElementAddress | Required | Number | Primary element address of the node to which app key or net key updating failed. This information is provided when responseCode is 47 or 49. NOTE: The node is as good as removed from the network, if updating a network key to a node fails; because that node will not have the updated key and hence cannot communicate with other nodes in the network. The application can discover the device and provision it again. |
appKeyIndex | Optional | Number | App key index for which appkey update was failed for a particular node represented by primaryElementAddress. This information is provided when responseCode is 47. If updating appkey fails to any node, application can call APPKEY_UNBIND, APPKEY_DELETE, APPKEY_ADD and APPKEY_BIND in that sequence again for the |
Object provides the info related to network key
Name | Required | Type | Description |
---|---|---|---|
index | Required | Number | Net key index |
keyRefresh | Required | Boolean | Indicates if the net key refresh is in progress. |
Object containing a list of provisioned nodes in the network
Name | Required | Type | Description |
---|---|---|---|
uuid | Required | String | UUID of the node |
primaryElementAddress | Required | Number | Unicast address assigned to primary element of the node. |
numberOfElements | Required | Number | Specifies the number of elements that are present in the remote node. For example, if "primaryElementAddress" = 170 and "numberOfElements" = 3, this means that the primary element is assigned with address 170, and the remaining two elements are assigned with addresses 171 and 172. The application can call the mesh/model/config/getCompositionData API to know about the models supported in each element. It can use these addresses as the destination address to communicate with those models. |
netKeyIndex | Required | Number | Network key index of the network that this node is associated with |
appKeyIndexes | Required | Number array | App key indexes known/used by the node |
Payload object structure when the command is "onOff" in mesh/model/send API.
Name | Required | Type | Description |
---|---|---|---|
value | Required | Boolean | Payload for onOff command |
Payload object structure when the command is "passThrough" in mesh/model/send API.
Name | Required | Type | Description |
---|---|---|---|
value | Required | Number (uint8_t) array | Payload for passThrough command |
Object provides provisioner related information
Name | Required | Type | Description |
---|---|---|---|
name | Required | String | Provisioner name |
unicastAddress | Required | Number | Unicast address of the provisioner |
Array of BLE Mesh devices that are known to the system and that are not yet provisioned by the system
Name | Required | Type | Description |
---|---|---|---|
rssi | Required | Number | RSSI Measurement of the signal strength of the received unprovisioned beacon |
uuid | Required | String | Device uuid |
name | Optional | String | Device name |
An object containing constant information about the adapter.
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Required | String | The address (bdaddr) of the adapter. |
default | Required | Boolean | If true, this is the default adapter and adapter/ methods called without an adapterAddress parameter will operate on it. Note that default (like all of the other values in this object) will not change while the adapter is present. This means if the default adapter is dynamic and is removed, there will no longer be an adapter with default set to true. |
classofDevice | Required | Number | Class of the Bluetooth adapter. Values are taken from https://www.bluetooth.com/specifications/assigned-numbers/baseband/. |
stackName | Required | String | The name of the SIL (Stack Interface Layer) that wraps the Bluetooth stack used by this adapter. |
stackVersion | Required | String | Version of the Bluetooth stack that the adapter's SIL (Stack Interface Layer) wraps (not the version of the SIL itself). |
firmwareVersion | Required | String | Version of the firmware used by the adapter's hardware. |
serviceClasses | Required | Object array: bluetooth2ServiceClass | The Bluetooth Service Classes implemented for this adapter. |
Contains the information about the status of the adapter identified by the adapterAddress parameter.
The following values are read-only:
Name | Required | Type | Description |
---|---|---|---|
adapterAddress | Required | String | Indicates the address (bdaddr) of the adapter. |
name | Required | String | Indicates the friendly name of the adapter. Note: The default name chosen by the system can be changed by the user. |
powered | Required | Boolean | Indicates that the adapter radio is powered on and is usable for discovery and connections. |
discovering | Required | Boolean | Indicates that the adapter is discovering other devices. |
discoveryTimeout | Required | Number | Indicates the timeout in seconds after which device discovery will be stopped. Note:
|
pairing | Required | Boolean | Indicates that the adapter is in the process of pairing to a remote device, either via incoming or outgoing pairing. |
discoverable | Required | Boolean | Indicates if the adapter can be discovered by remote devices. Note:
|
discoverableTimeout | Required | Number | Indicates the discoverable timeout in seconds. Note:
|
pairable | Required | Boolean | Indicates if the adapter can be paired to a remote device. It is initially false and is set to true when client is subscribed to adapter/awaitPairingRequests. Note:
|
pairableTimeout | Required | Number | Indicates the pairable timeout in seconds. Denotes the total time, the service will wait for the remote device to send a response after it has responded to an incoming pairing request. Note: A value of zero means that the timeout is disabled and it will wait forever for a response. Negative values are not allowed. |
interfaceName | Required | String | Indicates the value that is assigned to the "interfaceName" will be fixed during boot up and can not be changed. Note: The object property is used in the assignment of adapters to specific containers. |
Defines the format for data parameters.
Name | Required | Type | Description |
---|---|---|---|
includeTxPower | Optional | Boolean | Possible values: True: To include advertisement transmission power. False:To not include advertisement transmission power. |
includeName | Optional | Boolean | Possible values: True: To include local device name in advertisement. False: To not include local device name in advertisement. Note:Default value is false. |
manufacturerData | Optional | Number (uint8_t) array | Byte sequence of manufacturer specific data. |
services | Optional | Object array: bluetooth2LeServiceObject | Array of services and data to be included in the advertisement. Note:
|
proprietaryData | Optional | Object: bluetooth2LeProprietaryDataObject | Used for advertising data with vendor proprietary advertising type or undefined type as parameter (ex. LE Bluetooth Devices (0x1B)). |
Object containing information about the advertisement setting.
Name | Required | Type | Description |
---|---|---|---|
connectable | Optional | Boolean | Possible values:
Note: Default value of connectable is true. |
txPower | Optional | Number (uint8_t) | Two's complement value of transmission power. Only used if includeTxPower is true. |
timeout | Optional | Number | Connection timeout. |
Describes an item in the folder.
Name | Required | Type | Description |
---|---|---|---|
name | Required | String | Indicates the name to be displayed. |
path | Required | String | Indicates the item path. |
type | Required | String | Indicates the Item type. Possible values are:
|
playable | Required | Boolean | Indicates if the item is playable or not. Possible values are:
|
metaData | Required | Object: bluetooth2MediaMetaData | Indicates the metadata of the item. Note: Available if the item type is either "Audio" or "Video". |
Represents the media player information as received from AVRCP target.
Name | Required | Type | Description |
---|---|---|---|
name | Required | String | Indicates the name of the media player. |
type | Required | String | Indicates the type of the media player type. Possible values are:
|
addressed | Required | Boolean | Indicates if the player is addressed. Possible values are:
|
browsable | Required | Boolean | Indicates if the player supports media content browsing. Possible values are:
Note: Browsing APIs will be success and return expected result only if the addressed player is browsable i.e. if both "addressed" and "browsable" is true. |
searchable | Required | Boolean | Indicates if the player supports media content searching. Possible values are:
Note: The search API succeeds only if player supports search functionality. |
playlistPath | Required | String | Indicates the path to the current playing list. |
Object containing information about avrcp remote features
Name | Required | Type | Description |
---|---|---|---|
role | Required | String | Indicates the role of AVRCP. Possible values are:
Note: "TG" stands for Target and "CT" stands for controller. |
remoteFeature | Required | String | Indicates the remote avrcp's features. Possible values are:
Note:
|
Contains the information about the status of the device identified by the address.
Note: All object properties apart from name are read-only.
Name | Required | Type | Description |
---|---|---|---|
address | Required | String | Indicates the address (bdaddr) of the device. |
name | Required | String | Indicates the friendly name of the device displayed to the user. Note: When a previously undiscovered device is first discovered, the system makes up a reasonable value for this. |
classOfDevice | Required | Number | Indicates the class of the Bluetooth device. Note: Values are taken from https://www.bluetooth.com/specifications/assigned-numbers/baseband/. |
typeOfDevice | Required | String | Indicates the type of the device. Possible values are:
|
serviceClasses | Required | Object array: bluetooth2ServiceClass | Indicates the array of service classes supported by this device. |
pairing | Required | Boolean | Indicates that the device is in the process of pairing. Note: The value is set to false once pairing is over (and paired set depending whether the pairing succeeded or failed). |
paired | Required | Boolean | Indicates if the device is paired with the adapter. Possible values are:
|
adapterAddress | Required | String | Indicates the address of the adapter to which the device is paired (or was last paired). Note: If never paired, it will be the empty string. |
connectedProfiles | Optional | String array | Indicates the array of the lower-cased official abbreviation for the profile to which the service class is associated. The values are taken from https://www.bluetooth.com/specifications/profiles-overview/. |
trusted | Required | Boolean | Indicates whether the given device is trusted or not. Possible values are:
|
blocked | Required | Boolean | Indicates if a remote device is blocked (if set) or unblocked (if reset) for pairing and profile connections. Possible values are:
|
rssi | Required | Number | Indicates the signal strength level of the device. |
txPower | Optional | Number | Indicates the transmission power level of the remote device. Note:
|
scanRecord | Required | Number (uint8_t) array | Indicates the service data of the remote device (if advertised from the remote device, else it will be blank). |
manufacturerData | Required | Object: bluetooth2GattManufacturerData | Indicates manufacturer-specific company ID and data (if advertised from the remote device, else it will be blank). |
Object containing information about a GATT characteristic.
Name | Required | Type | Description |
---|---|---|---|
characteristic | Required | String | UUID of the characteristic. |
value | Required | Object: bluetooth2GattValueInfo | Value of the characteristic. |
properties | Required | Object: bluetooth2GattPropertiesInfo | Configured properties for the characteristic. |
permissions | Required | Object: bluetooth2GattPermissionsInfo | Configured permissions for the characteristic. |
descriptors | Required | Object array: bluetooth2GattDescriptorInfo | List of descriptors for the characteristic. |
instanceId | Optional | String | Unique identifier of the characteristic |
Object containing information about the characteristic uuid and values.
Name | Required | Type | Description |
---|---|---|---|
characteristic | Required | String | Characteristic uuid |
value | Required | Number (uint8_t) array | Byte sequence of characteristic data. |
Object containing information about a GATT descriptor.
Name | Required | Type | Description |
---|---|---|---|
descriptor | Required | String | Unique identifier of the descriptor |
value | Required | Object: bluetooth2GattValueInfo | Value of the descriptor |
instanceId | Optional | String | Unique identifier of the descriptor |
Indicates manufacturer-specific company ID and data (if advertised from the remote device, else it will be blank) and scanResponse data
Note: If defined SCAN_RECORD only companyId and data will be available, if not all parameters visible
Name | Required | Type | Description |
---|---|---|---|
companyId | Optional | Number (int8_t) array | Company identifier assigned by the Bluetooth SIG |
data | Optional | Number (int8_t) array | Data of the advertiser |
scanRecord | Optional | Number (int8_t) array | Indicates the service data of the remote device (if advertised from the remote device, else it will be blank). |
Object containing information about the permissions allowed for a client to use a particular characteristic value.
All properties are defined in Bluetooth Core Specification 4.1 vol. 4 Part G chapter 3.3.1.1.
Name | Required | Type | Description |
---|---|---|---|
read | Optional | Boolean | If set, clients are allowed to read the characteristic value. |
readEncrypted | Optional | Boolean | If set, allows encrypted read operations. |
readEncryptedMitm | Optional | Boolean | If set, allows reading with man-in-the-middle protection. |
write | Optional | Boolean | If set, clients are allowed to write the characteristic value. |
writeEncrypted | Optional | Boolean | If set, allows encrypted writes. |
writeEncryptedMitm | Optional | Boolean | If set, allows encrypted writes with man-in-the-middle protection. |
writeSigned | Optional | Boolean | If set, allows signed write operations. |
writeSignedMitm | Optional | Boolean | If set, allows signed write operations with man-in-the-middle protection. |
Object containing information about the set properties of a characteristic.
All properties are defined in Bluetooth Core Specification 4.1 vol. 4 Part G chapter 3.3.1.1.
Name | Required | Type | Description |
---|---|---|---|
broadcast | Optional | Boolean | If set, permits broadcasts of the Characteristic Value using Server Characteristic Configuration Descriptor. If set, the Server Characteristic Configuration Descriptor shall exist. |
read | Optional | Boolean | If set, permits reads of the Characteristic Value. |
writeWithoutResponse | Optional | Boolean | If set, permit writes of the Characteristic Value without response. |
write | Optional | Boolean | If set, permits writes of the Characteristic Value with response |
notify | Optional | Boolean | If set, permits notifications of a Characteristic Value without acknowledgement. If set, the Client Characteristic Configuration Descriptor shall exist. |
indicate | Optional | Boolean | If set, permits indications of a Characteristic Value with acknowledgement. |
authenticatedSignedWrites | Optional | Boolean | If set, permits signed writes to the Characteristic Value |
extendedProperties | Optional | Boolean | If set, additional characteristic properties are defined in the Characteristic Extended Properties Descriptor. If set, the Characteristic Extended Properties Descriptor shall exist. |
Object containing the GATT service configuration.
Name | Required | Type | Description |
---|---|---|---|
service | Required | String | UUID of the service |
type | Required | String | UUID which describes the type of the service. The following types are defined:
|
includes | Required | String array | List of service UUIDs this services includes in its definition. |
characteristics | Required | Object array: bluetooth2GattCharacteristicInfo | List of characteristics which are part of the service |
instanceId | Optional | String | Unique identifier of the service. |
Object contains information about a GATT value.
As a GATT characteristic can be extended with a descriptor which describes the type of the stored value we have three different representations of a value currently:
The last one is only used when not value type descriptor is present.
Name | Required | Type | Description |
---|---|---|---|
string | Optional | String | Present when the value is from type string. Not present otherwise. |
number | Optional | Number | Present when the value is from type number. Not present otherwise. |
bytes | Optional | Number array | If the type of the value is not specified then the value is returned as a sequence of bytes. |
Object containing information about manufacturer data.
Name | Required | Type | Description |
---|---|---|---|
id | Required | Number | Indicates the manufacturer id which is the first two bytes of manufacturer data. |
data | Required | Number array | Contains the array of manufacturer data. |
mask | Optional | Number array | Indicates the bit mask for the service uuid. Possible values are:
|
Defines the format for proprietary data with vendor proprietary advertising type or undefined type in sil-api.
Note: SIL stands for Stack Interface Layer
Name | Required | Type | Description |
---|---|---|---|
type | Required | Number | proprietary advertising type |
data | Required | Number array | Byte sequence of proprietary data. |
Object containing information about a service data to be advertised.
Name | Required | Type | Description |
---|---|---|---|
uuid | Required | String | Indicates the data uuid. Note: uuid is an immutable representation of a 128-bit universally unique identifier. |
data | Required | Number array | Contains the array of data pertaining to a service. |
mask | Optional | Number array | Indicates the bit mask for the service uuid. Possible values are:
|
Object containing information about a service to be advertised.
Name | Required | Type | Description |
---|---|---|---|
uuid | Required | String | 16-bit UUID representing one service. |
data | Optional | Number (uint8_t) array | Array of data pertaining to a service. |
Object containing information about a service uuid to be advertised.
Name | Required | Type | Description |
---|---|---|---|
uuid | Required | String | Indicates the service uuid. Note: uuid is an immutable representation of a 128-bit universally unique identifier. |
mask | Optional | String | Indicates the bit mask for the service uuid. Possible values are:
|
Contains the list of supported MAS instances.
Name | Required | Type | Description |
---|---|---|---|
instanceName | Optional | String | Indicates the name of the MAS instance available in MSE. |
supportedMessageTypes | Optional | String array | Indicates the list of supported message types. (SMS_GSM, EMAIL, MMS, SMS_CDMA) |
Contains an array of the MAS instances with the connection details.
Name | Required | Type | Description |
---|---|---|---|
instanceName | Required | String | Indicates the name of the MAS instance. |
sessionId | Optional | String | Indicates the assigned Obex Session Id for the instance , only available when instance is connected. |
Connecting | Required | Boolean | Indicates if the connection request is currently being processed. Possible values are:
|
Connected | Required | Boolean | Indicates if the connection is open. Possible values are:
|
Contains information about a media metadata value.
Note : string parameters accepts empty string as some meta data doesn't have particular info, and number parameters accepts non negative numbers
Name | Required | Type | Description |
---|---|---|---|
title | Required | String | Indicates the title of the media. |
artist | Required | String | Indicates the name of the artist. |
album | Required | String | Indicates the name of album. |
genre | Required | String | Indicates the genre of the media. |
trackNumber | Required | Number | Indicates the track number of the media. |
trackCount | Required | Number | Indicates the total number of tracks in the album. |
duration | Required | Number | Indicates the playing time of the media in milliseconds. |
Indicates the description of the message.
Name | Required | Type | Description |
---|---|---|---|
handle | Required | String | Indicates the message handle. |
properties | Required | Object: bluetooth2MessageNotificationProperties | Indicates the message notification properties. |
Indicates the list of filters.
Name | Required | Type | Description |
---|---|---|---|
startOffset | Optional | Number | Indicates the Offset of the first item. Default: 0 |
maxCount | Optional | Number | Indicates the maximum number of items. Default: 1024 |
subjectLength | Optional | Number | Indicates the maximum length of the subject property in the message |
fields | Optional | String array | Indicates the required message fields. Default: All values. Note:
|
messageTypes | Optional | String array | Indicates the type of the filter messages. Possible values:
Default: All values |
periodBegin | Optional | String | Indicates the starting period of the filter messages. Possible value: Date in "YYYYMMDDTHHMMSS" format. |
periodEnd | Optional | String | Indicates the ending period of the filter messages. Possible values: Date in "YYYYMMDDTHHMMSS" format. |
read | Optional | Boolean | Filters messages based on the read flag. Possible values are:
|
recipient | Optional | String | Filters messages by the recipient address. |
sender | Optional | String | Filter messages by the sender address. |
priority | Optional | String | Filters messages based on the priority flag. Possible values are:
|
Indicates the message list.
Name | Required | Type | Description |
---|---|---|---|
handle | Required | String | Indicates the message handle. |
properties | Required | Object: bluetooth2MessageProperties | Indicates the message properties. |
Indicates the message notification properties.
Name | Required | Type | Description |
---|---|---|---|
folder | Required | String | Indicates the folder path for the given message handle. |
oldFolder | Optional | String | Indicates the previous folder path for the given message handle. Note: This is only available for the MessageShift event. |
type | Required | String | Indicates the type of the message. |
newMessageProperties | Optional | Object: bluetooth2NewMessageProperties | Indicates the properties of the new message. |
Contains the list of supported Message properties.
Name | Required | Type | Description |
---|---|---|---|
folder | Required | String | Indicates the folder path for the given message handle. |
subject | Required | String | Indicates the subject of the message. |
dateTime | Required | String | Indicates the timestamp of the message in the format "YYYYMMDDTHHMMSS". |
senderName | Required | String | Indicates the name of the sender for the given message. |
senderAddress | Required | String | Indicates the address of the sender. |
recipientName | Required | String | Indicates the name of the recipient for the given message. |
recipientAddress | Required | String | Indicates the address of the recipient for the given message. |
type | Required | String | Indicates the type of the message. |
status | Required | String | Indicates the message reception status. Possible values are:
|
priority | Required | Boolean | Indicates that the message is of high priority or Not |
read | Required | Boolean | Indicates that the message has already been read on the MSE or Not |
sent | Required | Boolean | Indicates that the message has already been sent to the recipient or Not |
protected | Required | Boolean | Indicates that the message or a part of the message (e.g. attachment) |
textType | Required | Boolean | Indicates the original message or – in case of multipart-messages |
Indicates the properties of the new message.
Name | Required | Type | Description |
---|---|---|---|
subject | Required | String | Indicates the subject of the message. |
dateTime | Required | String | Indicates the timestamp of the message in the format "YYYYMMDDTHHMMSS". |
senderName | Required | String | Indicates the name of the message sender. |
priority | Required | Boolean | Indicates the message priority flag. |
Contains supported properties from PSE device.
Name | Required | Type | Description |
---|---|---|---|
repository | Required | String | Indicates the current folder/repository path of the connected PSE device. |
primaryVersionCounter | Required | String | Indicates the primary folder version counter that shall increment on completion of every change applied to any of the properties in the vCards as well as on insertion or removal of entries. |
secondaryVersionCounter | Required | String | Indicates the secondary folder version counter shall only increment on completion of every change applied to the vCard’s N, FN, TEL, EMAIL, MAILER, ADR, X-BT-UCI properties as well as on insertion or removal of entries. |
databaseIdentifier | Required | String | Indicates that the PSE shall return the databaseIdentifier application parameter containing the unique database identifier of the PSE device. |
fixedImageSize | Required | Boolean | Indicates support for fixed image size. |
Filter with key & value pair to search the phonebook
Name | Required | Type | Description |
---|---|---|---|
key | Required | String | Indicates the field in the vcard to search with. Possible values are:
|
value | Required | String | Indicates the value of the string to be searched. |
Contains information about vcf files entries with name and vcf handle from selected phonebook path.
Name | Required | Type | Description |
---|---|---|---|
Name | Required | String | Indicates object name. |
Handle | Required | String | Indicates vcf file name. |
Contains the information about the media playstatus value.
Name | Required | Type | Description |
---|---|---|---|
duration | Required | Number | Indicates the number representing the current track length in milliseconds. |
position | Required | Number | Indicates the number representing the current playing time in milliseconds. |
status | Required | String | Indicates the string representing the play status. Possible values are:
|
Object containing information about an OPP push request
Name | Required | Type | Description |
---|---|---|---|
requestId | Required | String | Unique ID of a request, which has the following format: "nnn", 3 digit number increasing sequentially from the formerly highest requestId. The logs for 999 numbers of requests are maintained in a system. If a user does not delete the logs of some requests manually, the logs will be deleted (oldest first). |
address | Required | String | The address (bdaddr) of the device where the file came. |
name | Required | String | The name of the device where the file came. |
fileName | Required | String | The name of the file received from a remote device. |
fileSize | Required | Number | The file size in bytes. |
transferred | Optional | Number | Number of bytes transferred so far. |
Object containing information about SBC configuration for A2DP.
Name | Required | Type | Description |
---|---|---|---|
samplingFrequency | Required | Number | The sampling frequency of codec specific information elements. Possible values: 16000, 32000, 441000, or 48000. |
channelMode | Required | String | The channel mode of codec specific information elements. Possible values: "mono", "dualChannel", "stereo" or "jointStereo". |
blockLength | Required | Number | The block length of codec specific information elements. Possible values: 4, 8, 12 or 16. |
subbands | Required | Number | The subbans of codec specific information elements. Possible values: 4 or 8. |
allocationMethod | Required | String | The allocation method of codec specific information elements. Possible values: "snr" or "loudness". |
minBitpool | Required | Number | The minimum bitpool value of codec specific information elements. |
maxBitpool | Required | Number | The maximum bitpool value of codec specific information elements. |
Contains the Bluetooth service class information.
Name | Required | Type | Description |
---|---|---|---|
mnemonic | Required | String | Indicates a mnemonic for the UUID of the service class. Note:
|
category | Optional | String | Indicates the LS2 category methods that can access the service class. Note:
|
Object containing txpower information.
Name | Required | Type | Description |
---|---|---|---|
txPower | Required | Number | Transmit power as measured at 1 meter distance from the webOS device. |
Object containing information about aptX configuration for A2DP.
Name | Required | Type | Description |
---|---|---|---|
samplingFrequency | Required | Number | The sampling frequency of codec specific information elements. Possible values: 16000, 32000, 441000 or 48000. |
channelMode | Required | String | The channel mode of codec specific information elements. Possible values: "mono" or "stereo". |
Error Code | Error Text | Error Description |
---|---|---|
1 | The operation failed for an unspecified or generic reason | The requested Bluetooth operation failed for an unspecified or generic reason in the Bluetooth stack. |
2 | The device is not ready to perform the requested operation | The Bluetooth adapter (local device) is not ready to perform the requested operation. |
3 | The SIL failed to allocate memory | The Bluetooth SIL (Stack Interface Layer) which interacts with the underlying stack has failed to allocate the required amount of memory to perform the requested operation. |
4 | The operation can not be performed at this time | The requested operation can not be performed by the adapter at this time since the adapter or SIL (Stack Interface Layer) is busy with a different operation. |
5 | The requested operation is not supported by the stack or device | The requested operation is not supported by the Bluetooth stack or adapter. |
6 | An invalid value was passed for one of the parameters | An invalid value was passed for one of the parameters while calling the SIL (Stack Interface Layer) from the Bluetooth service. |
7 | An unhandled error was encountered | An unhandled error was encountered at the SIL (Stack Interface Layer) while performing the requested operation. |
8 | Unknown device address | The remote Bluetooth device's address for performing the requested operation is not available in the list of found remote devices or is invalid. |
9 | Authentication with a remote device was canceled | Authentication with a remote Bluetooth device was canceled by the remote Bluetooth device. |
10 | Authentication with a remote device failed | Authentication with a remote Bluetooth device has failed either at the underlying stack. |
11 | Authentication with a remote was rejected | Authentication with a remote Bluetooth device was rejected by the remote Bluetooth device. |
12 | Authentication with a remote device timed out | Authentication with a remote Bluetooth device has timed out before getting a valid response from the remote device. |
13 | Device is already paired | The remote device with which we are trying to pair is already paired to the local device adapter. |
101 | Bluetooth adapter is not available | The underlying Bluetooth daemon is not running or isn't attached to the hardware. Use "start bluetooth-setup" which will then create the communication channel to the chip and make it known to the Bluetooth stack (bluez). |
102 | Failed to parse incoming message | The JSON payload passed to the method cannot be parsed and the input parameters' values cannot be determined. |
103 | Method needs to be subscribed | The API method needs to be called with an input parameter subscribe set to true, in order to get multiple responses for the LS call to this method. If subscribe is not set to true, this error is thrown. |
104 | Only one subscription allowed | Only one client is allowed to subscribe to this method |
105 | Required 'address' parameter is not supplied | The address parameter is mandatory, but was not supplied by the caller of the method. |
106 | Device with supplied address is not available | The remote Bluetooth device with the supplied address is not available (in the discovered devices list) to continue the operation of this method. |
107 | Pairing canceled by user | The ongoing pairing with a remote Bluetooth device has been canceled. The cancel is initiated by the client at the local device. |
108 | There is no pairing in progress | The Bluetooth adapter is not currently pairing with any remote Bluetooth device. |
127 | Profile backend is not available | The SIL (Stack Interface Layer) module used doesn't provide any implementation for the profile. |
128 | Device is already connecting | Indicates that the remote Bluetooth device is already connected to the profile, hence another connection cannot be opened. |
129 | Device is not paired | The remote Bluetooth device is not paired, so connection cannot be opened. |
130 | Failed to connect with remote device | The remote Bluetooth device cannot be connected to the profile. |
131 | Already connected | The remote Bluetooth device is already connected to the adapter's <profilename> profile, so another connection cannot be opened. |
132 | Failed to disconnect from remote device | Indicates that the connection with the remote Bluetooth device could not be closed. |
133 | Failed to retrieve state for remote device | The connection status of the remote Bluetooth device cannot be retrieved. |
136 | Device is not connected to profile | The remote Bluetooth device is not connected to our Bluetooth adapter via the profile. |
137 | Required parameter 'sourceFile' is not supplied | The sourceFile parameter is mandatory to this method, but was not supplied by the caller of the method. |
141 | Transfer was canceled | FTP file transfer to the remote Bluetooth device has been canceled by the client. |
143 | Invalid JSON input | The JSON input has an invalid format and cannot be parsed. |
144 | The JSON input does not match the expected schema | One or more of the parameters do not have the correct parameter type. See the "Parameters" table to know the expected data type for each input parameter. Note: Any required parameter missing will be a different error return based on the missing key. |
148 | No property state has changed | Either no parameters are supplied to the device/setState method or the parameters have no state change from their earlier value. |
149 | Failed to set device properties | The Bluetooth stack fails to set the supplied device properties for the given device. |
161 | Adapter is turned off | The Bluetooth adapter is turned off. |
162 | Adapter Address is not valid | The adapter address given is not valid. |
163 | Required 'service' uuid parameter is not supplied | The mandatory Service name parameter required by this method call is not supplied. |
164 | Required 'characteristic' uuid parameter is not supplied | Required 'characteristic' uuid parameter is not supplied |
165 | Invalid value input for GATT characteristic | The supplied value for GATT characteristics is invalid. |
169 | GATT service discovery cannot be started, one of adapterAddress or address should be supplied | Failed to start service discovery. |
170 | GATT add service failed | Failed to add the GATT Service. |
172 | GATT write characteristic failed | Failed to write characteristic the specified value. |
173 | Invalid GATT characteristic for the given service | The characteristic ID supplied does not belong to the service. |
174 | GATT read characteristics failed | Failed to read the requested characteristics. |
175 | Invalid value input for GATT characteristic | Characteristic value is not valid. |
176 | GATT monitor characteristic failed for characteristic | Failed to monitor GATT characteristic. |
177 | Invalid GATT Service | The supplied GATT service is not available or is not configured. |
180 | Required 'address' parameter is not supplied | The address parameter is mandatory, but was not supplied by the caller of the method. |
186 | Required 'requestId' parameter is not supplied | requestId parameter is missing in arguments. |
187 | Request is currently not allowed | The TG (Target) is not awaiting for media play status request. |
188 | The supplied requestId does not exist | The supplied requestId does not exist, hence the method cannot be completed. |
213 | Failed to configure advertisement | Generic advertisement configuration fail. |
214 | Attempted to configure too many services | More than the maximum number of UUIDs were attempted to be put into the advertisement. Using the BSA stack, this limit is 6 UUIDs in one advertisement. |
215 | Services and manufacturer data are missing, one should be supplied | The method was called with no advertising information to be configured. Either services or manufacturerData must be passed. |
216 | Cannot have both services and manufacturer data, only one should be supplied | Method was called with too many parameters, can only support either services or manufacturerData, not both. |
218 | Cannot have more than one service with data | Attempted to pass multiple bluetooth2LeServiceObject containing data. Can only pass one that contains data. |
237 | Required 'address' parameter is not supplied | Required 'address' parameter is not supplied. |
242 | AVRCP send PASS THROUGH command failed | Failed to send AVRCP PASS THROUGH command. |
247 | Failed to get Socket Path | The Path parameter is mandatory, but was not supplied by the caller of the method. |
248 | Profile already enabled | Profile already enabled. |
249 | Profile not enabled | Profile not enabled. |
250 | Failed to enable profile | Failed to enable profile. |
251 | Failed to disable profile | Failed to disable profile. |
253 | Invalid value input for AVRCP absolute volume | Invalid value input for AVRCP absolute volume. For details see the "Parameters" section of the 'avrcp/setAbsoluteVolume' method. |
254 | Failed to set absolute volume | Failed to set absolute volume. |
Contents