com.webos.service.bluetooth2

API Summary

Allows webOS to use the remote Bluetooth devices. 

Overview of the API

The bluetooth2 service supports the following categories:

  • adapter: Provides methods for discovering and pairing with remote Bluetooth devices and for querying their status and Bluetooth adapters available in the system. Both outgoing and incoming pairing is supported.
  • device: Provides methods for getting status of remote Bluetooth devices known to the system and for setting the local values for their state.
  • gatt: Provides methods for using the GATT profile. 
  • le: Provides methods for using Low Energy (LE) functionality. 
  • spp: Provides methods for using the SPP profile. The SPP defines two roles, that of a Server and Client device. 
  • A2DP: Provides methods for using the A2DP profile.
  • AVRCP: Provides methods for using the AVCRP profile.
  • OPP: Provides methods for using the OPP profile. 
  • hfp: Provides methods for using HFP profile. This category contains methods for both AG and HF.
  • pbap: Provides methods for using PBAP profile. This category contains methods for both roles of Phone Book Service Equipment (PSE) and Phone Book Client Equipment (PCE). PSE is the device that contains the source phone book objects and PCE is the device that retrieves phone book objects from the server equipment.
  • MAP: Provides methods for using the MAP profile.This category contains methods for Message Client Equipment (MCE).

 

Bluetooth2 service behavior in Sessions

In webOS platforms that are running with multiple sessions (for example: webOS Auto), in addition to a host session, one session is created for each of the display screens. 

  • Host session: Runs System services that are common to all the displays.
  • Container sessions: Runs services specific to a particular display.

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 dis-regarded in favor of the pre-selected adapter.

Method Behavior

  • All methods return responses containing errorCode (Number) and errorText (String) when returnValue contains false.
  • All responses from methods that have been subscribed to (i.e., were passed subscribe:true) contain a subscribed. The service informs the client that it will not send any further subscription responses by setting it to false (including the case when it rejects the initial subscription request in the method call). When the client receives a false value for subscribed, it must always call LSCallCancel().

Glossary

Methods

a2dp/connect

Description

Connects to the A2DP profile on the specified remote device.

Parameters

Name

Required

Type

Description

addressRequiredString

Indicates the address (bdaddr) of the remote device.

subscribeOptionalBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifcations.
  • false: Not subscribed.

​Default: false

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
subscribedRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.
adapterAddressRequiredString

Indicates the address of the adapter.

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

Subscription Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
subscribedRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.
disconnectByRemoteRequiredString

Indicates whether the remote device or the local user initiated the disconnect.

Possible values are:

  • true: Remote device initiated the disconnect.
  • false: Local user initiated the disconnect.
adapterAddressRequiredString

Indicates the address of the adapter.

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Error Codes Reference

Error Code

Error Text

Error Description

102, 103, 105, 106, 127, 143, 144See API Error Codes Reference

See API Error Codes Reference.

128Device is already connecting

The remote Bluetooth device is already connecting to the A2DP profile, so another connection cannot be opened.

129Device is not paired

The remote Bluetooth device is not paired, so A2DP connection cannot be opened.

130Failed to connect with remote device

The remote Bluetooth device cannot be connected to A2DP profile.

131Already connected

The remote Bluetooth device is already connected to the adapter's A2DP profile, so another connection cannot be opened.

Example

# 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
}

a2dp/disableDelayReporting

Description

Disables the AVDTP delay reporting.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.

Call Returns

Name

Required

Type

Description

adapterAddressRequiredString

Indicates the address of the adapter.

errorCodeRequiredNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

returnValueOptionalBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.

Error Codes Reference

Error Code

Error Text

Error Description

101Bluetooth adapter is not available

Bluetooth adapter is not available

286This API is not support by Bluetooth Stack

This API is not support by Bluetooth Stack

288Delay Reporting already disabled

Delay Reporting already disabled

Example

# luna-send -i -f luna://com.webos.service.bluetooth2/a2dp/disableDelayReporting '{
   "adapterAddress":"b8:ad:3e:bd:93:c2"
}'

Response:

{
    "returnValue":true
}

a2dp/disconnect

Description

Drops the connection to the given remote device on the A2DP profile.

Parameters

Name

Required

Type

Description

addressRequiredString

Indicates the address (bdaddr) of the remote device.

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
adapterAddressRequiredString

Indicates the address of the adapter.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

errorCodeOptionalNumber

The error code for the failed operation.

Error Codes Reference

Error Code

Error Text

Error Description

102, 105, 106, 127, 143, 144See API Error Codes Reference

See API Error Codes Reference.

132Failed to disconnect from remote device

The A2DP connection with the remote Bluetooth device could not be closed.

Example

# 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
}

a2dp/enableDelayReporting

Description

Enables the AVDTP delay reporting.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.

Call Returns

Name

Required

Type

Description

adapterAddressRequiredString

Indicates the address of the adapter.

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.

Error Codes Reference

Error Code

Error Text

Error Description

101Bluetooth adapter is not available

Bluetooth adapter is not available

286This API is not support by Bluetooth Stack

This API is not support by Bluetooth Stack

287Delay Reporting already enabled

Delay Reporting already enabled

Example

#luna-send -n -1 luna://com.webos.service.bluetooth2/a2dp/enableDelayReporting '{
   "adapterAddress":"0a:ad:3e:bd:93:c2"
}'

Response:

{
   "returnValue":true
}

a2dp/getDelayReportingTime

Description

Gets the AVDTP delay from a remote A2DP device, whenever the AVDTP delay is changed.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
addressOptionalString

Indicates the address (bdaddr) of the remote device.

subscribeOptionalBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.

Default: false

Call Returns

Name

Required

Type

Description

delayRequiredNumber

Indicates the delay in 1/10 of milliseconds.

adapterAddressRequiredString

Indicates the address of the adapter.

addressRequiredString

Indicates the address (bdaddr) of the remote device.

errorCodeOptionalNumber

The error code for the failed operation.

errorTextRequiredString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.

Error Codes Reference

Error Code

Error Text

Error Description

101Bluetooth adapter is not available

Bluetooth adapter is not available

237Required 'address' parameter is not supplied

The required address parameter has not been supplied.

106Device with supplied address is not available

Indicates that the device with the supplied address is not available.

286This API is not support by Bluetooth Stack

This API is not support by Bluetooth Stack

289Delay Reporting disabled

Delay Reporting disabled

Example

# 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
}

a2dp/getStatus

Description

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. 

Parameters

Name

Required

Type

Description

addressRequiredString

Indicates the address (bdaddr) of the remote device.

subscribeOptionalBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.

​Default: false

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
subscribedRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.
connectingRequiredBoolean

Indicates if the connection request is currently being processed.

Possible values are:

  • true: Request is being processed.
  • false: Not being processed.

Example: If the Bluetooth stack is no longer processing the connection request.

connectedRequiredBoolean

Indicates if the connection is open.

Possible values are:

  • true: Connection is open.
  • false: Connection is not open.
playingRequiredBoolean

Indicates if the device is streaming music.

Possible values are:

  • true: If either adapter or remote device is streaming music.
  • false: Not streaming music.
adapterAddressRequiredString

Indicates the address of the adapter.

addressOptionalString

Indicates the address (bdaddr) of the remote device.

Note: The address is returned only when the address input parameter is not specified. 

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

errorCodeOptionalNumber

The error code for the failed operation.

Subscription Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
subscribedRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.
connectingRequiredBoolean

Indicates whether the connection request is currently being processed.

Possible values are:

  • true: Request is being processed.
  • false: Not being processed. 
connectedRequiredBoolean

Indicates if the connection is open.

Possible values are:

  • true: Connection is open.
  • false: Connection is not open.
playingRequiredBoolean

Indicates whether the device is streaming music.

Possible values are:

  • true: If either adapter or remote device is streaming music.
  • false: Not streaming music.
adapterAddressRequiredString

Indicates the address of the adapter.

addressOptionalString

Indicates the address (bdaddr) of the remote device.

Note: Returned only when the address input parameter is not specified.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

errorCodeOptionalNumber

The error code for the failed operation.

Error Codes Reference

Error Code

Error Text

Error Description

102, 105, 106, 127, 143, 144See API Error Codes Reference

See API Error Codes Reference.

133Failed to retrieve state for remote device

The A2DP connection status of the remote Bluetooth device cannot be retrieved.

Example

# luna-send -i -f luna://com.webos.service.bluetooth2/a2dp/getStatus '{
      "address":"aa:bb:cc:dd:ee:00",
      "subscribe":true
}'

Response: 

{  
   "playing":false,
   "adapterAddress":"11:22:33:44:55:66",
   "address":"aa:bb:cc:dd:ee:00",
   "connected":false,
   "subscribed":true,
   "returnValue":true,
   "connecting":true
}

# luna-send -i -f luna://com.webos.service.bluetooth2/a2dp/getStatus '{
      "address":"aa:bb:cc:dd:ee:00",
      "subscribe":true
}'

Response: 

{  
   "errorCode":106,
   "returnValue":false,
   "errorText":"Device with supplied address is not available"
}

# 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
}

adapter/awaitPairingRequests

Description

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.

  • An outgoing pairing request is active until the service ends the subscription to adapter/pair by sending a subscription response containing request:endPairing.
  • An incoming pairing request is active once a subscription response to this method contains request:displayPinCoderequest:displayPasskeyrequest:confirmPasskeyrequest:enterPinCode, or request:enterPinCode
  • An incoming pairing request becomes inactive
    • When a subscription response to this method contains request:endPairing.
    • When the pairing succeeds (with the corresponding device having paired field as true). In this case, there is no request:endPairing response. So that the user or client needs to monitor the paired field of the remote device with device/getStatus

Note:

  • If the client calls LSCallCancel(), any active incoming pairing request is canceled the same way as if the adapter/cancelPairing​ method had been called.
  • A remote device can only be paired to a single adapter.
  • If it is ever possible to allow incoming pairing on adapters other than the default, an optional adapterAddress parameter will be added to the parameter list.

Parameters

Name

Required

Type

Description

subscribeRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.

Note: Set subscribe to true. The caller must subscribe to this method.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Subscription Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
subscribedRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.
addressRequiredString

Indicates the address (bdaddr) of the remote device with which pairing is being attempted.

requestRequiredString

Indicates the type of request.

Possible values are:

  • incomingPairRequest: Displays an incoming pairing request received from the remote device.
  • displayPinCode: Displays pinCode until the endPairing response is sent by the service.
  • displayPasskey: Display passkey until the endPairing response is sent by the service.
  • confirmPasskey: Requests the user to confirm passkey; only used with devices supporting Simple Secure Pairing (SSP) and Bluetooth version 2.1 or later.​
  • enterPinCode: Requests the user to enter a PIN code.
  • enterPasskey: Request the user to enter a passkey.
  • continuePairing: The request to cancel pairing from adapter/cancelPairing failed.
  • endPairing: The pairing process has been canceled; returnValue will contain falseerrorCode and errorText​ will explain the failure.
passkeyOptionalString

Indicates the passkey for request:displayPasskey or request:confirmPasskey.

pinCodeOptionalString

Indicates the PIN code for request:displayPinCode.

nameRequiredString

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 Codes Reference

Error Code

Error Text

Error Description

101-104, 107, 143, 144See API Error Codes Reference

See API Error Codes Reference.

123Failed to make device pairable

The Bluetooth stack could not set the pairable property of the adapter to true.

124Pairing 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.

125Device for incoming pairing request is not available

The remote Bluetooth device from which incoming pairing request has been received is not currently available.

126Pairable 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

# 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"
}

adapter/cancelDiscovery

Description

Cancels discovering the remote Bluetooth devices.

Note: Discovery of a specific adapter can be canceled based on the adapter address passed.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.

Call Returns

Name

Required

Type

Description

adapterAddressRequiredString

Indicates the address of the adapter.

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.

Note: returnValue will always contain true (even if there is no active discovery scan).

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Error Codes Reference

Error Code

Error Text

Error Description

101See API Error Codes Reference

See API Error Codes Reference.

116Can't stop discovery when adapter is turned off

The adapter needs to be powered on with adapter/setState to stop discovering other remote devices.

117Failed to cancel discovery

The Bluetooth stack could not terminate discovering remote devices.

Example

# luna-send -n 1 -f luna://com.webos.service.bluetooth2/adapter/cancelDiscovery '{ }'

Response:

{  
   "adapterAddress":"00:00:45:0e:48:9b",
   "returnValue":true
}

adapter/cancelPairing

Description

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,

  • If the cancel succeeds, it causes a request:endPairing subscription response to adapter/pair or adapter/awaitPairingRequests with a "Pairing canceled by user" error.
  • If the cancel fails, it causes a request:continuePairing subscription response.

Parameters

Name

Required

Type

Description

addressRequiredString

Indicates the address (bdaddr) of the remote device. 

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.

Note: returnValue will always contain true.

subscribedRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.
adapterAddressRequiredString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Error Codes Reference

Error Code

Error Text

Error Description

101, 102, 105, 106, 108, 143, 144See API Error Codes Reference

See API Error Codes Reference.

Example

# 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"
}

# 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"
}

adapter/getStatus

Description

Returns the status information about the Bluetooth adapters available in the system.

Parameters

Name

Required

Type

Description

subscribeOptionalBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.

​Default: false

Call Returns

Name

Required

Type

Description

subscribedRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.
returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.

Note: returnValue will always contain true unless the request for subscription has failed.

adaptersRequiredObject 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.

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Subscription Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.

Note: returnValue will always contain true unless the request for the subscription has failed.

subscribedRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.
adaptersRequiredObject 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.

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Error Codes Reference

Error Code

Error Text

Error Description

101, 143, 144See API Error Codes Reference

See API Error Codes Reference.

Example

# 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
}

adapter/pair

Description

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.

  • An outgoing pairing request is active until the service ends the subscription to this method by sending a subscription response containing request:endPairing.
  • An incoming pairing request is active once a subscription response to adapter/awaitPairingRequests contains request:displayPinCoderequest:displayPasskeyrequest:confirmPasskeyrequest:enterPinCode, or request:enterPinCode.
  • An incoming pairing becomes inactive when a subscription response contains request:endPairing

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.

Parameters

Name

Required

Type

Description

addressRequiredString

Indicates the address (bdaddr) of the remote device with which pairing is being attempted.

subscribeRequiredBoolean

Indicates if subscribed to get a notification when there is a change in the pairing status.

Possible values are:

  • true: Subscribed for notifications
  • false: Not subscribed.

Note: Set subscribe to true. The caller must subscribe to this method.

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Subscription Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
subscribedRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.

Note: subscribed will contain true until the request:endPairing response is sent by the service.

addressOptionalString

Indicates the address (bdaddr) of the paired remote Bluetooth device.

requestOptionalString

Indicates the type of return.

Possible values are: 

  • displayPinCode: Displays pinCode until the endPairing response is sent by the service.
  • displayPasskey: Displays passkey until the endPairing response is sent by the service.
  • confirmPasskey: Requests the user to confirm passkey; only used with devices supporting Simple Secure Pairing (SSP) and Bluetooth version 2.1 or later. ​
  • enterPinCode: Requests the user to enter a PIN code.
  • enterPasskey: Requests the user to enter a passkey.
  • continuePairing: Requests to cancel pairing from adapter/cancelPairing failed.
  • endPairing - Indicates that the pairing process is complete; subscribed will contain false and returnValue indicates whether pairing succeeded; errorCode and errorText​ will explain the failure.
passkeyOptionalNumber

Indicates the passkey for request:displayPasskey or request:confirmPasskey.

pinCodeOptionalString

Indicates the PIN code for request:displayPinCode.

Error Codes Reference

Error Code

Error Text

Error Description

1-13, 101-107, 143, 144See API Error Codes Reference

See API Error Codes Reference.

118Pairing 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

# 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"
}

adapter/queryAvailable

Description

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.

Parameters

Name

Required

Type

Description

subscribeOptionalBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.

Default: false

Call Returns

Name

Required

Type

Description

subscribedRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.
returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.

Note: returnValue will always contain true unless the request for subscription fails. 

adaptersRequiredObject array: bluetooth2Adapter

Contains information of all the adapters currently available in the system.

Note:

  • The information of the adapter does not change by the user or by any operations.
  • The information returned for an adapter does not change while it is available. 
  • If there are no available adapters, the array will be empty.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Subscription Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.

Note: returnValue will always contain true unless the request for subscription fails. 

subscribedRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications. 
  • false: Not subscribed.

Note: subscribed will contain true until the final response is sent by the service before stopping.

adaptersRequiredObject array: bluetooth2AdapterStatus

Contains information of all the adapters currently available in the system.

Note:

  • The information of the adapter does not change by the user or by any operations.
  • The information returned for an adapter does not change while it is available. 
  • If there are no available adapters, the array will be empty.
errorCodeOptionalString

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Error Codes Reference

Error Code

Error Text

Error Description

101, 143, 144See API Error Codes Reference

See API Error Codes Reference.

Example

# 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 return: 

{  
   "subscribed":false,
   "adapters":[  
      {  
         "stackName":"mock",
         "stackVersion":"",
         "adapterAddress":"00:00:dd:41:6b:ef",
         "classOfDevice":5898764,
         "firmwareVersion":"",
         "serviceClasses":[  

         ],
         "default":true
      }
   ],
   "returnValue":true
}

adapter/setState

Description

Sets the state of the specified Bluetooth adapter.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
nameOptionalString

Indicates the friendly name of the adapter​.

poweredOptionalBoolean

Indicates the power status of the adapter radio.

Possible values are:

  • true: Power ON 
  • false: Power OFF
discoveryTimeoutOptionalNumber

Indicates the discovery timeout in seconds.

Note:

  • After discoveryTimeout seconds, the adapter will stop discovering remote Bluetooth devices.
  • A value of 0 means that the timeout is disabled and the adapter will run the discovery process until the adapter/cancelDiscovery​ method is called.
  • Negative values are not valid.
discoverableOptionalBoolean

Indicates whether the adapter can be discovered by remote devices.

Possible values are:

  • true: Can be discovered
  • false: Cannot be discovered

Default: false

Note: If discoverableTimeout is set to a non-zero value, discoverable will be set back to false when the timer expires.

discoverableTimeoutOptionalNumber

Indicates the discoverable timeout in seconds.

Note:

  • A value of 0 means that the timeout is disabled and the adapter will stay in discoverable mode until discoverable is set to false.
  • Negative values are not valid.
pairableOptionalBoolean

Indicates whether to enable the adapter to be paired to a remote device.

Possible values are:

  • true: Adapter can be paired
  • false: Adapter cannot be paired

Default: true

pairableTimeoutOptionalNumber

Indicates the pairable timeout in seconds.

Note: After pairableTimeout seconds, the adapter is no longer pairable, and false is returned for pairable​.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
adapterAddressRequiredString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Error Codes Reference

Error Code

Error Text

Error Description

5, 101, 143, 144See API Error Codes Reference

See API Error Codes Reference.

109Invalid negative value for discoveryTimeout

The discoveryTimeout parameter value cannot be negative, hence invalid. The passed value is also mentioned in the error message.

110Invalid negative value for discoverableTimeout

The discoverableTimeout parameter value cannot be negative, hence invalid. The passed value is also mentioned in the error message.

111Invalid negative value for pairableTimeout:

The pairableTimeout parameter value cannot be negative, hence invalid. The passed value is also mentioned in the error message.

112Failed to change bluetooth power status

The default Bluetooth adapter cannot be either enabled or disabled as requested in the method.

113Failed to set adapter properties

The Bluetooth adapter properties cannot be set to the stack(bluez5/bsa) as requested in this method.

Example

# luna-send -f -n 1 luna://com.webos.service.bluetooth2/adapter/setState '{
   "powered":true
}'

Response:

{  
   "returnValue":true,
   "adapterAddress":"00:00:45:0e:48:9b"
}

adapter/startDiscovery

Description

Starts discovering the remote Bluetooth devices. 

Note:

  • Discovery continues until adapter/cancelDiscovery​ is called or for bluetooth2AdapterStatus.discoveryTimeout​ seconds (if non-zero).
  • The Discovery of a specific Adapter can be invoked by passing the adapter address.
  • To get the list of devices found, subscribe to device/getStatus.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
adapterAddressRequiredString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Error Codes Reference

Error Code

Error Text

Error Description

101See API Error Codes Reference

See API Error Codes Reference.

114Can'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.

115Failed to start discovery

The Bluetooth stack could not initiate discovery of remote Bluetooth devices.

Example

# luna-send -n 1 -f luna://com.webos.service.bluetooth2/adapter/startDiscovery '{ }'

Response:

{  
   "returnValue":true,
   "adapterAddress":"00:00:45:0e:48:9b"
}

adapter/supplyPasskey

Description

Supplies the user-entered passkey.

Note: The passkey is entered when adapter/pair sends a subscription response containing request:enterPasskey​.

Parameters

Name

Required

Type

Description

addressRequiredString

Indicates the address (bdaddr) of the remote device.

passkeyRequiredNumber

Indicates the passkey entered by the user.

Call Returns

Name

Required

Type

Description

adapterAddressRequiredString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Error Codes Reference

Error Code

Error Text

Error Description

1-13, 101, 102, 105, 143, 144See API Error Codes Reference

See API Error Codes Reference.

119Required 'passkey' parameter not supplied

The passkey parameter is mandatory to this method, but was not supplied by the caller of the method.

Example

# 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
}

adapter/supplyPasskeyConfirmation

Description

Supplies the user's confirmation for the passkey.

Note: The user confirms the passkey when adapter/pair sends a subscription response containing request:confirmPasskey​.

Parameters

Name

Required

Type

Description

addressRequiredString

Indicates the address (bdaddr) of the remote device with which pairing is being attempted.

acceptRequiredBoolean

Indicates if the user has confirmed the passkey.

Possible values are: 

  • true: User confirmed the passkey.
  • false: User did not confirm the passkey.

Call Returns

Name

Required

Type

Description

adapterAddressRequiredString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.

Note: If accept is false, the adapter/pair method will send a final subscription response containing returnValue:false indicating that the pairing has failed.

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Error Codes Reference

Error Code

Error Text

Error Description

1-13, 101, 102, 105, 108, 143, 144See API Error Codes Reference

See API Error Codes Reference.

121Required 'accept' parameter not supplied

The accept parameter is mandatory for this method, but was not supplied by the caller of the method.

Example

# 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
}

adapter/supplyPinCode

Description

Supplies the user-entered PIN code.

Note: The PIN code is entered when adapter/pair sends a subscription response containing request:enterPinCode.

Parameters

Name

Required

Type

Description

addressRequiredString

Indicates the address (bdaddr) of the remote device.

pinRequiredString

Indicates the PIN code entered by the user.

Call Returns

Name

Required

Type

Description

adapterAddressRequiredString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.

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.

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Error Codes Reference

Error Code

Error Text

Error Description

1-13, 101, 102, 105, 143, 144See API Error Codes Reference

See API Error Codes Reference.

120Required 'pin' parameter not supplied

The pin parameter is mandatory to this method, but was not supplied by the caller of the method.

Example

# 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
}

adapter/unpair

Description

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.

Parameters

Name

Required

Type

Description

addressRequiredString

Indicates the address (bdaddr) of the remote device to unpair.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
adapterAddressRequiredString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Error Codes Reference

Error Code

Error Text

Error Description

101, 102, 105, 106, 143, 144See API Error Codes Reference

See API Error Codes Reference.

122Failed to unpair

Failed to unpair the Bluetooth adapter with the paired remote Bluetooth device.

Example

# 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
}

avrcp/awaitMediaMetaDataRequest

Description

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.

Parameters

Name

Required

Type

Description

subscribeRequiredBoolean

Indicates if subscribed for notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.

Note: The caller must subscribe to this method.

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
adapterAddressRequiredString

Indicates the address of the adapter.

subscribedRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.

Note: subscribed will always contain true since subscription ends only when the client chooses to close it.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

errorCodeOptionalNumber

The error code for the failed operation.

Subscription Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
subscribedRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications
  • false: Not subscribed

Note: subscribed will always contain true since subscription ends only when the client chooses to close it.

addressRequiredString

Indicates the address (bdaddr) of the remote device.

adapterAddressRequiredString

Indicates the address of the adapter.

requestIdRequiredString

Indicates the unique ID of a request.

Note: The format of requestId is "nnn", 3 digit number.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

errorCodeOptionalNumber

The error code for the failed operation.

Error Codes Reference

Error Code

Error Text

Error Description

101, 103, 104, 143, 144See API Error Codes Reference

See the API Error Codes Reference section.

161Adapter is turned off

The Bluetooth adapter is turned off.

Example

# 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
}

avrcp/awaitMediaPlayStatusRequest

Description

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.

Parameters

Name

Required

Type

Description

subscribeRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.

Note: The caller must subscribe to this method.

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
adapterAddressRequiredString

Indicates the address of the adapter.

subscribedRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.

Note: subscribed will always contain true since subscription ends only when the client chooses to close it.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

errorCodeOptionalNumber

The error code for the failed operation.

Subscription Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
subscribedRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications
  • false: Not subscribed

Note: subscribed will always contain true since subscription ends only when the client chooses to close it.

addressRequiredString

Indicates the address (bdaddr) of the remote device.

adapterAddressRequiredString

Indicates the address of the adapter.

requestIdRequiredString

Indicates the unique ID of a request.

Note: The format of requestId is "nnn", 3 digit number.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

errorCodeOptionalNumber

The error code for the failed operation.

Error Codes Reference

Error Code

Error Text

Error Description

101, 103, 104, 143, 144See API Error Codes Reference

See the API Error Codes Reference section.

161Adapter is turned off

The Bluetooth adapter is turned off.

Example

# 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
}

avrcp/connect

Description

Opens an AVRCP connection to a remote Bluetooth device.

Parameters

Name

Required

Type

Description

addressRequiredString

Indicates the address (bdaddr) of the remote device.

subscribeOptionalBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.
adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
adapterAddressRequiredString

Indicates the address of the adapter.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

errorCodeOptionalNumber

The error code for the failed operation.

subscribedRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications (will be true until the final response is sent by the service before stopping.)
  • false: Not subscribed.

Subscription Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
subscribedRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.
disconnectByRemoteRequiredString

Indicates whether the remote device or the local user initiated the disconnection.

Possible values are:

  • true: Remote device initiated the disconnection.
  • false: Local user initiated the disconnection.
adapterAddressRequiredString

Indicates the address of the adapter.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

errorCodeOptionalNumber

The error code for the failed operation.

Error Codes Reference

Error Code

Error Text

Error Description

102, 103, 105, 106, 127, 143, 144See API Error Codes Reference

See the API Error Codes Reference section.

128Device is already connecting

The remote Bluetooth device is already connecting to AVRCP profile, so another connection cannot be opened.

129Device is not paired

The remote Bluetooth device is not paired, so AVRCP connection cannot be opened.

130Failed to connect with remote device

The remote Bluetooth device cannot be connected to AVRCP profile.

131Already connected

The remote Bluetooth device is already connected to the adapter's AVRCP profile, so another connection cannot be opened.

Example

# 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
}

avrcp/disconnect

Description

Drops the connection to the given remote device on the AVRCP profile.

Parameters

Name

Required

Type

Description

addressRequiredString

Indicates the address (bdaddr) of the remote device.

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
adapterAddressRequiredString

Indicates the address of the adapter.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

errorCodeOptionalNumber

The error code for the failed operation.

Error Codes Reference

Error Code

Error Text

Error Description

102, 105, 106, 127, 143, 144See API Error Codes Reference

See the API Error Codes Reference section.

132Failed to disconnect from remote device

The AVRCP connection with the remote Bluetooth device could not be closed.

Example

# 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
}

avrcp/getMediaMetaData

Description

Gets media metadata of the target from remote devices connected via AVRCP 1.3 profile.

Parameters

Name

Required

Type

Description

subscribeRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications
  • false: Not subscribed

Note: The caller must subscribe to this method.

addressRequiredString

Indicates the address (bdaddr) of the remote device.

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
subscribedRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed
addressRequiredString

Indicates the address (bdaddr) of the remote device.

adapterAddressRequiredString

Indicates the address of the adapter.

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

Subscription Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
subscribedRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.
addressRequiredString

Indicates the address (bdaddr) of the remote device.

adapterAddressRequiredString

Indicates the address of the adapter.

metaDataRequiredObject: bluetooth2MediaMetaData

Indicates the metaData of the media.

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

Error Codes Reference

Error Code

Error Text

Error Description

106, 127, 136, 143, 144See API Error Codes Reference

See the API Error Codes Reference section.

Example

# 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
     }
}

avrcp/getMediaPlayStatus

Description

Gets the media metadata of the target from remote devices connected via AVRCP 1.3 profile.

Parameters

Name

Required

Type

Description

subscribeRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.

Note: The caller must subscribe to this method.

addressRequiredString

Indicates the address (bdaddr) of the remote device.

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
subscribedRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.
addressRequiredString

Indicates the address (bdaddr) of the remote device.

adapterAddressRequiredString

Indicates the address of the adapter.

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

Subscription Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
subscribedRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.
addressRequiredString

Indicates the address (bdaddr) of the remote device.

adapterAddressRequiredString

Indicates the address of the adapter.

playbackStatusRequiredObject: bluetooth2PlayStatus

Indicates the information about the playbackStatus of the media.

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

Error Codes Reference

Error Code

Error Text

Error Description

103, 106, 127, 136, 143, 144See API Error Codes Reference

See the API Error Codes Reference section.

Example

# 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"
   }
}

avrcp/getPlayerApplicationSettings

Description

Gets the player application settings value.

Parameters

Name

Required

Type

Description

subscribeRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.
addressRequiredString

Indicates the address (bdaddr) of the remote device.

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
subscribedRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.
addressRequiredString

Indicates the address (bdaddr) of the remote device.

adapterAddressRequiredString

Indicates the address of the adapter.

errorCodeOptionalString

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

Subscription Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
subscribedRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.
addressRequiredString

Indicates the address (bdaddr) of the remote device.

adapterAddressRequiredString

Indicates the address of the adapter.

equalizerRequiredString

Indicates the status of the equalizer.

Possible values are:

  • off
  • on
repeatRequiredString

Indicates the status of the repeat mode.

Possible values are:

  • off
  • singletrack
  • alltracks
  • group
shuffleRequiredString

Indicates the status of the shuffle.

Possible values are:

  • off
  • alltracks
  • group
scanRequiredString

Indicates the status of the scan.

Possible values are:

  • off
  • alltracks
  • group
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

Error Codes Reference

Error Code

Error Text

Error Description

103, 106, 127, 136, 143, 144See API Error Codes Reference

See the API Error Codes Reference section.

Example

# 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"
}

avrcp/getRemoteVolume

Description

Gets the volume of the remote device.

Note: The method supports 'Volume Changed Notification' only.

Parameters

Name

Required

Type

Description

subscribeRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.

Note: The caller must subscribe to this method.

addressOptionalString

Indicates the address (bdaddr) of the remote device.

Note: If not specified, returns all requested volume info from the all connected devices.

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.

Call Returns

Name

Required

Type

Description

returnValueRequiredString

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
subscribedRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications
  • false: Not subscribed

Note: subscribed will always contain true since subscription ends only when the client chooses to close it.

adapterAddressRequiredString

Indicates the address of the adapter.

addressOptionalString

Indicates the address (bdaddr) of the remote device.

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

Subscription Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
subscribedRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications
  • false: Not subscribed
adapterAddressRequiredString

Indicates the address of the adapter.

addressOptionalString

Indicates the address (bdaddr) of the remote device.

volumeRequiredNumber

Indicates the requested volume level in percentage.

Possible range: 0 ~ 100.

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

Error Codes Reference

Error Code

Error Text

Error Description

103, 106, 127, 136, 143, 144See API Error Codes Reference

See the API Error Codes Reference section.

Example

# 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
}

avrcp/getStatus

Description

Returns the status of an AVRCP connection to a remote Bluetooth device.

Parameters

Name

Required

Type

Description

addressRequiredString

Indicates the address (bdaddr) of the remote device.

subscribeOptionalBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.
adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
connectingRequiredBoolean

Indicates whether the connection request is currently being processed.

Possible values are:

  • true: Request is being processed.
  • false: Not being processed. For example, if the Bluetooth stack is no longer processing the connection request.
connectedRequiredBoolean

Indicates if the connection is open.

Possible values are:

  • true: Connection is open.
  • false: Connection is not open.
adapterAddressRequiredString

Indicates the address of the adapter.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

errorCodeOptionalNumber

The error code for the failed operation.

Subscription Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
subscribedRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications
  • false: Not subscribed
connectingRequiredBoolean

Indicates whether the connection request is currently being processed.

Possible values are:

  • true: Request is being processed.
  • false: Not being processed. For example, if the Bluetooth stack is no longer processing the connection request.
connectedRequiredBoolean

Indicates if the connection is open.

Possible values are:

  • true: Connection is open.
  • false: Connection is not open.
adapterAddressRequiredString

Indicates the address of the adapter.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

errorCodeOptionalNumber

The error code for the failed operation.

Error Codes Reference

Error Code

Error Text

Error Description

102, 105, 106, 127, 143, 144See API Error Codes Reference

See the API Error Codes Reference section.

133Failed to retrieve state for remote device

The AVRCP connection status of the remote Bluetooth device cannot be retrieved.

Example

# 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
}

avrcp/internal/disable

Description

Disables the profile and role of AVRCP.

Parameters

Name

Required

Type

Description

roleOptionalString

Indicates the type of AVRCP role to be disabled.

Possible values are:

  • AVRCP-TG
  • AVRCP-CT

Note: If not specified, the role which is possible is disabled.

adapterAddressOptionalString

Indicates the address of the adapter.

Note: If not specified, the default adapter will be used.

Call Returns

Name

Required

Type

Description

adapterAddressRequiredString

Indicates the address of the adapter.

Note: If not specified, the default adapter will be used.

returnValueRequiredBoolean

Indicates the status of operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

Error Codes Reference

Error Code

Error Text

Error Description

143, 144, 249, 251See API Error Codes Reference

See the API Error Codes Reference section.

Example

# luna-send -f -n 1 luna://com.webos.service.bluetooth2/avrcp/internal/disable '{
   "role":"AVRCP-TG"
}'

avrcp/internal/enable

Description

Enables the profile and the role of AVRCP.

Parameters

Name

Required

Type

Description

roleOptionalString

Indicates the AVRCP role to be enabled.

Possible values are:

  • AVRCP-TG
  • AVRCP-CT

Note: If not specified, the role which is possible is enabled.

adapterAddressOptionalString

Indicates the address of the adapter.

Note: If not specified, the default adapter will be used.

Call Returns

Name

Required

Type

Description

adapterAddressRequiredString

Indicates the address of the adapter.

Note: If not specified, the default adapter will be used.

returnValueRequiredBoolean

Indicates the status of operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalBoolean

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

Error Codes Reference

Error Code

Error Text

Error Description

143, 144, 248, 250See API Error Codes Reference

See the API Error Codes Reference section.

Example

# luna-send -f -n 1 luna://com.webos.service.bluetooth2/avrcp/internal/enable '{
   "role":"AVRCP-TG"
}'

avrcp/internal/getRemoteFeatures

Description

Gets the remote AVRCP's features.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

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.

addressRequiredString

Indicates the address (bdaddr) of the remote device.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details
adapterAddressRequiredString

Indicates the address of the adapter.

Note: If not specified, the default adapter will be used.

addressRequiredString

Indicates the address (bdaddr) of the remote device.

remoteFeaturesRequiredObject array: bluetooth2AvrcpRemoteFeatureInfo

Indicates an array of the remote features.

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

Error Codes Reference

Error Code

Error Text

Error Description

101,143,144See API Error Codes Reference

See the API Error Codes Reference section.

Example

# luna-send -f -n 1 luna://com.webos.service.bluetooth2/avrcp/internal/getRemoteFeatures '{
   "address":"aa:bb:cc:dd:ee:ff"
}'

avrcp/internal/getSupportedNotificationEvents

Description

Gets the remote AVRCP's supported notification events.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

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.

addressRequiredString

Indicates the address (bdaddr) of the remote device.

subscribeRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications
  • false: Not subscribed

Note: The caller must subscribe to this method.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details
adapterAddressRequiredString

Indicates the address of the adapter.

subscribedRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications
  • false: Not subscribed

Note: subscribed will always contain true since subscription ends only when the client chooses to close it.

addressRequiredString

Indicates the address (bdaddr) of the remote device.

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

Subscription Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
subscribedRequiredBoolean

Indicates if subscribed to get notified when a connection is closed.

  • true: Subscribed for notifications
  • false: Not subscribed
addressRequiredString

Indicates the address (bdaddr) of the remote device.

adapterAddressRequiredString

Indicates the address of the adapter.

Note: If not specified, the default adapter will be used.

supportedNotificationEventsRequiredNumber array

Indicates the list of remote avrcp's supported notification events.

Possible values are:

  • 1 : Playback status changed
  • 2 : Track changed
  • 3 : Track reached end
  • 4 : Track reached start
  • 5 : Playback position changed
  • 6 : Battery status changed
  • 7 : System status changed
  • 8 : Player application setting changed
  • 9 : Now playing changed
  • 10 : Available players changed
  • 11 : Addressed players changed
  • 12 : UIDs changed
  • 13 : Volume changed
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

Error Codes Reference

Error Code

Error Text

Error Description

101,143,144See API Error Codes Reference

See the API Error Codes Reference section.

Example

# luna-send -f -n 1 luna://com.webos.service.bluetooth2/avrcp/internal/getSupportedNotificationEvents '{  
       "address":"aa:bb:cc:dd:ee:ff",
       "subscribe":true
}'

avrcp/receivePassThroughCommand

Description

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).

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
addressRequiredString

Indicates the address (bdaddr) of the remote device.

subscribeRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications
  • false: Not subscribed

Note: The caller must subscribe to this method.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details
adapterAddressRequiredString

Indicates the address of the adapter.

subscribedRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications
  • false: Not subscribed

Note: subscribed will always contain true since subscription ends only when the client chooses to close it.

addressRequiredString

Indicates the address (bdaddr) of the remote device.

errorCodeOptionalBoolean

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Subscription Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
subscribedRequiredBoolean

Indicates if subscribed to get notified when a connection is closed.

  • true: Subscribed for notifications
  • false: Not subscribed
addressRequiredString

Indicates the address (bdaddr) of the remote device.

adapterAddressRequiredString

Indicates the address of the adapter.

keyCodeRequiredString

The key code which is operated.

Possible values are:

  • play
  • pause
  • mute
  • stop
  • next
  • previous
  • fastForward
  • rewind
  • volumeUp
  • volumeDown
keyStatusRequiredString

Indicates the key status.

Possible values are:

  • pressed
  • released
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Error Codes Reference

Error Code

Error Text

Error Description

101,143,144See API Error Codes Reference

See the API Error Codes Reference section.

Example

# luna-send -f -n 1 luna://com.webos.service.bluetooth2/avrcp/receivePassThroughCommand '{
    "address": "aa:bb:cc:dd:ee:ff",
    "subscribe" : true
}'

avrcp/sendPassThroughCommand

Description

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.

Parameters

Name

Required

Type

Description

keyCodeRequiredString

The key code which is operated.

Possible values are:

  • play
  • pause
  • mute
  • stop
  • next
  • previous
  • fastForward
  • rewind
  • volumeUp
  • volumeDown
keyStatusRequiredString

The key status.

Possible values are:

  • pressed
  • released
addressRequiredString

Indicates the address (bdaddr) of the remote device.

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
adapterAddressRequiredString

Indicates the address of the adapter.

addressRequiredString

Indicates the address (bdaddr) of the remote device.

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

Error Codes Reference

Error Code

Error Text

Error Description

106, 127, 136, 143, 144, 237, 238, 239, 240, 241, 242See the "API Error Codes Reference" section.

See the API Error Codes Reference section.

Example

# 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"
}

avrcp/setAbsoluteVolume

Description

Sets the absolute volume on the target device.

Parameters

Name

Required

Type

Description

volumeRequiredNumber

Indicates the requested volume level in percentage.

Possible range: 0 ~ 100.

addressRequiredString

Indicates the address (bdaddr) of the remote device.

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details
adapterAddressRequiredString

Indicates the address of the adapter.

addressRequiredString

Indicates the address (bdaddr) of the remote device.

errorCodeOptionalString

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

Error Codes Reference

Error Code

Error Text

Error Description

106, 127, 136, 143, 144, 237, 252, 253, 254See API Error Codes Reference

See the API Error Codes Reference section.

Example

# 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"
}

avrcp/setPlayerApplicationSettings

Description

Sets the player application settings value.

Parameters

Name

Required

Type

Description

addressRequiredString

Indicates the address (bdaddr) of the remote device.

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
equalizerOptionalString

Indicates the status of the equalizer.

Possible values are:

  • off
  • on
repeatOptionalString

Indicates the status of repeat mode.

Possible values are:

  • off
  • singletrack
  • alltracks
  • group
shuffleOptionalString

Indicates the status of shuffle.

Possible values are:

  • off
  • alltracks
  • group
scanOptionalString

Indicates the status of scan.

Possible values are:

  • off
  • alltracks
  • group

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details
adapterAddressRequiredString

Indicates the address of the adapter.

addressRequiredString

Indicates the address (bdaddr) of the remote device.

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

Error Codes Reference

Error Code

Error Text

Error Description

106, 127, 136, 143, 144, 243, 244, 245, 246See API Error Codes Reference

See the "API Error Codes Reference" section.

Example

# 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"
}

avrcp/supplyMediaMetaData

Description

Supplies media metadata of the target to remote devices connected via AVRCP 1.3 profile.

Parameters

Name

Required

Type

Description

requestIdRequiredString

Indicates the unique ID of a request.

Note: The format of requestId is "nnn", a three-digit number.

metaDataRequiredObject: bluetooth2MediaMetaData

Indicates the metaData of the media.

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
adapterAddressRequiredString

Indicates the address of the adapter.

requestIdRequiredString

Indicates the unique ID of a request.

Note: The format of requestId is "nnn", a three-digit number.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

errorCodeOptionalNumber

The error code for the failed operation.

Error Codes Reference

Error Code

Error Text

Error Description

127, 143, 144See API Error Codes Reference

See API Error Codes Reference.

186Required 'requestId' parameter is not supplied

requestId parameter is missing in arguments.

187Request is currently not allowed

The TG (Target) is not awaiting for media play status request.

188The supplied requestId does not exist

The supplied requestId does not exist, hence the method cannot be completed.

Example

# 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,
      "duration":225
   }
}'

 

Response for a successful call:

{  
   "requestId":"001",
   "adapterAddress":"00:00:c5:99:f5:87",
   "returnValue":true
}

 

Response for a failed call: If the supplied requestId does not exist

{  
   "errorCode":188,
   "returnValue":false,
   "errorText":"The supplied requestId does not exist"
}

avrcp/supplyMediaPlayStatus

Description

Supplies media play status of the target to remote devices connected via AVRCP 1.3 profile.

Parameters

Name

Required

Type

Description

requestIdRequiredString

The unique ID of a request. 

The format of requestId is "nnn", a three-digit number.

playbackStatusRequiredObject: bluetooth2PlayStatus

The information about play status of the media.

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of operation. Possible values are:

  • true - Indicates that the operation was successful.
  • false - Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
adapterAddressRequiredString

Indicates the address of the adapter.

requestIdRequiredString

The unique ID of a request. 

The format of requestId is "nnn", a three-digit number.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

errorCodeOptionalNumber

The error code for the failed operation.

Error Codes Reference

Error Code

Error Text

Error Description

127, 143, 144See API Error Codes Reference

See API Error Codes Reference.

186Required 'requestId' parameter is not supplied

requestId parameter is missing in arguments.

187Request is currently not allowed

The TG (Target) is not waiting for media playstatus request.

188The supplied requestId does not exist

The supplied requestId does not exist, hence the method cannot be completed.

Example

# luna-send -f -n 1 luna://com.webos.service.bluetooth2/avrcp/supplyMediaPlayStatus '{  
   "requestId":"001",
   "playbackStatus":{  
      "duration":225,
      "position":100,
      "status":"playing"
   }
}'

 

Response for a successful call:

{  
   "requestId":"001",
   "adapterAddress":"00:00:c5:99:f5:87",
   "returnValue":true
}

 

Response for a failed call: If the supplied requestId does not exist

{  
   "errorCode":188,
   "returnValue":false,
   "errorText":"The supplied requestId does not exist"
}

device/getStatus

Description

Gets the current status of remote Bluetooth devices known to the system.​ 

Parameters

Name

Required

Type

Description

subscribeOptionalBoolean

Indicates if subscribed to get notifications.

 Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.

Default: false

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.

Call Returns

Name

Required

Type

Description

subscribedRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.
returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.

Note: returnValue will always contain true unless the request for subscription fails.

adapterAddressRequiredString

Indicates the address of the adapter.

devicesRequiredObject array: bluetooth2DeviceStatus

Contains status information of all the devices known to the system, not just the ones whose status has been changed.

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Subscription Returns

Name

Required

Type

Description

subscribedRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false:  Not subscribed.
returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.

Note: returnValue will always contain true unless the request for subscription fails.

adapterAddressRequiredString

Indicates the address of the adapter.

devicesRequiredObject array: bluetooth2DeviceStatus

Contains the status information of all the devices known to the system, and not just the ones whose status has been changed.

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Error Codes Reference

Error Code

Error Text

Error Description

101, 143, 144See API Error Codes Reference

See API Error Codes Reference.

Example

# 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
      }
   ]
}

# 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
}

device/setState

Description

Sets the local values for the state of a remote device.

Parameters

Name

Required

Type

Description

addressRequiredString

Indicates the address (bdaddr) of the remote device.

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
trustedOptionalBoolean

Indicates whether to set a remote device as a trusted device. Possible values are:

  • true - Sets it as a trusted device. 
  • false - Sets it as a untrusted device. 

Default value: false

blockedOptionalBoolean

Indicates whether to block (if set) or unblock (if reset) a remote device for pairing and profile connections. Possible values are:

  • true - Blocks incoming connections. Any incoming connection from the device will be immediately rejected. Also, device drivers will be removed and no new ones will be probed as long as the device is blocked.
  • false - Unblocks connections. 

Default value: false

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Error Codes Reference

Error Code

Error Text

Error Description

5, 101, 105, 106, 143, 144See API Error Codes Reference

See API Error Codes Reference.

148No 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.

149Failed to set device properties

The Bluetooth stack fails to set the supplied device properties for the given device.

Example

# luna-send -f -n 1 luna://com.webos.service.bluetooth2/device/setState '{
   "address":"34:4d:f7:f9:52:f7",
   "trusted":true
}'

Response:

{  
   "returnValue":true
}

gatt/addService

Description

Adds a new service definition to the local database.

Note: The new service will be directly exposed to clients which are discovering available services.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
serviceRequiredString

Indicates the unique identifier of the service.

typeRequiredString

Indicates the type of the service.

Possible values are:

  • primary
  • secondary
includesRequiredString array

Indicates an array that contains a list of UUIDs the service includes.

characteristicsRequiredObject array: bluetooth2GattCharacteristicInfo

Indicates the information about GATT characteristics of the service.

serverIdOptionalString

Indicates the server identifier to add the service to.

Note: If not specified, the default value of serverId is used automatically.

Call Returns

Name

Required

Type

Description

adapterAddressRequiredString

Indicates the address of the adapter.

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

serverIdRequiredString

Indicates the server identifier to add the service.

Error Codes Reference

Error Code

Error Text

Error Description

127,143,144,175,170See API Error Codes Reference

See API Error Codes Reference.

Example

# 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"
}

gatt/closeServer

Description

Closes the BluetoothGattServer.

Parameters

Name

Required

Type

Description

serverIdRequiredString

Indicates the unique identifier of a server to remove on the stack.

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details
adapterAddressRequiredString

Indicates the address of the adapter.

Note: If not specified, the address of the default adapter will be used.

errorCodeOptionalString

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. 

Example

# luna-send -f -n 1 luna://com.webos.service.bluetooth2/gatt/closeServer '{
   "serverId":"001"
}'

Response:

{  
   "adapterAddress":"00:00:9a:1d:89:5d",
   "returnValue":true
}

# 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
}

gatt/connect

Description

Connects to the GATT profile on the specified remote device.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
addressRequiredString

Indicates the address of the remote device.

subscribeOptionalBoolean

Indicates if subscribed to get the notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.

​Default: false

Note: Disconnection can also happen when local adapter calls the gatt/disconnect method (initiated by the local user)

autoConnectOptionalBoolean

Indicates if the remote device is automatically connected.

Possible values are:

  • true: Automatically connects as soon as the remote device becomes available.
  • false: Manually connect to the remote device.

Default: false

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
adapaterAddressRequiredString

Indicates the address of the adapter.

addressRequiredString

Indicates the address of the remote device.

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

clientIdRequiredString

Indicates the unique ID of a remote device, which has the following format: "nnn", 3 digit number increasing sequentially.

Subscription Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.

Note: returnValue will always contain false, indicating that the remote device has closed the connection.

adapaterAddressRequiredString

Indicates the address of the adapter.

addressRequiredString

Indicates the address of the remote device.

subscribedRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.

Note: subscribed will always contain false, indicating that the service will not send any further subscription responses.

disconnectByRemoteOptionalBoolean

Indicates if the remote device or the local user initiated the disconnect.

Possible values are:

  • true: Disconnect initiated by remote device.
  • false: Disconnect initiated by local user.

Error Codes Reference

Error Code

Error Text

Error Description

102, 105, 106, 127, 143, 144See API Error Codes Reference

See API Error Codes Reference

Example

# 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"
}

gatt/disconnect

Description

Drops the connection to the given remote device on GATT profile.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
clientIdRequiredString

Indicates the unique identifier of the remote device.

Format: "nnn", 3 digit number increasing sequentially.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
adapterAddressRequiredString

Indicates the address of the adapter.

addressRequiredString

Indicates the address of the remote device.

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Error Codes Reference

Error Code

Error Text

Error Description

102, 105, 106, 127, 143, 144See API Error Codes Reference

See API Error Codes Reference.

Example

# 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
}

# 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"
}

gatt/discoverServices

Description

Discovers available services for the given remote device.

Pre-requisite:

  • The given remote device should be connected through gatt/connect method. Otherwise, the method will fail.

Note:

  • When a discovery process is already running, any further call to this method will succeed but will not restart the discovery.
  • Current discovery state is notified through gatt/getStatus method.
  • Discovered services are notified through gatt/getServices method. 

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
addressOptionalString

Indicates the address of the remote device.

Call Returns

Name

Required

Type

Description

adapterAddressRequiredString

Indicates the address of the adapter.

addressOptionalString

Indicates the address of the remote device.

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Error Codes Reference

Error Code

Error Text

Error Description

102, 105, 106, 127, 143, 144See API Error Codes Reference

See API Error Codes Reference.

Example

# 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"
}

gatt/getServices

Description

Gets available services for either the given local Bluetooth adapter or remote device.

Note:

  • Depending on the passed parameter, a list of services is returned:
    • If adapterAddress is passed, a list of services for the given adapter will be returned.
    • If address is passed, a list of services for the given remote device will be returned.
    • If both address and adapterAddress are passed, the method will return an error.
    • If none of both is passed, the method will return an error.

Parameters

Name

Required

Type

Description

adapterAddressRequiredString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
addressRequiredString

Indicates the address of the remote device.

subscribeOptionalBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.

Default: false

Call Returns

Name

Required

Type

Description

adapterAddressRequiredString

Indicates the address of the adapter.

addressRequiredString

Indicates the address of the remote device.

servicesRequiredObject array: bluetooth2GattServiceInfo

Indicates the list of the available services.

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
subscribedOptionalBoolean

Indicates if subscribed to get the notifications.

Possible values are:

  • true: Subscribed for notifications
  • false: Not subscribed
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Subscription Returns

Name

Required

Type

Description

adapterAddressRequiredString

Indicates the address of the adapter.

addressRequiredString

Indicates the address of the remote device.

servicesRequiredObject: bluetooth2GattServiceInfo

Indicates the list of the available services.

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
subscribedOptionalBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications
  • false: Not subscribed
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Error Codes Reference

Error Code

Error Text

Error Description

127,144,162,169,106,136See API Error Codes Reference

See API Error Codes Reference.

Example

# 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"
}

gatt/getStatus

Description

Returns the status of GATT connection to the given remote device.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
addressRequiredString

Indicates the address of the remote device.

subscribeOptionalBoolean

Indicates if subscribed to get the notifications.

Possible values are:

  • true: Subscribed for notifications
  • false: Not subscribed

Default: false

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
adapterAddressRequiredString

Indicates the address of the adapter.

addressRequiredString

Indicates the address of the remote device.

connectingRequiredBoolean

Indicates if the connection request is currently being processed.

Possible values are:

  • true: Request is being processed.
  • false: Not being processed. For example, if the Bluetooth stack is no longer processing the connection request.
connectedRequiredBoolean

Indicates if the connection is open.

Possible values are:

  • true: Connection is open.
  • false: Connection is not open.
discoveringServicesRequiredBoolean

Indicates if the discovery service request is currently being processed for the given remote device.

Possible values are:

  • true: Currently being processed.
  • false: Not processed.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

subscribedRequiredBoolean

Indicates if subscribed to get the notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.

Subscription Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.

Note: returnValue will contain true until the final response is sent by the service before stopping.

adapterAddressRequiredString

Indicates the address of the adapter.

addressRequiredString

Indicates the address of the remote device.

connectingRequiredString

Indicates if the connection request is currently being processed.

Possible values are:

  • true: Request is being processed.
  • false: Not being processed. For example, if the Bluetooth stack is no longer processing the connection request.
connectedRequiredBoolean

Indicates if the connection is open.

Possible values are:

  • true: Connection is open.
  • false: Connection is not open.
discoveringServicesRequiredBoolean

Indicates if the discovery service request is currently being processed for the given remote device.

Possible values are:

  • true: Currently being processed
  • false: Not processed
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

subscribedRequiredBoolean

Indicates if subscribed to get the notifications.

Possible values are:

  • true: Subscribed for notifications
  • false: Not subscribed

Error Codes Reference

Error Code

Error Text

Error Description

102, 105, 106, 127, 143, 144See API Error Codes Reference

See API Error Codes Reference.

Example

# 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
}

gatt/monitorCharacteristic

Description

Monitors specific characteristic value changes.

Note:

  • If the characteristic is not marked as being notifiable, the method will fail.
  • If the address is not set, monitors specific characteristics of the local service for value changes.
  • If the address is set, monitors specific characteristics of the given remote device for characteristic value changes.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
serviceOptionalString

Indicates the UUID of the service the characteristic belongs to.

Note: Either this and characteristic, or instanceId is required.

characteristicOptionalString

Indicates the UUID of the characteristic to be monitored.

Note: Either this and service, or instanceId is required.

InstanceIdOptionalString

Indicates the unique identifier of a characteristic to monitored, which has the following format: "nnn".

Note: Either this, or service and characteristic are required.

serverIdOptionalString

Indicates the identifier of server to get the characteristic from.

  • To read the value of characteristic, set serverId to specific server identifier.
  • Or to read in remote device, set clientId to specific remote device identifier.
  • If both serverId and clientId not specified, find characteristic in the webOS device.
clientIdOptionalString

Indicates the identifier of the remote device (client) to get the characteristic from.

  • To read the value of characteristics, set serverId to specific server identifier.
  • Or to read in remote device, set clientId to specific remote device identifier.
  • If both serverId and clientId not specified, find characteristics in the webOS device.
subscribeOptionalBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications
  • false: Not subscribed

Note: Must set subscribe to true.

Call Returns

Name

Required

Type

Description

adapterAddressRequiredString

Indicates the address of the adapter.

addressOptionalString

Indicates the address of the remote.

subscribedOptionalBoolean

Indicates if subscribed to get the notifications.

Possible values are:

  • true: Subscribed for notifications
  • false: Not subscribed
returnValueRequiredBoolean

Indicates the status of operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalString

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Subscription Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details
subscribedRequiredBoolean

Indicates if subscribed to get the notifications.

Possible values are:

  • true: Subscribed for notifications
  • false: Not subscribed
adapterAddressRequiredString

Indicates the address of the adapter.

addressOptionalString

Indicates the address of the remote device.

changedRequiredObject: bluetooth2GattCharacteristicValueInfo

Indicates the object containing the information about the characteristic uuid and value.

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Error Codes Reference

Error Code

Error Text

Error Description

105, 106, 127, 136, 143 , 144, 105, 162, 163, 166, 173, 176, 177See API Error Codes Reference

See the "API Error Codes Reference" section.

Example

# 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
}

gatt/monitorCharacteristics

Description

Monitors specific characteristic value changes.

  • If the characteristic is not marked as being notifiable, the method will fail.
  • If the address is not set, monitors specific characteristics of the local service for value changes.
  • If the address is set, monitors specific characteristics of the given remote device for characteristic value changes.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
serviceRequiredString

Indicates the UUID of the service to which the characteristic belongs to.

characteristicsRequiredString array

Indicates an array of strings where each string is a UUID of a characteristic to be monitored.

subscribeRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications
  • false: Not subscribed
serverIdOptionalString

Indicates the identifier of the server to get the characteristic from.

Note:

  • To be informed of changes to the value of characteristics, set serverId to specific server identifier.
  • Or to be informed in remote device, set clientId to specific remote device identifier.
  • If both serverId and clientId not specified, find characteristics in the webOS device.
clientIdOptionalString

Indicates the identifier of the remote device (client) to get the characteristics from.

Note:

  • To be informed of changes to the value of characteristics, set serverId to specific server identifier.
  • Or to be informed in remote device, set clientId to specific remote device identifier.
  • If both serverId and clientId not specified, find characteristics in the webOS device.

Call Returns

Name

Required

Type

Description

adapterAddressRequiredString

Indicates the address of the adapter.

addressOptionalString

Indicates the address of the remote device.

subscribedRequiredBoolean

Indicates if subscribed to get the notifications.

Possible values are:

  • true: Subscribed for notifications
  • false: Not subscribed
returnValueRequiredString

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Subscription Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details
subscribedRequiredBoolean

Indicates if subscribed to get the notifications.

Possible values are:

  • true: Subscribed for notifications
  • false: Not subscribed
adapterAddressRequiredString

Indicates the address of the adapter the operation was performed on.

addressOptionalString

Indicates the address of the remote device.

adapterAddressRequiredString

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.

changedRequiredObject: bluetooth2GattCharacteristicValueInfo

Object containing information about the characteristic uuid and values.

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Error Codes Reference

Error Code

Error Text

Error Description

105, 106, 127, 136, 143 , 144, 105, 162, 163, 166, 173, 176, 177See API Error Codes Reference

See the "API Error Codes Reference" section.

Example

# 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
}

gatt/openServer

Description

Opens the BluetoothGattServer managing services.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
adapterAddressRequiredString

Indicates the address of the adapter.

serverIdRequiredString

Indicates the unique identifier of a server, which has the following format: "nnn", 3 digit number increasing sequentially.

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Example

# luna-send -f -n 1 luna://com.webos.service.bluetooth2/gatt/openServer '{}'

Response:

{
   "adapterAddress":"00:00:9a:1d:89:5d",
   "serverId":"001",
   "returnValue":true
}

# 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"
}

gatt/readCharacteristicValue

Description

Reads the value of a specific characteristic. 

Note: 

  • When called from client side, the method actively reads and retrieves the latest value from the remote device rather than returning the value from the local cache.
  • When called from server side, the method just returns stored value from the local database.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
serviceOptionalString

Indicates the unique identifier of the service the characteristic belongs to.

Note: Either this and characteristic, or instanceId is required.

characteristicOptionalString

Indicates the unique identifier of the characteristic to read.

Note: Either this and service, or instanceId is required.

instanceIdOptionalString

Indicates the unique ID of the characteristic to read, which has the following format: "nnn".

Note: Either this, or service and characteristic are required.

serverIdOptionalString

Indicates the identifier of server to get the characteristic from.

  • To read the value of characteristics, set serverId to specific server identifier.
  • Or to read in remote device, set clientId to specific remote device identifier.
  • If both serverId and clientId not specified, find characteristics in the webOS device.
clientIdOptionalString

Indicates the identifier of the remote device (client) to get the characteristic from.

  • To read the value of characteristics, set serverId to specific server identifier.
  • Or to read in remote device, set clientId to specific remote device identifier.
  • If both serverId and clientId not specified, find characteristics in the webOS device.

Call Returns

Name

Required

Type

Description

adapterAddressRequiredString

Indicates the address of the adapter.

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details
addressOptionalString

Indicates the address of the remote device.

serviceRequiredString

Indicates the unique identifier of the service the characteristic belongs to.

valueRequiredObject: bluetooth2GattCharacteristicInfo

Indicates the value for requested characteristic.

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Error Codes Reference

Error Code

Error Text

Error Description

106,127,136,143,144,162,163,166,173,174See API Error Codes Reference

See API Error Codes Reference.

Example

# 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"
         }
      ]
   }
}

gatt/readCharacteristicValues

Description

Reads the value of a specific characteristic. 

  • When called from client side, the method actively reads and retrieves the latest value from the remote device rather than returning the value from the local cache.
  • When called from server side, the method just returns stored value from the local database.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used
serviceRequiredString

Indicates the unique identifier of the service the characteristic belongs to.

characteristicsRequiredString array

Indicates the unique identifiers of the characteristics to read.

serverIdOptionalString

Indicates the identifier of server to get the characteristic from.

Note:

  • To read the value of characteristics, set serverId to specific server identifier.
  • Or to read in remote device, set clientId to specific remote device identifier.
  • If both serverId and clientId not specified, find characteristics in the webOS device.
clientIdOptionalString

Indicates the identifier of the remote device (client) to get the characteristic from.

Note:

  • To read the value of characteristics, set serverId to specific server identifier.
  • Or to read in remote device, set clientId to specific remote device identifier.
  • If both serverId and clientId not specified, find characteristics in the webOS device.

Call Returns

Name

Required

Type

Description

adapterAddressRequiredString

Indicates the address of the adapter.

addressOptionalString

Indicates the address of the remote device.

serviceOptionalString

Indicates the unique identifier of the service the characteristic belongs to.

valuesOptionalObject: bluetooth2GattCharacteristicInfo

Indicates the values of the characteristic.

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Error Codes Reference

Error Code

Error Text

Error Description

106,127,136,143,144,162,163,166,173,174See API Error Codes Reference

See API Error Codes Reference.

Example

# 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"
            }
         ]
      }
   ]
}

gatt/readDescriptorValue

Description

Reads the value of descriptor of a service characteristic either in the local adapter or the remote device. 

  • When called from client side, the method actively reads and retrieves the latest value from the remote device rather than returning the value from the local cache.
  • When called from server side, the method just returns stored value from the local database.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used
serviceOptionalString

Indicates the unique identifier of the service the characteristic belongs to.

Note: Either this and characteristic and descriptor, or instanceId is required.

characteristicOptionalString

Indicates the unique identifier of the characteristic the descriptor belongs to.

Note: Either this and service and descriptor, or instanceId is required.

descriptorOptionalString

Indicates the Uuid of descriptor.

Note: Either this and service and characteristic, or instanceId is required.

instanceIdOptionalString

Unique identifier of the descriptor to read, which has the following format: "nnn". Either this, or service and characteristic, descriptor are required.

serverIdOptionalString

Indicates the identifier of server to get the descriptors from.

Note:

  • To read the value of descriptors, set serverId to specific server identifier.
  • Or to read in remote device, set clientId to specific remote device identifier.
  • If both serverId and clientId not specified, find descriptors in the webOS device.
clientIdOptionalString

Indicates the identifier of remote device (client) to get the descriptors from.

Note:

  • To read the value of descriptors, set serverId to specific server identifier.
  • Otherwise, set clientId to specific remote device identifier.
  • if both serverId and clientId not specified, find descriptors in the webOS device.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
adapterAddressRequiredString

Indicates the address of the adapter.

addressOptionalString

Indicates the address of the remote device.

serviceRequiredString

Indicates the unique identifier of the service the descriptor belongs to.

characteristicRequiredString

Indicates the unique identifier of the characteristic the descriptor belongs to.

valueRequiredObject: bluetooth2GattDescriptorInfo

Indicates the value for the requested descriptor.

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Error Codes Reference

Error Code

Error Text

Error Description

106,127,136,143,144,162,163,166,173,174See API Error Codes Reference

See API Error Codes Reference.

Example

# 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"
    }   
}

gatt/readDescriptorValues

Description

Read the value of descriptor(s) of a service characteristic either in the local adapter or the remote device. 

  • When called from client side, the method actively reads and retrieves the latest value from the remote device rather than returning the value from the local cache.
  • When called from server side, the method just returns stored value from the local database.

 

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used
serviceRequiredString

Indicates the unique identifier of the service the descriptor belongs to.

characteristicRequiredString

Indicates the unique identifier of the characteristic the descriptor belongs to.

descriptorsRequiredString array

Indicates the array of descriptors UUIDs.

serverIdOptionalString

Indicates the identifier of server to get the descriptors from.

Note:

  • To read the value of descriptors, set serverId to specific server identifier.
  • Or to read in remote device, set clientId to specific remote device identifier.
  • If both serverId and clientId not specified, find descriptors in the webOS device.
clientIdOptionalString

Indicates the identifier of the remote device (client) to get the descriptors from.

Note:

  • To read the value of descriptors, set serverId to specific server identifier.
  • Otherwise, set clientId to specific remote device identifier.
  • if both serverId and clientId not specified, find descriptors in the webOS device.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
adapterAddressRequiredString

Indicates the address of the adapter.

addressOptionalString

Indicates the address of the remote device.

serviceRequiredString

Indicates the unique identifier of the service the descriptor belongs to.

characteristicRequiredString

Indicates the unique identifier of the characteristic the descriptor belongs to.

valuesRequiredObject array: bluetooth2GattDescriptorInfo

Indicates the values for requested descriptors.

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Example

# 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"
        }
    ]
}

# 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"
        }
    ]
}

gatt/removeService

Description

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.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used
serviceRequiredString

Indicates the unique identifier of the service.

serverIdOptionalString

Indicates the identifier of server to remove the service from.

Note:

  • To remove the service, set serverId to specific server identifier.
  • If not specified, find service with uuid in the webOS device.

Call Returns

Name

Required

Type

Description

adapterAddressRequiredString

Indicates the address of the adapter.

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalBoolean

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Error Codes Reference

Error Code

Error Text

Error Description

127,143,163,144,171See API Error Codes Reference

See API Error Codes Reference.

Example

# luna-send -f -n 1 luna://com.webos.service.bluetooth2/gatt/removeService '{
   "service":"6161"
}'

Response:

{
   "adapterAddress":"00:00:68:64:d1:30",
   "returnValue":true
}

gatt/writeCharacteristicValue

Description

Writes the value for a local or remote characteristic.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used
serviceOptionalString

Indicates the UUID of the service the characteristic belongs to.

Note: Either this and service, or instanceId is required.

characteristicOptionalString

Indicates the UUID (unique identifier) of the characteristic.

Note: Either this and service, or instanceId is required.

instanceIdOptionalString

Indicates the unique identifier of the descriptors to read, which has the following format: "nnn".

Note: Either this, or service and characteristic are required.

valueRequiredObject: 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.

serverIdOptionalString

Indicates the identifier of server to get the characteristic from.

Note:

  • To write the value of characteristic, set serverId to specific server identifier.
  • Or to write in remote device, set clientId to specific remote device identifier.
  • If both serverId and clientId not specified, find characteristic in the webOS device.
clientIdOptionalString

Indicates the identifier of the remote device (client) to get the characteristic from.

Note:

  • To write the value of characteristic, set serverId to specific server identifier.
  • Or to write in remote device, set clientId to specific remote device identifier.
  • If both serverId and clientId not specified, find characteristic in the webOS device.
writeTypeOptionalString

Indicates the writeType of the characteristic.

Possible values are:

  • default
  • noresponse
  • signed

Call Returns

Name

Required

Type

Description

adapterAddressRequiredString

Indicates the address of the adapter.

addressOptionalString

Indicates the address of the remote device.

returnValueOptionalBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Error Codes Reference

Error Code

Error Text

Error Description

106,127,136,143,144,162,163,164,165,173,172,175See API Error Codes Reference

See API Error Codes Reference.

Example

# 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
}

gatt/writeDescriptorValue

Description

Writes the value of a specific descriptor of a service characteristic either in the local adapter or the remote device.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used
serviceOptionalString

Indicates the unique identifier of the service the descriptor belongs to.

Note: Either this and characteristic and descriptor, or instanceId is required.

characteristicOptionalString

Indicates the unique identifier of the characteristic the descriptor belongs to.

Note: Either this and service and descriptor, or instanceId is required.

descriptorOptionalString

Indicates the unique identifier of the descriptor.

Note: Either this and service and characteristic, or instanceId is required.

instanceIdOptionalString

Indicates the unique identifier of the descriptors to read, which has the following format: "nnn".

Note: Either this, or service and characteristic are required.

valueRequiredObject: bluetooth2GattValueInfo

Indicates the value of the descriptor.

Note:

  • A value can only have one type. Depending on this type, one of the fields "string", "number" or "bytes" is passed. If multiple fields are passed, the method will fail.
serverIdOptionalString

Indicates the identifier of server to get the descriptor from.

Note:

  • To write the value of descriptor, set serverId to specific server identifier.
  • Or to write in remote device, set clientId to specific remote device identifier.
  • if both serverId and clientId not specified, find descriptor in the webOS device.
clientIdOptionalString

Indicates the identifier of the remote device (client) to get the descriptor from.

Note:

  • To write the value of descriptor, set serverId to specific server identifier.
  • Or to write in remote device, set clientId to specific remote device identifier.
  • if both serverId and clientId not specified, find descriptor in the webOS device.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
adapterAddressRequiredString

Indicates the address of the adapter.

addressOptionalString

Indicates the address of the remote device.

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Example

# 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
}

# 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
}

hfp/connect

Description

Opens a HFP connection to a remote device. 

Parameters

Name

Required

Type

Description

addressRequiredString

Indicates the address (bdaddr) of the remote device.

subscribeOptionalBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribe to get notifications
  • false: Not subscribed

Default: false

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
subscribedRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribe to get notifications
  • false: Not subscribed
adapterAddressRequiredString

Indicates the address of the adapter.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

errorCodeOptionalNumber

The error code for the failed operation.

Subscription Returns

Name

Required

Type

Description

returnValueRequiredString

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
subscribedRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribe to get notifications
  • false: Not subscribed
disconnectByRemoteRequiredBoolean
  • If the remote device initiated the disconnect, disconnectByRemote will contain true.
  • If the local user initiated the disconnect, disconnectByRemote will contain false.
adapterAddressRequiredString

Indicates the address of the adapter.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

errorCodeOptionalNumber

The error code for the failed operation.

Error Codes Reference

Error Code

Error Text

Error Description

102, 103, 105, 106, 127, 143, 144See API Error Codes Reference

See API Error Codes Reference.

128Device is already connecting

The remote Bluetooth device is already connecting to HFP profile, so another connection cannot be opened.

129Device is not paired

The remote Bluetooth device is not paired, so HFP connection cannot be opened.

130Failed to connect with remote device

The remote Bluetooth device cannot be connected to the HFP profile.

131Already connected

The remote Bluetooth device is already connected to the adapter's FTP profile, so another connection cannot be opened.

Example

# 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"
}

hfp/disconnect

Description

Drops the connection to the given remote device on the HFP profile.

Parameters

Name

Required

Type

Description

addressRequiredString

Indicates the address (bdaddr) of the remote device.

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.

Call Returns

Name

Required

Type

Description

returnValuesRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
adapterAddressRequiredString

Indicates the address of the adapter.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

errorCodeOptionalNumber

The error code for the failed operation.

Error Codes Reference

Error Code

Error Text

Error Description

102, 105, 106, 127, 143, 144See API Error Codes Reference

See API Error Codes Reference.

132Failed to disconnect from remote device

The HFP connection with the remote Bluetooth device could not be closed.

Example

# 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"
}

hfp/getStatus

Description

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. 

Parameters

Name

Required

Type

Description

addressRequiredString

Indicates the address (bdaddr) of the remote device.

subscribeOptionalBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribe to get notifications
  • false: Not subscribed
adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
subscribedRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribe to get notifications
  • false: Not subscribed
connectingRequiredBoolean

Indicates if the connection request is currently being processed.

Possible values are:

  • true: The connection request is currently being processed
  • false: Otherwise. Example: The Bluetooth stack is no longer processing the connection request.
connectedRequiredBoolean

Indicates if the connection is open.

Possible values are:

  • true: The connection is open.
  • false: Otherwise.
scoRequiredBoolean

Indicates the status of the SCO connection.

Possible values are:

  • true: There is a SCO connection between the local and the remote device
  • false: Otherwise
adapterAddressRequiredString

Indicates the address of the adapter.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

errorCodeOptionalNumber

The error code for the failed operation.

Subscription Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
subscribedRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribe to get notifications
  • false: Not subscribed
connectingRequiredBoolean

Indicates if the connection request is currently being processed.

Possible values are:

  • true: The connection request is currently being processed
  • false: Otherwise. Example: The Bluetooth stack is no longer processing the connection request.
connectedRequiredBoolean

Indicates if the connection is open.

Possible values are:

  • true: The connection is open.
  • false: Otherwise.
scoRequiredBoolean

Indicates the status of the SCO connection.

Possible values are:

  • true: There is a SCO connection between the local and the remote device
  • false: Otherwise
adapterAddressRequiredString

Indicates the address of the adapter.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

errorCodeOptionalNumber

The error code for the failed operation.

Error Codes Reference

Error Code

Error Text

Error Description

102, 105, 106, 127, 143, 144See API Error Codes Reference

See API Error Codes Reference.

133Failed to retrieve state for remote device

The HFP connection status of the remote Bluetooth device cannot be retrieved.

Example

# 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"
}

le/internal/startScan

Description

Starts scanning only dot ble devices.

Parameters

Name

Required

Type

Description

addressOptionalString

MAC address

subscribeRequiredBoolean

Subscribe for notifications on status of remote devices. Possible values are:

  • true - Get notifications
  • false - Notifications are not required

Default value: false

nameOptionalString

Device name

serviceUuidOptionalObject: bluetooth2LeServiceUuidObject

Object containing information about a service uuid to be advertised

serviceDataOptionalObject: bluetooth2LeServiceDataObject

Object containing information about a service data to be advertised

manufacturerDataOptionalObject: bluetooth2LeManufacturerData

Object containing information about a manufacturer data

advertisingTypeOptionalNumber

Advertising type

Call Returns

Name

Required

Type

Description

subscribeRequiredBoolean

Indicates if subscribed to get notified.

  • true - Subscribed for changes
  • false - Not subscribed
returnValueRequiredBoolean

returnValue will always contain true unless the request for subscription fails.

adapterAddressRequiredString

The address of the default adapter will be always returned.

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Subscription Returns

Name

Required

Type

Description

subscribeRequiredBoolean

Indicates if subscribed to get notified.

  • true - Subscribed for changes
  • false - Not subscribed
returnValueRequiredBoolean

returnValue will always contain true unless the request for subscription fails.

adapterAddressRequiredString

The address of the default adapter will be always returned.

deviceRequiredObject array: bluetooth2DeviceStatus

devices will contain status information for all the devices known to the system, not just the ones whose status has been changed.

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

deviceRequiredObject: 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:

  • New device detected in the scan environment.
  • Device listed in scan environment whose property is changed.

Error Codes Reference

Error Code

Error Text

Error Description

101,143,144See 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"},
    "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
        }
    ]
}

le/startAdvertising

Description

Start the broadcasting of the Bluetooth Low Energy advertisement.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

The address of the adapter executing this method.

If not specified, the default adapter will be used.

subscribeRequiredBoolean

Since subscription ends only when the client chooses to close it, subscribed will always contain true.

Multiple advertisement must set to true this value.

settingsOptionalObject: bluetooth2AdvertiseSettings

Defines the format for advertiser setting parameters.

advertiseDataOptionalObject: bluetooth2AdvertiseData

Defines the format for scan request data parameters.

scanResponseOptionalObject: bluetooth2AdvertiseData

Defines the format for scan response data parameters.

Call Returns

Name

Required

Type

Description

adapterAddressRequiredString

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.

returnValueRequiredBoolean

Indicates the status of operation. Possible values are:

  • true - Indicates that the operation was successful.
  • false - Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

advertiserIdRequiredNumber

The handle ID of a specific advertiser. Multiple advertisement can update with this value.

Error Codes Reference

Error Code

Error Text

Error Description

1, 101See API Codes Reference

See API Error Codes Reference.

Example

# 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

}

le/startScan

Description

Starts scanning only ble devices.

Parameters

Name

Required

Type

Description

addressOptionalString

Indicates the MAC address.

subscribeRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications
  • false: Not subscribed

​Default: false

nameOptionalString

Indicates the name of the device.

serviceUuidOptionalObject: bluetooth2LeServiceUuidObject

Object containing information about the serviceUuid to be advertised.

serviceDataOptionalObject: bluetooth2LeServiceDataObject

Object containing information about a serviceData to be advertised.

manufacturerDataOptionalObject: bluetooth2LeManufacturerData

Object containing information about a manufacturerData.

adapterAddressOptionalString

Indicates the address of the adapter.

Note: If not specified, the address of the default adapter will be used.

Call Returns

Name

Required

Type

Description

subscribedRequiredBoolean

Indicates if subscribed to get notifications.

  • true: Subscribed for notifications
  • false: Not subscribed
returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.

Note: returnValue will always contain true unless the request for subscription fails.

adapterAddressRequiredString

Indicates the address of the adapter.

Note: If not specified, the address of the default adapter will be returned.

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Subscription Returns

Name

Required

Type

Description

subscribedRequiredBoolean

Indicates if subscribed to get notifications.

  • true: Subscribed for notifications
  • false: Not subscribed
returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.

Note: returnValue will always contain true unless the request for subscription fails.

adapterAddressRequiredString

Indicates the address of the adapter.

Note: If not specified, the address of the default adapter will be returned.

devicesRequiredObject 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.

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

deviceRequiredObject: 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:

  • New device detected in the scan environment.
  • The device listed in scan environment whose property is changed.

Error Codes Reference

Error Code

Error Text

Error Description

101,143,144See API Error Codes Reference

See the "API Error Codes Reference" section.

Example

# 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
        }
    ]
}

# 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
      }
   ]
}

opp/acceptTransferRequest

Description

Accept a Bluetooth object push request. This method is available only for a push server.

Parameters

Name

Required

Type

Description

requestIdRequiredString

The unique ID of a request.

adapaterAddressOptionalString

The address of the adapter executing this method.

If not specified, the default adapter will be used.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of operation. Possible values are:

  • true - Indicates that the operation was successful.
  • false - Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
adapterAddressRequiredString

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.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

errorCodeOptionalNumber

The error code for the failed operation.

Error Codes Reference

Error Code

Error Text

Error Description

127, 143, 144See API Error Codes Reference

See API Error Codes Reference.

155Transfers are currently not allowed

OPP file transfers from the remote Bluetooth device are currently not allowed.

156Required 'requestId' parameter is not supplied

The requestId parameter is mandatory to this method, but was not supplied by the caller of the method.

157Failed to retrieve state for remote device

The confirmation of object push request from remote Bluetooth device failed.

159These pushRequest already received the file

The confirmation of object push request from remote Bluetooth device is already done.

158The requestId does not exist

The supplied requestId does not exist, hence the method cannot be completed.

Example

# luna-send -n 1 -f luna://com.webos.service.bluetooth2/opp/acceptTransferRequest '{"requestId":"001"}'
 

Response:

{  
   "returnValue":true,
   "adapterAddress":"00:00:45:0e:48:9b"
}

opp/awaitTransferRequest

Description

Await incoming transfer requests from push clients. This method is available only for a push server.

Parameters

Name

Required

Type

Description

subscribeRequiredBoolean

Subscribe and get notifications. Possible values are:

  • true - Subscribed for changes.
  • false - Not subscribed.

Note: The caller MUST subscribe to this method.

adapterAddressOptionalString

The address of the adapter executing this method.

If not specified, the default adapter will be used.

Subscription Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of operation. Possible values are:

  • true - Indicates that the operation was successful.
  • false - Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
adapterAddressRequiredString

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.

subscribedRequiredBoolean

Indicates if subscribed to get notifications. Possible values are:

  • true - Subscribed for changes.
  • false - Not subscribed.

Since subscription ends only when the client chooses to close it, subscribed will always contain true.

requestOptionalObject: bluetooth2PushRequest

A request information including request ID, client name, client address, file name, and file size.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

errorCodeOptionalNumber

The error code for the failed operation.

Error Codes Reference

Error Code

Error Text

Error Description

101, 103, 104, 143, 144See API Error Codes Reference

See API Error Codes Reference.

161Adapter is turned off

The Bluetooth adapter is turned off.

Example

# 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"
   }
}

opp/cancelTransfer

Description

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.

Parameters

Name

Required

Type

Description

requestIdRequiredString

The unique ID of a request.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of operation. Possible values are:

  • true - Indicates that the operation was successful.
  • false - Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

errorCodeOptionalNumber

The error code for the failed operation.

Error Codes Reference

Error Code

Error Text

Error Description

127, 143, 144See API Error Codes Reference

See API Error Codes Reference.

155Transfers are currently not allowed

OPP file transfers from the remote Bluetooth device are currently not allowed.

156Required 'requestId' parameter is not supplied

The requestId parameter is mandatory to this method, but was not supplied by the caller of the method.

157Failed to retrieve state for remote device

The confirmation of object push request from remote Bluetooth device failed.

158The requestId does not exist

The supplied requestId does not exist, hence the method cannot be completed.

Example

# luna-send -n 1 -f luna://com.webos.service.bluetooth2/opp/cancelTransfer '{ "requestId":"001" }'

 

Response:

{  
   "returnValue":true
}

opp/connect

Description

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.

Parameters

Name

Required

Type

Description

addressRequiredString

The address (bdaddr) of the remote device.

subscribeOptionalBoolean

Subscribe and get notified when connection is closed. Possible values are:

  • true - Subscribed for changes.
  • false - Not subscribed.

Default value: false

Call Returns

Name

Required

Type

Description

subscribedRequiredBoolean

Indicates if subscribed to get notifications. Possible values are:

  • true - Subscribed for changes.
  • false - Not subscribed.
returnValueRequiredBoolean

Indicates the status of operation. Possible values are:

  • true - Indicates that the operation was successful.
  • false - Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

errorCodeOptionalNumber

The error code for the failed operation.

Subscription Returns

Name

Required

Type

Description

disconnectByRemoteRequiredString

Indicates whether the remote device or local user initiated the disconnect. Possible values are:

  • true - Disconnect initiated by remote device.
  • false - Disconnect initiated by local user. 
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

returnValueRequiredBoolean
  • If the connection was successfully open (or initialized), returnValue will contain true.
  • Otherwise, returnValue will contain false.
subscribedRequiredBoolean
  • If it is subscribed, subscribed will contain true until the final response sent by the service before stopping.
  • If it is not subscribed, subscribed will contain false

Error Codes Reference

Error Code

Error Text

Error Description

102, 103, 105, 106, 127, 143, 144See API Error Codes Reference

See API Error Codes Reference.

128Device is already connecting

The remote Bluetooth device is already connecting to OPP profile, so another connection cannot be open.

130Failed to connect with remote device

The remote Bluetooth device cannot be connected to the OPP profile.

131Already connected

The remote Bluetooth device is already connected to the adapter's OPP profile, so another connection cannot be open.

Example

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

}

opp/disconnect

Description

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.

Parameters

Name

Required

Type

Description

addressRequiredString

The address (bdaddr) of the remote device.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

If the connection is successfully closed (or deinitialized), returnValue will contain true.

Otherwise, returnValue will contain false.

errorTextOptionalString

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.

errorCodeOptionalNumber

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 Codes Reference

Error Code

Error Text

Error Description

102, 105, 106, 127, 143, 144See API Error Codes Reference

See API Error Codes Reference.

132Failed to disconnect from remote device

The OPP connection with the remote Bluetooth device could not be closed.

Example

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

}

opp/getStatus

Description

Return the status of an OPP connection to a remote Bluetooth device. This method is available for both of client and server.

Parameters

Name

Required

Type

Description

addressRequiredString

The address (bdaddr) of the remote device.

subscribeOptionalBoolean
  • To be notified of changes to the connection, set subscribe to true.
  • Otherwise, set subscribe to false.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean
  • If the status is successfully returned, returnValue will contain true.
  • Otherwise, returnValue will contain false.
connectingRequiredBoolean
  • If the connection (or push) request is currently being processed, connecting will contain true.
  • Otherwise, connecting will contain false. For example, the Bluetooth stack is no longer processing the connection request.
connectedRequiredBoolean
  • If the connection is open, connected will contain true.
  • Otherwise, connected will contain false.
errorTextOptionalString

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.

errorCodeOptionalNumber

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.

Subscription Returns

Name

Required

Type

Description

returnValueRequiredBoolean
  • If the status is successfully returned, returnValue will contain true.
  • Otherwise, returnValue will contain false.
subscribedRequiredBoolean
  • If the method is subscribed, subscribed will contain true until the final response is sent by the service before stopping. 
  • If the method is not subscribed, subscribed will contain false.
connectingRequiredBoolean
  • If the connection (or push) request is currently being processed, connecting will contain true.
  • Otherwise, connecting will contain false. For example, the Bluetooth stack is no longer processing the connection request.
connectedRequiredBoolean
  • If the connection is open, connected will contain true.
  • Otherwise, connected will contain false.
errorTextOptionalString

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.

errorCodeOptionalNumber

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 Codes Reference

Error Code

Error Text

Error Description

102, 105, 106, 127, 143, 144See API Error Codes Reference

See API Error Codes Reference.

133Failed to retrieve state for remote device

The OPP connection status of the remote Bluetooth device cannot be retrieved.

Example

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

}

opp/monitorTransfer

Description

Return the status of ongoing file transfer requests. This method is only available for server.

Parameters

Name

Required

Type

Description

subscribeRequiredBoolean

Must set subscribe to true.

adapterAddressOptionalString

The address of the adapter executing this method call.

If not specified, the default adapter will be used.

Subscription Returns

Name

Required

Type

Description

subscribedRequiredBoolean

subscribed will always contain true since subscription ends only when the client chooses to close it.

returnValueRequiredBoolean
  • If the status is successfully returned, returnValue will contain true.
  • Otherwise, returnValue will contain false.
adapterAddressRequiredString

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.

transfersOptionalObject array: bluetooth2PushRequest

Request information including data size transferred so far.

errorTextOptionalString

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.

errorCodeOptionalNumber

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 Codes Reference

Error Code

Error Text

Error Description

101, 103, 143, 144See API Error Codes Reference

See API Error Codes Reference.

161Adapter is turned off

The Bluetooth adapter is turned off.

Example

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"

}

]

}

opp/pushFile

Description

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.

Parameters

Name

Required

Type

Description

addressRequiredString

The address (bdaddr) of the remote device.

sourceFileRequiredString

Absolute path of the source file, rooted at /media/internal.

subscribeOptionalBoolean
  • To monitor the progress of the transfer, set subscribe to true.
  • Otherwise, set subscribe to false.
  • The default value of subscribed is false.
adapterAddressOptionalString

The address of the adapter executing this method.

If not specified, the default adapter will be used.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean
  • If the file transfer succeeds, returnValue will contain true.
  • Otherwise, returnValue will contain false. (The non-subscription response is only sent after the transfer has completed.)
adapterAddressRequiredString

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.

subscribedRequiredBoolean
  • If it is subscribed, subscribed will contain true.
  • If it is not subscribed, subscribed will contain false
errorTextOptionalString

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.

errorCodeOptionalNumber

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

Subscription Returns

Name

Required

Type

Description

returnValueRequiredBoolean
  • In case subscribed contains truereturnValue will always contain true.
  • In case subscribed contains false (indicating the final response from the service),
    • If the file transfer succeeds, returnValue will contain true.
    • Otherwise, returnValue will contain false.
adapterAddressRequiredString

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.

subscribedRequiredBoolean
  • If it is subscribed, subscribed will contain true until the final response is sent by the service before stopping.
  • If it is not subscribed, subscribed will contain false
transferredOptionalNumber

Number of bytes transferred so far.

sizeOptionalNumber

Size in bytes of the source file.

errorTextOptionalString

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.

errorCodeOptionalNumber

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 Codes Reference

Error Code

Error Text

Error Description

105, 106, 137, 143, 144See API Error Codes Reference

See API Error Codes Reference.

142Supplied 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.

154Device is not connected

The remote Bluetooth device is not connected to our Bluetooth adapter via the OPP profile.

Example

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"

}

opp/rejectTransferRequest

Description

Reject a Bluetooth object push request. This method is available only for a push server.

Parameters

Name

Required

Type

Description

requestIdRequiredString

The unique ID of a request.

adapterAddressOptionalString

The address of the adapter executing this method.

If not specified, the default adapter will be used.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean
  • If the method succeeds, returnValue will contain true.
  • If the method fails, returnValue will contain false.
adapterAddressRequiredString

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.

errorTextOptionalString

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.

errorCodeOptionalNumber

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 Codes Reference

Error Code

Error Text

Error Description

127, 143, 144See API Error Codes Reference

See API Error Codes Reference.

155Transfers are currently not allowed

OPP file transfers from the remote Bluetooth device are currently not allowed.

156Required 'requestId' parameter is not supplied

The requestId parameter is mandatory to this method, but was not supplied by the caller of the method.

157Failed to retrieve state for remote device

The confirmation of object push request from remote Bluetooth device failed.

158The requestId does not exist

The supplied requestId does not exist, hence the accept operation cannot be completed.

159These pushRequest already received the file

The confirmation of object push request from remote Bluetooth device is already done.

Example

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"

}

device/getDiscoveredDevice

Description

Gets the newly discovered Bluetooth device information known to the system.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used
subscribeRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribe for notifications.
  • false: Not subscribed

Call Returns

Name

Required

Type

Description

subscribedRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribe for notifications.
  • false: Not subscribed
returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the failed operation.   

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

adapterAddressRequiredString

Indicates the address of the adapter.

deviceRequiredObject: bluetooth2DeviceStatus

Contains the status information of a newly discovered device known to the system.

Subscription Returns

Name

Required

Type

Description

subscribedRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribe for notifications.
  • false: Not subscribed
returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the failed operation

errorTextOptionalString

Indicates the reason for the failure of the operation

adapterAddressRequiredString

Indicates the address of the adapter.

deviceRequiredObject: bluetooth2DeviceStatus

Contains the status information of a newly discovered device known to the system.

Error Codes Reference

Error Code

Error Text

Error Description

101, 143, 144See API Error Codes Reference

See API Error Codes Reference

Example

# 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
}

device/getPairedDevices

Description

Gets a list of paired Bluetooth devices info, known to the system.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used
subscribeRequiredString

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribe for notifications.
  • false: Not subscribed

Call Returns

Name

Required

Type

Description

subscribedRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribe for notifications.
  • false: Not subscribed
returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the failed operation

errorTextOptionalString

Indicates the reason for the failure of the operation

adapterAddressRequiredString

Indicates the address of the adapter.

devicesRequiredObject array: bluetooth2DeviceStatus

Contains the status information of paired devices known to the system.

Subscription Returns

Name

Required

Type

Description

subscribedRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribe for notifications.
  • false: Not subscribed
returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the failed operation

errorTextOptionalString

Indicates the reason for the failure of the operation

adapterAddressRequiredString

Indicates the address of the adapter.

devicesRequiredObject array: bluetooth2DeviceStatus

Contains the status information of paired devices known to the system.

Error Codes Reference

Error Code

Error Text

Error Description

101, 143, 144See API Error Codes Reference

See API Error Codes Reference

Example

# 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
      }
   ]
}

pbap/connect

Description

Connects to the PBAP profile on the specified remote device.

Note: This method is available only for PCE.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
addressRequiredString

Indicates the address of the remote device.

subscribeOptionalBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications
  • false: Not subscribed.

​Default: false

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
subscribedRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.
adapterAddressRequiredString

Indicates the address of the adapter.

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

addressRequiredString

Indicates the address of the remote device.

Subscription Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
subscribedRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications (will be true until the final response is sent by the service before stopping.)
  • false: Not subscribed
disconnectByRemoteRequiredString

Indicates whether the remote device or the local user initiated the disconnect.

Possible values are:

  • true: Remote device initiated the disconnect.
  • false: Local user initiated the disconnect.
adapterAddressRequiredString

Indicates the address of the adapter.

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

addressRequiredString

Indicates the address of the remote device.

Error Codes Reference

Error Code

Error Text

Error Description

102, 103, 105, 106, 127, 143, 144See API Error Codes Reference

See API Error Codes Reference.

128Device is already connecting

Indicates that the remote Bluetooth device is already connected to the PBAP profile, hence another connection cannot be opened.

129Device is not paired

Indicates that the remote Bluetooth device is not paired, hence PBAP profile connection cannot be opened.

130Failed to connect with remote device

Indicates that the remote Bluetooth device cannot be connected to PBAP profile.

131Already connected

Indicates that the remote Bluetooth device is already connected to the PBAP profile, hence another connection cannot be opened.

Example

# 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
}

pbap/disconnect

Description

Disconnects from the PBAP profile on the specified remote device.

Note: This method is available only for PCE.

Parameters

Name

Required

Type

Description

addressRequiredString

Indicates the address (bdaddr) of the remote device.

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
adapterAddressRequiredString

Indicates the address of the adapter.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

errorCodeOptionalNumber

The error code for the failed operation.

addressRequiredString

Indicates the address (bdaddr) of the remote device.

Error Codes Reference

Error Code

Error Text

Error Description

102, 105, 106, 127, 143, 144See API Error Codes Reference

See API Error Codes Reference.

132Failed to disconnect from remote device

Indicates that the PBAP connection with the remote Bluetooth device could not be closed.

Example

# 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
}

pbap/getPhoneBookProperties

Description

Gets the supported PBAP profile properties from PSE device.

Note: This method is available only for PCE.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
addressRequiredString

Indicates the address of the remote device.

subscribeOptionalBoolean

Indicates if subscribed to get notifications.

Possible values  are:

  • true: Subscribed for notifications
  • false: Not subscribed

Default: false

Call Returns

Name

Required

Type

Description

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

addressRequiredString

Indicates the address of the remote device.

adapterAddressRequiredString

Indicates the address of the adapter.

propertiesRequiredObject: 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.

subscribedRequiredBoolean

Indicates if subscribed to get notifications.

Possible values  are:

  • true: Subscribed for notifications
  • false: Not subscribed

Default: false

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.

Subscription Returns

Name

Required

Type

Description

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

propertiesOptionalObject: bluetooth2PbapProperties

Returns supported properties from the PSE device.

adapterAddressRequiredString

Indicates the address of the adapter.

addressRequiredString

Indicates the address of the remote device.

subscribedRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for changes (will be true until the final response is sent by the service before stopping).
  • false: Not subscribed.
returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.

Error Codes Reference

Error Code

Error Text

Error Description

1,17,101,102,105,106,127,143,144See API Error Codes Reference

See API Error Codes Reference.

136Device is not connected to profile

The device is not connected to PBAP profile.

Example

# 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
}

pbap/getSize

Description

Gets the total number of vcf entries from the selected phonebook path.

Note: This method is available only for PCE.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
addressRequiredString

Indicates the address of the remote device.

Call Returns

Name

Required

Type

Description

errorCodeOptionalNumber

Indicates the error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

sizeRequiredNumber

Indicates the total number of vcf entries in the selected phonebook path.

adapterAddressRequiredString

Indicates the address of the adapter.

addressRequiredString

Indicates the address of the remote device.

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.

Error Codes Reference

Error Code

Error Text

Error Description

1, 17, 101, 102, 105, 127, 143, 144See API Error Codes Reference

See API Error Codes Reference.

23No repository is selected

No repository is selected, call PBAP/setPhoneBook method before the folder section.

136Device is not connected to profile

Device is not connected to PBAP profile.

Example

# 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
}

pbap/getStatus

Description

Returns the status of a PBAP connection to a remote Bluetooth device.

Note: The method is available for both client and server.

Parameters

Name

Required

Type

Description

addressRequiredString

Indicates the address (bdaddr) of the remote device.

subscribeOptionalBoolean

Indicates if subscribed to get the notifications.

Possible values are:

  • true: Subscribed for notifications
  • false: Not subscribed

Default: false.

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
connectingRequiredBoolean

Indicates the status of connection.

Possible values are:

  • true: The connection request is currently being processed.
  • false: Otherwise. Example: The Bluetooth stack is no longer processing the connection request.
connectedRequiredBoolean

Indicates if the connection is open.

Possible values are:

  • true: The connection is open
  • false: Otherwise
adapterAddressRequiredString

Indicates the address of the adapter.

subscribedRequiredBoolean

Indicates if subscribed to get the notifications.

Possible values are:

  • true: Subscribed for notifications
  • false: Not subscribed
errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

errorCodeOptionalNumber

Indicates the error code for the failed operation.

addressRequiredString

Indicates the address (bdaddr) of the remote device.

Subscription Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
subscribedRequiredBoolean

Indicates if subscribed to get the notifications.

Possible values are:

  • true: Subscribed for notifications
  • false: Not subscribed
connectingRequiredBoolean

Indicates the status of connection.

Possible values are:

  • true: The connection request is currently being processed.
  • false: Otherwise. Example: The Bluetooth stack is no longer processing the connection request.
connectedRequiredBoolean

Indicates if the connection is open.

Possible values are:

  • true: The connection is open
  • false: Otherwise
adapterAddressRequiredString

Indicates the address of the adapter.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

errorCodeOptionalNumber

Indicates the error code for the failed operation.

addressRequiredString

Indicates the address (bdaddr) of the remote device.

Error Codes Reference

Error Code

Error Text

Error Description

102, 105, 106, 127, 143, 144See API Error Codes Reference

See API Error Codes Reference.

185Failed to retrieve state for remote device

The PBAP connection status of the remote Bluetooth device cannot be retrieved.

Example

# 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
}

pbap/getvCardFilters

Description

Displays all the available vcard filters supported by Bluetooth stack.

Note: The method is available only for PCE.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
addressRequiredString

Indicates the address (bdaddr) of the remote device.

Call Returns

Name

Required

Type

Description

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

adapterAddressRequiredString

Indicates the address of the adapter.

addressRequiredString

Indicates the address of the remote device.

filtersRequiredString array

Returns a list of supported vCard filters.

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.

Error Codes Reference

Error Code

Error Text

Error Description

1, 17, 101, 102, 105, 106, 127, 143, 144See API Error Codes Reference

See API Error Codes Reference.

136Device is not connected to profile

The device is not connected to the PBAP profile.

Example

# 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"
   ]
}

pbap/pullPhoneBook

Description

Retrieves all (given maxcount) the phonebook entries from a given startoffset and stores it in a local file.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
addressRequiredString

Indicates the address (bdaddr) of the remote device.

subscribeRequiredBoolean

Indicates if the user is subscribed to get the notifications.

Possible values are:

  • true: Subscribed for notifications
  • false: Not subscribed

Default: false

destinationFileRequiredString

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>

startOffsetOptionalNumber

Indicates the Offset of the first item.

Default: 0

maxListCountOptionalNumber

Indicates the maximum number of items.

Default: unlimited (65535)

vCardVersionOptionalString

Indicates the vCard format versions.

Possible values are:

  • 2.1
  • 3.0

Default: 2.1

filterFieldsOptionalString array

Provide vCard with fields as specified in the filter.

  • Mandatory properties for vCard 2.1 are VERSION, N, and TEL.
  • Mandatory properties for vCard 3.0 are VERSION, N, FN, and TEL.

Note:

  • We can get the list of supported filters using pbap/getvCardFilters API.
  • If not specified, all supported filters are used by default.

Call Returns

Name

Required

Type

Description

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

addressRequiredString

Indicates the address of the remote device.

adapterAddressRequiredString

Indicates the address of the adapter.

destinationFileRequiredString

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>

subscribedRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed. 
returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.

Subscription Returns

Name

Required

Type

Description

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

adapterAddressRequiredString

Indicates the address of the adapter.

addressRequiredString

Indicates the address of the remote device for the requested operation.

destinationFileRequiredString

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>

statusRequiredString

Indicates the status of the phonebook download.

Possible values are :

  • idle: Phonebook download not yet started , maybe queued in stack
  • active: Phonebook download started.
  • completed: Phonebook download completed.
  • error: Phonebook download failed.
subscribedRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications
  • false: Not subscribed. 
returnValueRequiredNumber

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.

Error Codes Reference

Error Code

Error Text

Error Description

1, 6, 17, 101, 102, 105, 127, 143, 144See API Error Codes Reference

See API Error Codes Reference.

23No repository is selected

No repository is selected, call PBAP/setPhoneBook method to select the repository.

136Device is not connected to profile

The device is not connected to PBAP profile.

139Supplied 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

# 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
}

pbap/pullvCard

Description

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.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
addressRequiredString

Indicates the address of the remote device.

destinationFileOptionalString

Indicates destination file name.

Note: If not provided, it will be set as vCardHandle.

vCardHandleRequiredString

Indicates vCard handle for vcf file.

vCardVersionOptionalString

Indicates vCard format version.

Possible values are :

  • 2.1
  • 3.0

 Default: 2.1

filterFieldsOptionalString array

Provides vCard with fields as specified in the filter.

  • Mandatory properties for vCard 2.1 are VERSION, N, and TEL.
  • Mandatory properties for vCard 3.0 are VERSION, N, FN, and TEL.

Note:

  • We can get the list of supported filters using pbap/getvCardFilters API.
  • If not specified, all supported filters are used by default.

Call Returns

Name

Required

Type

Description

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

adapterAddressRequiredString

Indicates the address of the adapter.

addressRequiredString

Indicates the address of the remote device.

destinationFileRequiredString

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>.

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.

Error Codes Reference

Error Code

Error Text

Error Description

1, 6, 17, 101, 102, 105, 127, 143, 144See API Error Codes Reference

See API Error Codes Reference.

136Device is not connected to profile

The device is not connected to PBAP profile.

139Supplied 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.

293Required 'vCardHandle' parameter is not supplied

Required vCardHandle parameter is not supplied

Example

# 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
}

pbap/searchPhoneBook

Description

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.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
addressRequiredString

Indicates the address of the remote device.

orderOptionalString

Displays the search results based on the given order.

Possible values are:

  • Indexed (default)
  • Alphanumeric
  • Phonetic
filterRequiredObject: bluetooth2PbapSearchFilter

Filter with key & value pair to search the phonebook.

Call Returns

Name

Required

Type

Description

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

adapterAddressRequiredString

Indicates the address of the adapter.

addressRequiredString

Indicates the address of the remote device.

vcfHandlesRequiredObject: bluetooth2PbapVcfHandles

Returns vcf files entries with name and vcf handle from selected phone-book path.

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.

Error Codes Reference

Error Code

Error Text

Error Description

1, 17, 101, 102, 105, 127, 143, 144See API Error Codes Reference

See API Error Codes Reference.

23No repository is selected

No repository is selected, call PBAP/setPhoneBook method to select repository 

136Device is not connected to profile

The device is not connected to the PBAP profile.

294Required 'filter' parameter is not supplied

The required 'filter' parameter is not supplied.

Example

# 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
}

pbap/setPhoneBook

Description

Sets the phonebook object for other operations.

Note: This method is available only for PCE.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
addressRequiredString

Indicates the address of the remote device required for the connection.

repositoryRequiredString

Indicates the type of repository that stores the phonebook.

Possible inputs :

  • internal 
  • sim1

Default: internal.

objectRequiredString

Indicates the path of the phonebook object.

Possible inputs :

  • pb: phonebook for the saved contacts.
  • ich: incoming call history.
  • och: outgoing call history.
  • mch: missing call history.
  • cch: a combination of ich, och, mch.

Call Returns

Name

Required

Type

Description

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

addressRequiredString

Indicates the address of the remote device.

adapterAddressRequiredString

Indicates the address of the adapter.

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.

Error Codes Reference

Error Code

Error Text

Error Description

1,6,17, 101, 102, 105, 127, 143, 144See API Error Codes Reference

See API Error Codes Reference.

136Device is not connected to profile

The device is not connected to PBAP profile.

290Required 'repository' parameter is not supplied

Required 'repository' parameter is not supplied.

291Required 'object' parameter is not supplied

Required 'object' parameter is not supplied.

Example

# 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
}

pbap/vCardListing

Description

Displays the total number of vcf file entries from the selected phonebook path.

Note: This method is available only for PCE.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
addressRequiredString

Indicates the address of the remote device for the requested operation.

Call Returns

Name

Required

Type

Description

errorCodeOptionalNumber

Returns the error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

vcfHandlesRequiredObject array: bluetooth2PbapVcfHandles

Returns vcf files entries with name and vcf handle from selected phonebook path.

adapterAddressRequiredString

Indicates the address of the adapter.

addressRequiredString

Indicates the address of the remote device.

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed.

Error Codes Reference

Error Code

Error Text

Error Description

1, 17, 101, 102, 105, 127, 143, 144See API Error Codes Reference

See API Error Codes Reference.

23No repository is selected

No repository is selected, call PBAP/setPhoneBook method before the folder section.

136Device is not connected to profile

The device is not connected to the PBAP profile.

Example

# 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
}

spp/connect

Description

Open a SPP connection to a remote Bluetooth device.

Parameters

Name

Required

Type

Description

addressRequiredString

The address (bdaddr) of the remote device.

uuidRequiredString

The UUID used when the server application opens its SPP channel.

subscribeOptionalBoolean
  • To be notified when the connection is closed, set subscribe to true.
  • Otherwise, set subscribe to false.
  • The default value of subscribe is false.
adapterAddressOptionalString

The address of the adapter executing this method call.

If not specified, the default adapter will be used.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean
  • If the method succeeds, returnValue will contain true.
  • If the method fails, returnValue will contain false.
adapterAddressRequiredString

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.

subscribedRequiredBoolean
  • If it is subscribed, subscribed will contain true.
  • If it is not subscribed, subscribed will contain false.
addressRequiredString

The address (bdaddr) of the remote device.

channelIdOptionalString

Unique ID of a SPP channel, which has the following format: "nnn", 3 digit number increasing sequentially.

errorTextOptionalString

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.

errorCodeOptionalNumber

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.

Subscription Returns

Name

Required

Type

Description

returnValueRequiredBoolean
  • If the method succeeds, returnValue will contain true.
  • If the method fails, returnValue will contain false.
subscribedRequiredBoolean
  • If it is subscribed, subscribed will contain true until the final response is sent by the service before stopping.
  • If it is not subscribed, subscribed will contain false.
adapterAddressRequiredString

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.

disconnectByRemoteRequiredBoolean
  • If the remote device initiated the disconnect, disconnectByRemote will contain true.
  • If the local user initiated the disconnect, disconnectByRemote will contain false.
addressOptionalString

The address (bdaddr) of the remote device.

channelIdOptionalString

The unique ID of a SPP channel, which has the following format: "nnn", 3 digit number increasing sequentially.

errorTextOptionalString

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.

errorCodeOptionalNumber

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 Codes Reference

Error Code

Error Text

Error Description

102, 103, 105, 106, 127, 143, 144See API Error Codes Reference

See API Error Codes Reference.

128Device is already connecting

The remote Bluetooth device is already connecting to SPP profile, so another connection cannot be opened.

129Device is not paired

The remote Bluetooth device is not paired, so SPP connection cannot be opened.

130Failed to connect with remote device

The remote Bluetooth device cannot be connected to SPP profile.

131Already connected

The remote Bluetooth device is already connected to the adapter's SPP profile, so another connection cannot be opened.

Example

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
}

spp/createChannel

Description

Register a service record in the device service record database with the specified UUID and name. The channel can be removed through LSCallCancel().

Parameters

Name

Required

Type

Description

nameRequiredString

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).

uuidRequiredString

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.

subscribeRequiredBoolean

Must set subscribe to true to be notified of changes to the channel (e.g., connection of client, removal of the channel).

adapterAddressOptionalString

The address of the adapter executing this method. 

If not specified, the default adapter will be used.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean
  • If the method succeeds, returnValue will contain true.
  • If the method fails, returnValue will contain false.
adapterAddressRequiredString

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.

subscribedRequiredBoolean

subscribe will always contain true.

errorTextOptionalString

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.

errorCodeOptionalNumber

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.

Subscription Returns

Name

Required

Type

Description

returnValueRequiredBoolean
  • If the channel is successfully created, returnValue will contain true.
  • Otherwise, returnValue will contain false.
subscribedRequiredBoolean
  • If the subscription request succeeds, subscribed will contain true while the channel is alive.
  • If the channel is removed, subscribed will contain false.
adapterAddressRequiredString

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.

channelIdRequiredString

Unique ID of a SPP channel, which has the following format: "nnn", 3 digit number increasing sequentially.

connectedRequiredBoolean
  • If the connection is open, connected will contain true.
  • Otherwise, connected will contain false.
addressOptionalString

The address (bdaddr) of the device.

errorTextOptionalString

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.

errorCodeOptionalNumber

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 Codes Reference

Error Code

Error Text

Error Description

102, 105, 106, 127, 143, 144See API Error Codes Reference

See API Error Codes Reference.

203Required 'uuid' parameter is not supplied

This method is required the "UUID" parameter.

205Required 'name' parameter is not supplied

This method is required the "name" parameter.

Example

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
}

spp/disconnect

Description

Drop the connection to the given remote device on SPP profile.

Parameters

Name

Required

Type

Description

channelIdRequiredString

Unique ID of a SPP channel, which has the following format: "nnn", 3 digit number increasing sequentially.

adapterAddressOptionalString

The address of the adapter executing this method. 

If not specified, the default adapter will be used.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean
  • If the method succeeds, returnValue will contain true.
  • If the method fails, returnValue will contain false.
adapterAddressRequiredString

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.

errorTextOptionalString

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.

errorCodeOptionalNumber

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 Codes Reference

Error Code

Error Text

Error Description

102, 105, 106, 127, 143, 144See API Error Codes Reference

See API Error Codes Reference.

132Failed to disconnect from remote device

The SPP connection with the remote Bluetooth device could not be closed

Example

# 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."

}

spp/getStatus

Description

Return the status of a SPP connection to a remote device.

Parameters

Name

Required

Type

Description

addressRequiredString

The address (bdaddr) of the remote device.

subscribeOptionalBoolean
  • To be notified of changes to the connection, set subscribe to true.
  • Otherwise, set subscribe to false.
  • The default value of subscribe is false
adapterAddressOptionalString

The address of the adapter executing this method call. When the field is not set, the default adapter is used for it.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean
  • If the method succeeds, returnValue will contain true.
  • If the method fails, returnValue will contain false.
connectingRequiredBoolean
  • If the connection request is currently being processed, connecting will contain true.
  • Otherwise, connecting will contain false. For example, the Bluetooth stack is no longer processing the connection request.
connectedRequiredBoolean
  • If the connection is open, connected will contain true.
  • Otherwise, connected will contain false.
adapterAddressRequiredString

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.

connectedChannelsRequiredString array

Array of channel IDs which are connected currently.

subscribedRequiredBoolean
  • If it is subscribed, subscribed will contain true.
  • If it is not subscribed, subscribed will contain false
errorTextOptionalString

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.

errorCodeOptionalNumber

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.

Subscription Returns

Name

Required

Type

Description

returnValueRequiredBoolean
  • If the method succeeds, returnValue will contain true.
  • If the method fails, returnValue will contain false.
subscribedOptionalBoolean
  • If it is subscribed, subscribed will contain true until the final response is sent by the service before stopping.
  • If it is not subscribed, subscribed will contain false
connectingRequiredBoolean
  • If the connection request is currently being processed, connecting will contain true.
  • Otherwise, connecting will contain false. For example, the Bluetooth stack is no longer processing the connection request.
connectedRequiredBoolean
  • If the connection is open, connected will contain true.
  • Otherwise, connected will contain false.
adapterAddressRequiredString

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.

connectedChannelsRequiredString array

Array of channel IDs which are connected currently.

errorTextOptionalString

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.

errorCodeOptionalNumber

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 Codes Reference

Error Code

Error Text

Error Description

102, 105, 106, 127, 143, 144See API Error Codes Reference

See API Error Codes Reference.

133Failed to retrieve state for remote device

The SPP connection status of the remote Bluetooth device cannot be retrieved.

Example

# 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

}

spp/readData

Description

Receive data from the connected remote device. 

Parameters

Name

Required

Type

Description

channelIdOptionalString

Unique ID of a SPP channel.

If channelId is not specified, all connected channel IDs from which the caller received data will be returned. 

subscribeOptionalBoolean
  • To read the data continuously, set subscribe to true.
  • Otherwise, set subscribe to false.
  • The default value of subscribe is true.
timeoutOptionalNumber

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.

adapterAddressOptionalString

The address of the adapter executing this method.

If not specified, the default adapter will be used.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean
  • If the method succeeds, returnValue will contain true.
  • If the method fails, returnValue will contain false.
adapterAddressRequiredString

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.

subscribedRequiredBoolean
  • If it is subscribed, subscribed will contain true.
  • If it is not subscribed, subscribed will contain false.
channelIdRequiredString

Unique ID of a SPP channel.

dataOptionalString

BASE64-encoded string data received from the remote device. Before using the data, BASE64 decoding is needed.

errorTextOptionalString

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.

errorCodeOptionalNumber

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.

Subscription Returns

Name

Required

Type

Description

returnValueRequiredBoolean
  • If the method succeeds, returnValue will contain true.
  • If the method fails, returnValue will contain false.
subscribedRequiredBoolean
  • If it is subscribed, subscribed will contain true until the final response is sent by the service before stopping.
  • If it is not subscribed, subscribed will contain false.
adapterAddressRequiredString

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.

channelIdRequiredString

Unique ID of a SPP channel.

dataOptionalString

BASE64-encoded string data received from the remote device. Before using the data, BASE64 decoding is needed.

errorTextOptionalString

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.

errorCodeOptionalNumber

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 Codes Reference

Error Code

Error Text

Error Description

102, 105, 106, 127, 143, 144See API Error Codes Reference

See API Error Codes Reference.

209The supplied 'channelId' is not available

The channelId is not opened or does not exist.

211The 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.

212Permission denied

The supplied channel is not connected or there is no authority.

Example

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"
}

spp/writeData

Description

Transfer data to the connected remote device. 

Parameters

Name

Required

Type

Description

channelIdRequiredString

Unique ID of a SPP channel.

dataRequiredString

Data to send. This string data should be encoded to BASE64.

adapterAddressOptionalString

The address of the adapter executing this method. 

If not specified, the default adapter will be used.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean
  • If the method succeeds, returnValue will contain true.
  • If the method fails, returnValue will contain false.
adapterAddressRequiredString

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.

errorTextOptionalString

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.

errorCodeOptionalNumber

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 Codes Reference

Error Code

Error Text

Error Description

102, 105, 106, 127, 143, 144See API Error Codes Reference

See API Error Codes Reference.

204Required 'channelId' parameter is not supplied

This method is required the "channelId" parameter.

206Required 'data' parameter is not supplied

This method is required the "data" parameter.

207Required 'size' parameter is not supplied

This method is required the "size" parameter.

208Failed to write data

Writing Data is failed.

209The supplied 'channelId' is not available

The channelId is not opened or does not exist.

210The supplied 'size' is not available

The supplied size is smaller than zero or greater than max_buffer_size.

212Permission denied

The supplied channel is not connected or there is no authority.

Example

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
}

avrcp/getPlayerInfo

Description

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.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
addressRequiredString

Indicates the address of the remote device.

subscribeRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.

Default: false

Call Returns

Name

Required

Type

Description

adapterAddressRequiredString

Indicates the address of the adapter.

addressRequiredString

Indicates the address of the remote device.

subscribedRequiredBoolean

Indicates if subscribed to get notifications.
Possible values are:

  • true: Subscribed for changes.
  • false: Not subscribed.
returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

playerInfoOptionalObject array: bluetooth2AvrcpPlayerInfo

Indicates the player information.

Subscription Returns

Name

Required

Type

Description

adapterAddressRequiredString

Indicates the address of the adapter.

addressRequiredString

Indicates the address of the remote device.

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
subscribedRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

playerInfoOptionalObject array: bluetooth2AvrcpPlayerInfo

Indicates the player information.

Error Codes Reference

Error Code

Error Text

Error Description

1, 17, 101, 105, 127, 136, 143, 144See API Error Codes section for reference

See API Error Codes section for reference

Example

# 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
}

map/connect

Description

Connects to the MAS Instance of the specified remote device.

Note: The method is available only for MCE.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the default adapter is used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
addressRequiredString

Indicates the address of the remote device (MSE).

instanceNameOptionalString

Indicates the specific MAS instance of the MSE required for the connection to be initiated.

Note:

  • If the instanceName is not passed and server supports multiple instances, then the first available MAS instance of MSE is connected.
  • The client can get available instance name by calling map/getMASInstances
subscribeOptionalBoolean

Indicates if subscribed to get the notifications.

Possible values are:

  • true: Subscribe to get notifications.
  • false: Not subscribed.

Call Returns

Name

Required

Type

Description

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

subscribedRequiredBoolean

Indicates if subscribed to get the notifications.

Possible values are:

  • true: Subscribe to get notifications.
  • false: Not subscribed.
addressRequiredString

Indicates the address of the remote device (MSE).

adapterAddressRequiredString

Indicates the address of the adapter.

instanceNameRequiredString

Indicates the specific MAS instance name of the MSE to which it is connected.

sessionIdOptionalString

Indicates the allocated Obex sessionId, which shall be used for further API call.

Note:

  • sessionId will be unique for each connected MAS instance session
  • sessionId will not be returned if the connection has failed
returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.

Subscription Returns

Name

Required

Type

Description

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

subscribedRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.
disconnectByRemoteRequiredBoolean

Indicates if the remote device or the local user has initiated the disconnect.

Possible values are:

  • true: Remote device initiated the disconnect
  • false: Local user initiated the disconnect
addressRequiredString

Indicates the address of the remote device (MSE).

adapterAddressRequiredString

Indicates the address of the adapter.

instanceNameRequiredString

Indicates the specific MAS instance name of the MSE.

sessionIdRequiredString

Indicates the allocated Obex sessionId, which shall be used for further API call.

Note:

  • sessionId will be unique for each connected MAS instance session
  • sessionId will not be returned if the connection has failed
returnValueRequiredBoolean

Indicates the status of operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.

Error Codes Reference

Error Code

Error Text

Error Description

1,101,105,106,127,128,129,143,144,162See API Error Codes Reference

See API Error Codes Reference.

296The supplied instance does not exist

The supplied instance does not exist

305The supplied instance already connected

The supplied instance already connected

Example

# 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"
}

map/disconnect

Description

Disconnects from the MAS Instance on the specified remote device.

Note: The method is available only for MCE.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the default adapter is used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
addressRequiredString

Indicates the address of the remote device.

sessionIdRequiredString

Indicates the unique identifier of the session which was received as a connection response from the map/connect.

Call Returns

Name

Required

Type

Description

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

addressRequiredString

Indicates the address of the remote device.

adapterAddressRequiredString

Indicates the address of the adapter.

instanceNameRequiredString

Indicates the specific MAS instance name of the MSE.

sessionIdRequiredString

Indicates the unique identifier of the session which was received as a connection response from the map/connect.

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.

Error Codes Reference

Error Code

Error Text

Error Description

1,101,105,106,127,129,143,144,162, 297, 298See API Error Codes Reference

See API Error Codes Reference.

132Failed to disconnect from remote device

Failed to disconnect from remote device

Example

# 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
}

map/getStatus

Description

Returns the status of the MAS connection with a remote device.

Note: The method is available only for MCE.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note

  • If not specified, the default adapter is used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
addressRequiredString

Indicates the address of the remote device.

instanceNameOptionalString

Indicates a specific MAS instance name.

Note: If not provided, all MAS instances details will be provided

subscribeOptionalBoolean

Indicates if subscribed to get the notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.

Call Returns

Name

Required

Type

Description

subscribedRequiredBoolean

Indicates if subscribed to get the notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.
returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

adapterAddressRequiredString

Indicates the address of the adapter.

addressRequiredString

Indicates the address (bdaddr) of the remote device

statusRequiredObject array: bluetooth2MasInstancesStatus

Indicates an array of MAS instances with connection details.

Subscription Returns

Name

Required

Type

Description

subscribedRequiredBoolean

Indicates if subscribed to get the notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.
returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

adapterAddressRequiredString

Indicates the address of the adapter.

addressRequiredString

Indicates the address (bdaddr) of the remote device

statusRequiredObject array: bluetooth2MasInstancesStatus

Indicates the array of MAS instances with connection details.

Error Codes Reference

Error Code

Error Text

Error Description

101,105,106,127,129,143,144,162See API Error Codes Reference

See API Error Codes Reference.

Example

# 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
}

map/getMASInstances

Description

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.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the default adapter is used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
addressRequiredString

Indicates the address of the remote Bluetooth device address(MSE).

Call Returns

Name

Required

Type

Description

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

addressRequiredString

Indicates the address of the remote Bluetooth device (MSE).

adapterAddressRequiredString

Indicates the address of the adapter.

masInstancesRequiredObject array: bluetooth2MasInstances

Indicates the list of the supported MAS instances.

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.

Error Codes Reference

Error Code

Error Text

Error Description

101,105,106,127,129,143,144,162See API Error Codes Reference

See API Error Codes Reference.

Example

# 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
}

map/getFolderList

Description

Lists the available folders of the connected MAS instance of the MSE device.

Note: This method is available only for MCE.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the default adapter is used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
addressRequiredString

Indicates the remote Bluetooth device address(MSE).

sessionIdRequiredString

Indicates the unique identifier of the session which was received as a connection response from map/connect.

startOffsetOptionalNumber

Indicates the Offset of the first item.

Default: 0

maxListCountOptionalNumber

Indicates the maximum number of items.

Default: 1024

Call Returns

Name

Required

Type

Description

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

addressRequiredString

Indicates the remote Bluetooth device address(MSE).

adapterAddressRequiredString

Indicates the address of the adapter.

foldersOptionalString array

Indicates the list of the available folder names for the current directory.

instanceNameOptionalString

Indicates the name of the MAS instance for the requested getFolderList.

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.

Error Codes Reference

Error Code

Error Text

Error Description

1,6,101,105,127,143,144,162,297, 298See API Error Codes Reference

See API Error Codes Reference

Example

# 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"
   ]
}

map/setFolder

Description

Returns to the child folder of the current directory of the connected MAS instance of the MSE device.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the default adapter is used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
addressRequiredString

Indicates the remote Bluetooth device address(MSE).

sessionIdRequiredString

Indicates the unique identifier of the session which was received as a connection response from the map/connect.

folderRequiredString

Indicates the name or the absolute path of the child folder.

Possible inputs:

  • Get the supported folder list using map/getFolderlist

Call Returns

Name

Required

Type

Description

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

addressRequiredString

Indicates the remote Bluetooth device address(MSE).

adapterAddressRequiredString

Indicates the address of the adapter.

instanceNameOptionalString

Indicates the name of the MAS instance for the requested setFolder.

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.

Error Codes Reference

Error Code

Error Text

Error Description

1,6,101,105,127,143,144,162,297, 298See API Error Codes Reference

See API Error Codes Reference

299Required 'folder' parameter is not supplied

Required 'folder' parameter is not supplied

26Requested folder is not found

Requested folder is not found

Example

# 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
}

map/getMessageFilters

Description

Returns all the available fields that can be used in the fields filter of the getMessageList.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the default adapter is used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
addressRequiredString

Indicates the remote Bluetooth device address(MSE).

sessionIdRequiredString

Indicates the unique identifier of the session which was received as a connection response from the map/connect.

Call Returns

Name

Required

Type

Description

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

addressRequiredString

Indicates the remote bluetooth device address(MSE).

adapterAddressRequiredString

Indicates the address of the adapter.

filtersOptionalString array

Indicates the list of all the available filter fields supported by the Bluetooth stack.

instanceNameOptionalString

Indicates the name of the MAS instance for the requested getFolderList.

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.

Error Codes Reference

Error Code

Error Text

Error Description

1,6,101,105,106,127,129,143,144,162,297, 298See API Error Codes Reference

 See API Error Codes Reference

Example

# 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"
   ]
}

map/getMessageList

Description

Gets the message list of the specific folder of the connected MAS instance of the MSE device.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the default adapter is used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
addressRequiredString

Indicates the remote Bluetooth device address(MSE).

sessionIdRequiredString

Indicates the unique identifier of the session which was received as a connection response from the map/connect.

folderOptionalString

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.

filtersOptionalObject: bluetooth2MessageFilters

Indicates the list of the filters which can be used for the API.

Call Returns

Name

Required

Type

Description

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

addressRequiredString

Indicates the remote Bluetooth device address(MSE).

adapterAddressRequiredString

Indicates the address of the adapter.

instanceNameOptionalString

Indicates the name of the MAS instance for the requested getFolderList.

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
messagesOptionalObject array: bluetooth2MessageList

Returns the messages with the handle and the properties from the selected folder.

Error Codes Reference

Error Code

Error Text

Error Description

1,6,101,105,127,143,144,162,297, 298See API Error Codes Reference

See API Error Codes Reference

Example

# 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"
      }
   ]
}

map/getMessage

Description

Downloads the specific message based on the message handle.

Note: This method is available only for MCE.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the default adapter is used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
addressRequiredString

Indicates the remote Bluetooth device address(MSE).

handleRequiredString

Indicates the message handle.

destinationFileOptionalString

Indicates the name of the destination file.

Note: If not provided, it will be set as per the message handle.

attachmentOptionalBoolean

Indicates if attachments are included in the bMessage object returned by the MSE.

Possible values are:

  • false: Indicates that the no attachments included in the bMessage object
  • true: Indicates that the attachments included in the bMessage object

Default: false

sessionIdRequiredString

Indicates the unique identifier of the session which was received as a connection response from the map/connect.

Call Returns

Name

Required

Type

Description

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

addressRequiredString

Indicates the remote Bluetooth device address(MSE).

adapterAddressRequiredString

Indicates the address of the adapter.

destinationFileOptionalString

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>

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.

Error Codes Reference

Error Code

Error Text

Error Description

1,6,101,105,106,127,129,143,144,162,297, 298See API Error Codes Reference

See API Error Codes Reference

304Required 'handle' parameter is not supplied

Required 'handle' parameter is not supplied

139Supplied destination path does not exist or is invalid

Supplied destination path <destinationFile> does not exist or is invalid

27Requested message handle is not found

Requested message handle is not found

Example

# 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
}

map/setMessageStatus

Description

Modifies the status of a message on the MSE.

Note: This method is available only for MCE

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the default adapter is used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
addressRequiredString

Indicates the remote Bluetooth device address(MSE).

sessionIdRequiredString

Indicates the unique identifier of the session which was received as a connection response from the map/connect.

handleRequiredString

Indicates the message handle.

The handle shall be represented by a null-terminated unicode text string with 16 hexadecimal digits.

statusIndicatorRequiredString

Indicates the status of the information to be modified.

Possible values are:

  • read: Read status
  • deleted: Deleted status
statusValueRequiredBoolean

Indicates the status value.

  • For the "readStatus" indicator. Possible values are:
    • true: read
    • false: unread
  • For the "deletedStatus" indicator. Possible values are:
    • true: deleted
    • false: undeleted

Call Returns

Name

Required

Type

Description

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

addressRequiredString

Indicates the remote Bluetooth device address(MSE).

adapterAddressRequiredString

Indicates the address of the adapter.

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.

Error Codes Reference

Error Code

Error Text

Error Description

1,6,101,105,106,127,129,143,144,162,297, 298See API Error Codes Reference

See API Error Codes Reference

304Required 'handle' parameter is not supplied

Required 'handle' parameter is not supplied

306Required 'statusIndicator' parameter is not supplied

Required 'statusIndicator' parameter is not supplied

307Required 'statusValue' parameter is not supplied

Required 'statusValue' parameter is not supplied

27Requested message handle is not found

Requested message handle is not found

Example

# 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
}

avrcp/browse/getCurrentFolder

Description

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.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
addressRequiredString

Indicates the address of the remote device.

subscribeOptionalBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.

Default: false

Call Returns

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

addressOptionalString

Indicates the address of the remote device.

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
subscribedRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.
folderNameOptionalString

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.

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Subscription Returns

Name

Required

Type

Description

adapterAddressRequiredString

Indicates the address of the adapter.

addressRequiredString

Indicates the address of the remote device.

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details
subscribedRequiredBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.
folderNameOptionalString

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.

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Error Codes Reference

Error Code

Error Text

Error Description

1, 17, 101, 105, 127, 136, 143, 144See API Error Codes section for reference

See API Error Codes section for reference

Example

# 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
}

avrcp/browse/getNumberOfItems

Description

Retrieves the total number of items in the current folder of the media player's virtual file system presented by the AVRCP TG.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
addressRequiredString

Indicates the address of the remote device.

Call Returns

Name

Required

Type

Description

adapterAddressRequiredString

Indicates the address of the adapter.

addressRequiredString

Indicates the address of the remote device.

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
numberOfItemsOptionalNumber

Indicates the total number of items in the current folder.

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Error Codes Reference

Error Code

Error Text

Error Description

1, 17, 101, 105, 127, 136, 143, 144See API Error Codes section for reference

See API Error Codes section for reference

Example

# 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
}

avrcp/browse/getFolderItems

Description

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.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the address of the default adapter will be used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
addressRequiredString

Indicates the address of the remote device.

startIndexRequiredNumber

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.

endIndexRequiredNumber

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.

Call Returns

Name

Required

Type

Description

adapterAddressRequiredString

Indicates the address of the adapter.

addressRequiredString

Indicates the address of the remote device.

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details
folderItemsOptionalObject array: bluetooth2AvrcpFolderItem

Indicates an array of items in the folder.

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Error Codes Reference

Error Code

Error Text

Error Description

1, 17, 101, 105, 127, 136, 143, 144, 300, 301See API Error Codes section for reference

See API Error Codes section for reference

Example

# 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
}

#  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"
}

map/pushMessage

Description

Sends the message.

Example: Sending an SMS.

Note: The API is designed based on MAP 1.0 specification.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the default adapter is used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
addressRequiredString

Indicates the remote Bluetooth device address(MSE).

sessionIdRequiredString

Indicates the unique identifier of the session which was received as a connection response from the map/connect.

sourceFileRequiredString

Indicates the location of the file containing message body in the bMessage format.

Note: Get sample file using map/getMessage API.

folderRequiredString

Indicates the folder name with the absolute path.

Possible inputs : 

  • Get the supported folder list using the map/getFolderlist API.
transparentOptionalBoolean

Indicates to the MSE that no copy of the message shall be kept in the 'sent' folder after the message was sent.

Default: false

retryOptionalBoolean

Indicates if successive attempts at sending the message shall be carried out in case of the cellular network.

Default: true

charsetOptionalString

Indicates the type of content delivered in the iMessage

Possible values are:

  • native: Only applicable for SMS messages, when the bMessage content is a SMS_Deliver PDU which can be sent by the MSE without trans-coding
  • utf8: If the message text shall is coded in UTF-8 which may (Email/MMS) or shall be trans-coded into SMS by the MSE before sending.

Call Returns

Name

Required

Type

Description

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

addressRequiredString

Indicates the remote Bluetooth device address(MSE).

adapterAddressRequiredString

Indicates the address of the adapter.

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
handleOptionalString

Indicates the message handle.

Note: map/getMessageNotificationEvent API will use this return parameter to know the status change for a specific message handle.

Error Codes Reference

Error Code

Error Text

Error Description

1,6,101,105,106,127,129,143,144,162,297, 298See API Error Codes Reference

See API Error Codes Reference

299Required 'folder' parameter is not supplied

Required 'folder' parameter is not supplied

137Required parameter 'sourceFile' is not supplied

Required parameter 'sourceFile' is not supplied

142Supplied file does not exist or is invalid

Supplied file <sourceFile> does not exist or is invalid

Example

# 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"
}

map/getMessageNotification

Description

Receives the message notification from the MSE device.

Note: This method is available only for MCE.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the default adapter is used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
addressRequiredString

Indicates the remote Bluetooth device address(MSE).

sessionIdRequiredString

Indicates the unique identifier of the session which was received as a connection response from the map/connect.

subscribeRequiredBoolean

Indicates if subscribed to get the notifications on the message event from the MSE.

Possible values are:

  • true: Subscribe to get the notifications
  • false: Not subscribed

Call Returns

Name

Required

Type

Description

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

addressRequiredString

Indicates the remote Bluetooth device address(MSE).

adapterAddressRequiredString

Indicates the address of the adapter.

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
subscribedRequiredBoolean

Indicates if subscribed to get the notifications on the message event from the MSE.

Possible values are:

  • true: Subscribe to get the notifications
  • false: Not subscribed
sessionIdRequiredString

Indicates the unique identifier of the session which was received as a connection response from the map/connect.

Subscription Returns

Name

Required

Type

Description

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

adapterAddressRequiredString

Indicates the address of the adapter.

addressRequiredString

Indicates the remote Bluetooth device address(MSE).

subscribedRequiredBoolean

Indicates if subscribed to get the notifications on the message event from the MSE.

Possible values are:

  • true: Subscribe to get the notifications
  • false: Not subscribed
sessionIdRequiredString

Indicates the unique identifier of the session which was received as a connection response from the map/connect.

notificationTypeOptionalString

Indicates the type of the message notification.

Possible values are:

  • NewMessage: Indicates that a new message has been received by the MSE device.This event type shall also be used if a new message replaces an old one on the MSE.
  • DeliverySuccess: Indicates that a message has been successfully delivered to its intended recipient.
  • SendingSuccess: Indicates that a message has been successfully sent to a remote network.
  • DeliveryFailure: Indicates that the delivery of a message to its intended recipient failed.This event type shall not be applied for emails.
  • SendingFailure: Indicates that sending to a remote network failed.
  • MessageDeleted: Indicates that a message has been deleted from the reported folder on the MSE and has therefore been shifted to the 'Deleted' folder.
  • MessageShift: Indicates that a message has been shifted on the MSE from one folder to another folder.
messageOptionalObject: bluetooth2Message

Returns the message with the handle and properties.

Error Codes Reference

Error Code

Error Text

Error Description

101,105,106,127,129,143,144,162,297, 298See API Error Codes Reference

See API Error Codes Reference

103Method needs to be subscribed

Method needs to be subscribed

Example

# 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
}

avrcp/browse/search

Description

Searches an item in the current browsing folder (and its sub folders) using a search string.

Note:

  • The API succeeds only if the player is searchable.
  • The "searchable" field of bluetooth2AvrcpPlayerInfo object for the addressed player received in the getPlayerInfo response indicates if the player supports search feature.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the default adapter is used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
addressRequiredString

Indicates the address of the remote device.

searchStringRequiredString

Indicates the string to search.

Call Returns

Name

Required

Type

Description

adapterAddressRequiredString

Indicates the address of the adapter.

addressRequiredString

Indicates the address of the remote device.

returnValueRequiredBoolean

Indicates the status of the operation.
Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed.
    Check the "errorCode" and "errorText" fields for details
searchResultOptionalString

Indicates the path to the search list.

Note: The application can changeFolder to this path and browse the search list

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

Error Codes Reference

Error Code

Error Text

Error Description

1, 17, 101, 105, 303, 127, 136, 143, 144See API Error Codes section for reference

See API Error Codes section for reference

Example

# 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"
}

avrcp/browse/playItem

Description

Plays the browsed item.

Note:

  • When user selects a playable item (playable is set to true for the item in the getFolderItems response) among the items listed
  • The application can call the API with the path received in the bluetooth2AvrcpFolderItem object of getFolderItems response to play the selected item.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the default adapter is used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
addressRequiredString

Indicates the address of the remote device.

itemPathRequiredString

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.

Call Returns

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

addressRequiredString

Indicates the address of the remote device.

returnValueRequiredBoolean

Indicates the status of the operation.
Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed.
    Check the "errorCode" and "errorText" fields for details
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

Error Codes Reference

Error Code

Error Text

Error Description

1, 17, 101, 105, 302, 127, 136, 143, 144See API Error Codes section for reference

See API Error Codes section for reference

Example

# 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
}

avrcp/browse/addToNowPlaying

Description

Adds the browsed item to the current playing list.

Note:

  • When user selects a playable item (playable is set to true for the item in the getFolderItems response) among the items listed, the application can call this API with the path received in the bluetooth2FolderItem object of the getFolderItems response to add the item to the now playing list.
  • The application can call addToNowPlaying with the path to the folder, if the folder is playable.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the default adapter is used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
addressRequiredString

Indicates the address of the remote device.

itemPathRequiredString

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.

Call Returns

Name

Required

Type

Description

adapterAddressRequiredString

Indicates the address of the adapter.

addressRequiredString

Indicates the address of the remote device.

returnValueRequiredBoolean

Indicates the status of the operation.
Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed.
    Check the "errorCode" and "errorText" fields for details
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation.

Error Codes Reference

Error Code

Error Text

Error Description

1, 17, 101, 105, 302, 127, 136, 143, 144See API Error Codes section for reference

See API Error Codes section for reference

Example

# 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"
}

avrcp/browse/changePath

Description

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.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note:

  • If not specified, the default adapter is used.
  • If the service is part of a container session, do not specify adapterAddress. Based on the session, by default, a pre-selected adapterAddress is used.
addressRequiredString

Indicates the address of the remote device.

itemPathRequiredString

Indicates the path to the folder item to change to.

Note: Item path is received in the bluetooth2FolderItem object of the getFolderItems API response.

Call Returns

Name

Required

Type

Description

adapterAddressRequiredString

Indicates the address of the adapter.

addressRequiredString

Indicates the address of the remote device.

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation.

Error Codes Reference

Error Code

Error Text

Error Description

1, 17, 101, 105, 302, 127, 136, 143, 144See API Error Codes section for reference

See API Error Codes section for reference

Example

# 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
}

avrcp/notifyMediaPlayStatus

Description

Enables the AVRCP target to inform the AVRCP controller about the change in media play status or position without controller requesting for the same.

Parameters

Name

Required

Type

Description

adapterAddressOptionalString

Indicates the address of the adapter.

Note: If not specified, the default adapter is used

addressRequiredString

Indicates the address of the remote device.

playbackStatusRequiredObject: bluetooth2PlayStatus

Indicates the information about the play status of the media.

Call Returns

Name

Required

Type

Description

adapterAddressRequiredString

Indicates the address of the adapter.

addressRequiredString

Indicates the address of the remote device.

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

Error Codes Reference

Error Code

Error Text

Error Description

1, 17, 101, 105, 308, 127, 136, 143, 144See API Error Codes section for reference

See API Error Codes section for reference

Example

# 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"
}

Objects

bluetooth2Adapter

An object containing constant information about the adapter.

Name

Required

Type

Description

adapterAddressRequiredString

The address (bdaddr) of the adapter.

defaultRequiredBoolean

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​.

classofDeviceRequiredNumber

Class of the Bluetooth adapter. Values are taken from https://www.bluetooth.com/specifications/assigned-numbers/baseband/.

stackNameRequiredString

The name of the SIL (Stack Interface Layer) that wraps the Bluetooth stack used by this adapter. 

stackVersionRequiredString

Version of the Bluetooth stack that the adapter's SIL (Stack Interface Layer) wraps (not the version of the SIL itself).

firmwareVersionRequiredString

Version of the firmware used by the adapter's hardware.

serviceClassesRequiredObject array: bluetooth2ServiceClass

The Bluetooth Service Classes implemented for this adapter.

bluetooth2AdapterStatus

Contains the information about the status of the adapter identified by the adapterAddress parameter.

The following values are read-only: 

  • Discovering.
  • Pairable.
  • Pairing​.

Name

Required

Type

Description

adapterAddressRequiredString

Indicates the address (bdaddr) of the adapter.

nameRequiredString

Indicates the friendly name of the adapter.

Note: The default name chosen by the system can be changed by the user.

poweredRequiredBoolean

Indicates that the adapter radio is powered on and is usable for discovery and connections.

discoveringRequiredBoolean

Indicates that the adapter is discovering other devices.

discoveryTimeoutRequiredNumber

Indicates the timeout in seconds after which device discovery will be stopped.

Note:

  • A value of zero means that the timeout is disabled and the adapter will run the discovery process forever.
  • Negative values are not allowed.
pairingRequiredBoolean

Indicates that the adapter is in the process of pairing to a remote device, either via incoming or outgoing pairing.

discoverableRequiredBoolean

 Indicates if the adapter can be discovered by remote devices.

Note:

  • If discoverableTimeout has a non-zero value, discoverable be set back to false that number of seconds after the call to adapter/setState set it to ​true.
discoverableTimeoutRequiredNumber

Indicates the discoverable timeout in seconds.

Note:

  • A value of zero means that the timeout is disabled and the adapter will stay in discoverable mode until a call to adapter/setState sets discoverable to false.
  • Negative values are not allowed.
pairableRequiredBoolean

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:

  • There is an exception to this field when the bluetooth capability is "NoInputNoOutput". In this case, pairable is always set to true, since pairing simply works without any responses on awaitPairingRequests.
  • The client need not be subscribed to awaitPairingRequests when the bluetooth capability is "NoInputNoOutput".
pairableTimeoutRequiredNumber

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.

interfaceNameRequiredString

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.

bluetooth2DeviceStatus

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

addressRequiredString

Indicates the address (bdaddr) of the device.

nameRequiredString

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.

classOfDeviceRequiredNumber

Indicates the class of the Bluetooth device.

Note: Values are taken from https://www.bluetooth.com/specifications/assigned-numbers/baseband/.

typeOfDeviceRequiredString

Indicates the type of the device.

Possible values are:

  • unknown: Unknown device type.
  • BREDR: Basic Rate/Enhanced Data Rate.
  • BLE: Bluetooth Low Energy.
  • dual: Supports both Basic Rate/Enhanced Data Rate and Bluetooth Low Energy.
serviceClassesRequiredObject array: bluetooth2ServiceClass

Indicates the array of service classes supported by this device.

pairingRequiredBoolean

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).

pairedRequiredBoolean

Indicates if the device is paired with the adapter.

Possible values are:

  • true: The device is paired with the adapter with adapterAddress​.
  • false: The device is not paired with the adapter.
adapterAddressRequiredString

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.

connectedProfilesOptionalString 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/.

trustedRequiredBoolean

Indicates whether the given device is trusted or not. 

Possible values are: 

  • true: Remote device is seen as a trusted device.
  • false: Remote device is not seen as a trusted device.
blockedRequiredBoolean

Indicates if a remote device is blocked (if set) or unblocked (if reset) for pairing and profile connections.

Possible values are: 

  • true: Any incoming connections from the device will be immediately rejected. Any device drivers will also be removed and no new ones will be probed as long as the device is blocked.
  • false: Incoming connections are allowed from the remote device.
rssiRequiredNumber

Indicates the signal strength level of the device.

txPowerRequiredNumber

Indicates the transmission power level of the remote device.

Note:

  • This property is only available for Bluetooth Low Energy devices.
  • This property is not available for Bluetooth classic devices.
scanRecordRequiredNumber (uint8_t) array

Indicates the service data of the remote device (if advertised from the remote device, else it will be blank).

manufacturerDataRequiredNumber (uint8_t) array

Indicates manufacturer-specific company ID and data (if advertised from the remote device, else it will be blank).

bluetooth2ServiceClass

Contains the Bluetooth service class information.

Name

Required

Type

Description

mnemonicRequiredString

Indicates a mnemonic for the UUID of the service class.

Note:

categoryRequiredString

Indicates the LS2 category methods that can access the service class.

Note:

bluetooth2GattServiceInfo

Object containing the GATT service configuration.

Name

Required

Type

Description

serviceRequiredString

UUID of the service

typeRequiredString

UUID which describes the type of the service.

The following types are defined:

  • primary (UUID 0x2800)
  • secondary (UUID 0x2801)

 

includesRequiredString array

List of service UUIDs this services includes in its definition.

characteristicsRequiredObject array: bluetooth2GattCharacteristicInfo

List of characteristics which are part of the service

instanceIdOptionalString

Unique identifier of the service.

bluetooth2GattValueInfo

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:

  • string
  • number
  • Array of numbers

The last one is only used when not value type descriptor is present. 

Name

Required

Type

Description

stringOptionalString

Present when the value is from type string. Not present otherwise.

numberOptionalNumber

Present when the value is from type number. Not present otherwise.

bytesOptionalNumber array

If the type of the value is not specified then the value is returned as a sequence of bytes.

bluetooth2GattCharacteristicInfo

Object containing information about a GATT characteristic.

Name

Required

Type

Description

characteristicRequiredString

UUID of the characteristic.

valueRequiredObject: bluetooth2GattValueInfo

Value of the characteristic.

propertiesRequiredObject: bluetooth2GattPropertiesInfo

Configured properties for the characteristic.

permissionsRequiredObject: bluetooth2GattPermissionsInfo

Configured permissions for the characteristic.

descriptorsRequiredObject array: bluetooth2GattDescriptorInfo

List of descriptors for the characteristic.

instanceIdOptionalString

Unique identifier of the characteristic

bluetooth2GattPropertiesInfo

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

broadcastOptionalBoolean

If set, permits broadcasts of the Characteristic Value using Server Characteristic Configuration Descriptor.

If set, the Server Characteristic Configuration Descriptor shall exist.

readOptionalBoolean

If set, permits reads of the Characteristic Value.

writeWithoutResponseOptionalBoolean

If set, permit writes of the Characteristic Value without response.

writeOptionalBoolean

If set, permits writes of the Characteristic Value with response

notifyOptionalBoolean

If set, permits notifications of a Characteristic Value without acknowledgement.

If set, the Client Characteristic Configuration Descriptor shall exist.

indicateOptionalBoolean

If set, permits indications of a Characteristic Value with acknowledgement.

authenticatedSignedWritesOptionalBoolean

If set, permits signed writes to the Characteristic Value

extendedPropertiesOptionalBoolean

If set, additional characteristic properties are defined in the Characteristic Extended Properties Descriptor.

If set, the Characteristic Extended Properties Descriptor shall exist.

bluetooth2GattPermissionsInfo

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

readOptionalBoolean

If set, clients are allowed to read the characteristic value.

readEncryptedOptionalBoolean

If set, allows encrypted read operations.

readEncryptedMitmOptionalBoolean

If set, allows reading with man-in-the-middle protection.

writeOptionalBoolean

If set, clients are allowed to write the characteristic value.

writeEncryptedOptionalBoolean

If set, allows encrypted writes.

writeEncryptedMitmOptionalBoolean

If set, allows encrypted writes with man-in-the-middle protection.

writeSignedOptionalBoolean

If set, allows signed write operations.

writeSignedMitmOptionalBoolean

If set, allows signed write operations with man-in-the-middle protection.

bluetooth2GattDescriptorInfo

Object containing information about a GATT descriptor.

Name

Required

Type

Description

descriptorRequiredString

Unique identifier of the descriptor

valueRequiredObject: bluetooth2GattValueInfo

Value of the descriptor

instanceIdOptionalString

Unique identifier of the descriptor

bluetooth2PushRequest

Object containing information about an OPP push request

Name

Required

Type

Description

requestIdRequiredString

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).

addressRequiredString

The address (bdaddr) of the device where the file came.

nameRequiredString

The name of the device where the file came.

fileNameRequiredString

The name of the file received from a remote device.

fileSizeRequiredNumber

The file size in bytes.

transferredOptionalNumber

Number of bytes transferred so far.

bluetooth2MediaMetaData

Contains information about a media metadata value.

Name

Required

Type

Description

titleOptionalString

Indicates the title of the media.

artistOptionalString

Indicates the name of the artist.

albumOptionalString

Indicates the name of album.

genreOptionalString

Indicates the genre of the media.

trackNumberOptionalNumber

Indicates the track number of the media.

trackCountOptionalNumber

Indicates the total number of tracks in the album.

durationOptionalNumber

Indicates the playing time of the media in milliseconds.

bluetooth2PlayStatus

Contains the information about the media playstatus value.

Name

Required

Type

Description

durationOptionalNumber

Indicates the number representing the current track length in milliseconds.

positionOptionalNumber

Indicates the number representing the current playing time in milliseconds.

statusOptionalString

Indicates the string representing the play status.

Possible values are:

  • stopped
  • playing
  • paused
  • fwd_seek
  • rev_seek, error.

bluetooth2LeServiceObject

Object containing information about a service to be advertised.

Name

Required

Type

Description

uuidRequiredString

16-bit UUID representing one service.

dataOptionalNumber (uint8_t) array

Array of data pertaining to a service.

bluetooth2TxPower

Object containing txpower information.

Name

Required

Type

Description

txPowerRequiredNumber

Transmit power as measured at 1 meter distance from the webOS device.

bluetooth2LeProprietaryDataObject

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

typeRequiredNumber

proprietary advertising type

dataRequiredNumber array

Byte sequence of proprietary data.

bluetooth2GattCharacteristicValueInfo

Object containing information about the characteristic uuid and values.

Name

Required

Type

Description

characteristicRequiredString

Characteristic uuid

valueRequiredNumber (uint8_t) array

Byte sequence of characteristic data.

bluetooth2AdvertiseSettings

Object containing information about the advertisement setting.

Name

Required

Type

Description

connectableOptionalBoolean

Possible values:

  • True: Sets the webOS device as a connectable advertising device.
  • False: Advertisements are undirected and non-connectable. 

Note: Default value of connectable is true.

txPowerOptionalNumber (uint8_t)

Two's complement value of transmission power.

Only used if includeTxPower is true.

timeoutOptionalNumber

Connection timeout.

bluetooth2AdvertiseData

Defines the format for data parameters.

Name

Required

Type

Description

includeTxPowerOptionalBoolean

Possible values:

True: To include advertisement transmission power.

False:To not include advertisement transmission power.

includeNameOptionalBoolean

Possible values:

True: To include local device name in advertisement.

False: To not include local device name in advertisement.

Note:Default value is false.

manufacturerDataOptionalNumber (uint8_t) array

Byte sequence of manufacturer specific data. 

servicesOptionalObject array: bluetooth2LeServiceObject

Array of services and data to be included in the advertisement.

Note:

  • Only zero or one bluetooth2LeServiceObject may contain data, all others (if any) must only contain uuid
  • Cannot be passed if manufacturerData is passed.
proprietaryDataOptionalObject: bluetooth2LeProprietaryDataObject

Used for advertising data with vendor proprietary advertising type or undefined type as parameter (ex. LE Bluetooth Devices (0x1B)).

bluetooth2LeServiceUuidObject

Object containing information about a service uuid to be advertised.

Name

Required

Type

Description

uuidRequiredString

Indicates the service uuid.

Note: uuid is an immutable representation of a 128-bit universally unique identifier.

maskOptionalString

Indicates the bit mask for the service uuid.

Possible values are:

  • 1: Set any bit in the mask to 1 to indicate a match is needed for the bit in the service uuid.
  • 0: Set any bit in the mask to 0 to ignore that bit.

bluetooth2LeServiceDataObject

Object containing information about a service data to be advertised.

Name

Required

Type

Description

uuidRequiredString

Indicates the data uuid.

Note: uuid is an immutable representation of a 128-bit universally unique identifier.

dataRequiredNumber array

Contains the array of data pertaining to a service.

maskOptionalNumber array

Indicates the bit mask for the service uuid.

Possible values are:

  • 1: Set any bit in the mask to 1 to indicate a match is needed for the bit in the service uuid.
  • 0: Set any bit in the mask to 0 to ignore that bit.

bluetooth2LeManufacturerData

Object containing information about manufacturer data.

Name

Required

Type

Description

idRequiredNumber

Indicates the manufacturer id which is the first two bytes of manufacturer data.

dataRequiredNumber array

Contains the array of manufacturer data.

maskOptionalNumber array

Indicates the bit mask for the service uuid.

Possible values are:

  • 1: Set any bit in the mask to 1 to indicate a match is needed for the bit in the service uuid.
  • 0: Set any bit in the mask to 0 to ignore that bit.

bluetooth2AvrcpRemoteFeatureInfo

Object containing information about avrcp remote features

Name

Required

Type

Description

roleRequiredString

Indicates the role of AVRCP.

Possible values are:

  • "CT"
  • "TG"

Note: "TG" stands for Target and "CT" stands for controller.

remoteFeatureRequiredString

Indicates the remote avrcp's features.

Possible values are:

  • "none"
  • "metaData"
  • "absoluteVolume"
  • "browse"

Note:

  • "none":   AVRCP 1.0
  • "metaData":  AVRCP 1.3
  • "absoluteVolume":  AVRCP 1.3 + supports TG role and volume sync
  • "browse":  AVRCP 1.4 and up, with browsing support

bluetooth2PbapVcfHandles

Contains information about vcf files entries with name and vcf handle from selected phonebook path.

Name

Required

Type

Description

NameRequiredString

Indicates object name.

HandleRequiredString

Indicates vcf file name.

bluetooth2PbapProperties

Contains supported properties from PSE device.

Name

Required

Type

Description

repositoryRequiredString

Indicates the current folder/repository path of the connected PSE device.

primaryVersionCounterRequiredString

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.

secondaryVersionCounterRequiredString

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.

databaseIdentifierRequiredString

Indicates that the PSE shall return the databaseIdentifier application parameter containing the unique database identifier of the PSE device.

fixedImageSizeRequiredBoolean

Indicates support for fixed image size.

bluetooth2PbapSearchFilter

Filter with key & value pair to search the phonebook

Name

Required

Type

Description

keyRequiredString

Indicates the field in the vcard to search with.

Possible values are:

  • name: To search for matches with name of a phone book entry.
  • number: To search for matches with number of a phone book entry.
  • sound: To search for matches with sound in a phone book entry.
valueRequiredString

Indicates the value of the string to be searched.

bluetooth2AvrcpPlayerInfo

Represents the media player information as received from AVRCP target.

Name

Required

Type

Description

nameRequiredString

Indicates the name of the media player.

typeRequiredString

Indicates the type of the media player type.

Possible values are:

  • Audio
  • Video
  • Audio Broadcasting
  • Video Broadcasting
addressedRequiredBoolean

Indicates if the player is addressed.

Possible values are:

  • true: The player is addressed
  • false: The player is not addressed
browsableRequiredBoolean

Indicates if the player supports media content browsing.

Possible values are:

  • true: The player supports browsing
  • false: The player does not support browsing

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.

searchableRequiredBoolean

Indicates if the player supports media content searching.

Possible values are:

  • true: The player supports searching
  • false: The player does not support searching

Note: The search API succeeds only if player supports search functionality.

playlistPathRequiredString

Indicates the path to the current playing list.

bluetooth2MasInstancesStatus

Contains an array of the MAS instances with the connection details.

Name

Required

Type

Description

instanceNameRequiredString

Indicates the name of the MAS instance.

sessionIdOptionalString

Indicates the assigned Obex Session Id for the instance , only available when instance is connected.

ConnectingRequiredBoolean

Indicates if the connection request is currently being processed.

Possible values are:

  • true: The connection request is currently being processed.
  • false: Otherwise. Example: The Bluetooth stack is no longer processing the connection request.
ConnectedRequiredBoolean

Indicates if the connection is open.

Possible values are:

  • true: The connection is open
  • false: Otherwise

bluetooth2MasInstances

Contains the list of supported MAS instances.

Name

Required

Type

Description

instanceNameOptionalString

Indicates the name of the MAS instance available in MSE.

supportedMessageTypesOptionalString array

Indicates the list of supported message types.

(SMS_GSM, EMAIL, MMS, SMS_CDMA)

bluetooth2MessageProperties

Contains the list of supported Message properties.

Name

Required

Type

Description

folderRequiredString

Indicates the folder path for the given message handle.

subjectRequiredString

Indicates the subject of the message.

dateTimeRequiredString

Indicates the timestamp of the message in the format "YYYYMMDDTHHMMSS".

senderNameRequiredString

Indicates the name of the sender for the given message.

senderAddressRequiredString

Indicates the address of the sender.

recipientNameRequiredString

Indicates the name of the recipient for the given message.

recipientAddressRequiredString

Indicates the address of the recipient for the given message.

typeRequiredString

Indicates the type of the message.

statusRequiredString

Indicates the message reception status.

Possible values are:

  • complete
  • fractioned
  • notification
priorityRequiredBoolean

Indicates that the message is of high priority or Not

readRequiredBoolean

Indicates that the message has already been read on the MSE or Not

sentRequiredBoolean

Indicates that the message has already been sent to the recipient or Not

protectedRequiredBoolean

Indicates that the message or a part of the message (e.g. attachment)
is protected by a DRM scheme or Not

textTypeRequiredBoolean

Indicates the original message or – in case of multipart-messages
– a part of the message includes textual content, "false" indicates that the message has
no textual but only binary content.

bluetooth2MessageList

Indicates the message list.

Name

Required

Type

Description

handleRequiredString

Indicates the message handle.

propertiesRequiredObject: bluetooth2MessageProperties

Indicates the message properties.

bluetooth2MessageFilters

Indicates the list of filters.

Name

Required

Type

Description

startOffsetOptionalNumber

Indicates the Offset of the first item.

Default: 0

maxCountOptionalNumber

Indicates the maximum number of items.

Default: 1024

subjectLengthOptionalNumber

Indicates the maximum length of the subject property in the message

fieldsOptionalString array

Indicates the required message fields.

Default: All values.

Note:

  • Possible values can be retrieved from map/getMessageFilter
messageTypesOptionalString array

Indicates the type of the filter messages.

Possible values:

  • sms
  • email
  • mms

Default: All values

periodBeginOptionalString

Indicates the starting period of the filter messages.

Possible value: Date in "YYYYMMDDTHHMMSS" format.

periodEndOptionalString

Indicates the ending period of the filter messages.

Possible values: Date in "YYYYMMDDTHHMMSS" format.

readOptionalBoolean

Filters messages based on the read flag.

Possible values are:

  • true: read
  • false: unread
recipientOptionalString

Filters messages by the recipient address.

senderOptionalString

Filter messages by the sender address.

priorityOptionalString

Filters messages based on the priority flag.

Possible values are:

  • true: high priority
  • false: non-high priority

bluetooth2AvrcpFolderItem

Describes an item in the folder.

Name

Required

Type

Description

nameRequiredString

Indicates the name to be displayed.

pathRequiredString

Indicates the item path.

typeRequiredString

Indicates the Item type.

Possible values are:

  • Audio
  • Video
  • Folder
playableRequiredBoolean

Indicates if the item is playable or not.

Possible values are:

  • true: Item is playable
  • false: Item is not playable
metaDataRequiredObject: bluetooth2MediaMetaData

Indicates the metadata of the item.

Note: Available if the item type is either "Audio" or "Video".

bluetooth2Message

Indicates the description of the message.

Name

Required

Type

Description

handleRequiredString

Indicates the message handle.

propertiesRequiredObject: bluetooth2MessageNotificationProperties

Indicates the message notification properties.

bluetooth2MessageNotificationProperties

Indicates the message notification properties.

Name

Required

Type

Description

folderRequiredString

Indicates the folder path for the given message handle.

oldFolderOptionalString

Indicates the previous folder path for the given message handle.

Note: This is only available for the MessageShift event.

typeRequiredString

Indicates the type of the message.

newMessagePropertiesOptionalObject: bluetooth2NewMessageProperties

Indicates the properties of the new message.

bluetooth2NewMessageProperties

Indicates the properties of the new message.

Name

Required

Type

Description

subjectRequiredString

Indicates the subject of the message.

dateTimeRequiredString

Indicates the timestamp of the message in the format "YYYYMMDDTHHMMSS".

senderNameRequiredString

Indicates the name of the message sender.

priorityRequiredBoolean

Indicates the message priority flag.

API Error Codes Reference

Error Code

Error Text

Error Description

6An 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.

7An unhandled error was encountered

An unhandled error was encountered at the SIL (Stack Interface Layer) while performing the requested operation.

218Cannot have more than one service with data

Attempted to pass multiple bluetooth2LeServiceObject containing data. Can only pass one that contains data.

10Authentication with a remote device failed

Authentication with a remote Bluetooth device has failed either at the underlying stack.

12Authentication with a remote device timed out

Authentication with a remote Bluetooth device has timed out before getting a valid response from the remote device.

9Authentication with a remote device was canceled

Authentication with a remote Bluetooth device was canceled by the remote Bluetooth device.

11Authentication with a remote was rejected

Authentication with a remote Bluetooth device was rejected by the remote Bluetooth device.

175Invalid value input for GATT characteristic

Characteristic value is not valid.

170GATT add service failed

Failed to add the GATT Service.

251Failed to disable profile

Failed to disable profile.

250Failed to enable profile

Failed to enable profile.

176GATT monitor characteristic failed for characteristic

Failed to monitor GATT characteristic.

242AVRCP send PASS THROUGH command failed

Failed to send AVRCP PASS THROUGH command.

254Failed to set absolute volume

Failed to set absolute volume.

169GATT service discovery cannot be started, one of adapterAddress or address should be supplied

Failed to start service discovery.

172GATT write characteristic failed

Failed to write characteristic the specified value.

174GATT read characteristics failed

Failed to read the requested characteristics. 

141Transfer was canceled

FTP file transfer to the remote Bluetooth device has been canceled by the client.

213Failed to configure advertisement

Generic advertisement configuration fail.

216Cannot 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.

214Attempted 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.

144The 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.

104Only one subscription allowed

Only one client is allowed to subscribe to this method

248Profile already enabled

Profile already enabled.

249Profile not enabled

Profile not enabled.

237Required 'address' parameter is not supplied

Required 'address' parameter is not supplied.

164Required 'characteristic' uuid parameter is not supplied

Required 'characteristic' uuid parameter is not supplied

105Required 'address' parameter is not supplied

The address parameter is mandatory, but was not supplied by the caller of the method.

137Required parameter 'sourceFile' is not supplied

The sourceFile parameter is mandatory to this method, but was not supplied by the caller of the method.

162Adapter Address is not valid

The adapter address given is not valid.

103Method 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.

2The device is not ready to perform the requested operation

The Bluetooth adapter (local device) is not ready to perform the requested operation.

108There is no pairing in progress

The Bluetooth adapter is not currently pairing with any remote Bluetooth device.

3The 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.

173Invalid GATT characteristic for the given service

The characteristic ID supplied does not belong to the service.

143Invalid JSON input

The JSON input has an invalid format and cannot be parsed.

102Failed to parse incoming message

The JSON payload passed to the method cannot be parsed and the input parameters' values cannot be determined.

163Required 'service' uuid parameter is not supplied

The mandatory Service name parameter required by this method call is not supplied.

215Services 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.

107Pairing 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.

136Device is not connected

The remote Bluetooth device is not connected to our Bluetooth adapter via the profile.

106Device 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.

8Unknown 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.

13Device is already paired

The remote device with which we are trying to pair is already paired to the local device adapter.

1The operation failed for an unspecified or generic reason

The requested Bluetooth operation failed for an unspecified or generic reason in the Bluetooth stack.

4The 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.

5The requested operation is not supported by the stack or device

The requested operation is not supported by the Bluetooth stack or adapter.

253Invalid value input for AVRCP absolute volume

Invalid value input for AVRCP absolute volume.

For details see the "Parameters" section of the 'avrcp/setAbsoluteVolume' method.

127Profile backend is not available

The SIL (Stack Interface Layer) module used doesn't provide any implementation for the profile.

177Invalid GATT Service

The supplied GATT service is not available or is not configured. 

165Invalid value input for GATT characteristic

The supplied value for GATT characteristics is invalid.

101Bluetooth 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).

180Required 'address' parameter is not supplied

The address parameter is mandatory, but was not supplied by the caller of the method.

247Failed to get Socket Path

The Path parameter is mandatory, but was not supplied by the caller of the method.

Contents