You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
michael edited this page Nov 9, 2015
·
2 revisions
Bluetooth functions. Min SDK level=5
bluetoothAccept
Listens for and accepts a Bluetooth connection. Blocks until the connection is established or fails.
uuid (String) (default=457807c0-4897-11df-9879-0800200c9a66)
timeout (Integer) How long to wait for a new connection, 0 is wait for ever (default=0)
bluetoothActiveConnections
Returns active Bluetooth connections.
bluetoothConnect
Connect to a device over Bluetooth. Blocks until the connection is established or fails.
uuid (String) The UUID passed here must match the UUID used by the server device. (default=457807c0-4897-11df-9879-0800200c9a66)
address (String) The user will be presented with a list of discovered devices to choose from if an address is not provided. (optional)
returns: (String) True if the connection was established successfully.
bluetoothDiscoveryCancel
Cancel the current device discovery process.
returns: (Boolean) true on success, false on error
bluetoothDiscoveryStart
Start the remote device discovery process.
returns: (Boolean) true on success, false on error
bluetoothGetConnectedDeviceName
Returns the name of the connected device.
connID (String) Connection id (optional) (default=)
bluetoothGetLocalAddress
Returns the hardware address of the local Bluetooth adapter.
bluetoothGetLocalName
Gets the Bluetooth Visible device name
bluetoothGetRemoteDeviceName
Queries a remote device for it\'s name or null if it can\'t be resolved
address (String) Bluetooth Address For Target Device
bluetoothGetScanMode
Gets the scan mode for the local dongle.\r Return values:\r \t-1 when Bluetooth is disabled.\r \t0 if non discoverable and non connectable.\r \r1 connectable non discoverable.\r3 connectable and discoverable.
bluetoothIsDiscovering
Return true if the local Bluetooth adapter is currently in the device discovery process.
bluetoothMakeDiscoverable
Requests that the device be discoverable for Bluetooth connections.
duration (Integer) period of time, in seconds, during which the device should be discoverable (default=300)
bluetoothRead
Read up to bufferSize ASCII characters.
bufferSize (Integer) (default=4096)
connID (String) Connection id (optional) (default=)
bluetoothReadBinary
Read up to bufferSize bytes and return a chunked, base64 encoded string.
bufferSize (Integer) (default=4096)
connID (String) Connection id (optional) (default=)
bluetoothReadLine
Read the next line.
connID (String) Connection id (optional) (default=)
bluetoothReadReady
Returns True if the next read is guaranteed not to block.
connID (String) Connection id (optional) (default=)
bluetoothSetLocalName
Sets the Bluetooth Visible device name, returns True on success
name (String) New local name
bluetoothStop
Stops Bluetooth connection.
connID (String) Connection id (optional) (default=)
bluetoothWrite
Sends ASCII characters over the currently open Bluetooth connection.
ascii (String) connID (String) Connection id (default=)
bluetoothWriteBinary
Send bytes over the currently open Bluetooth connection.
base64 (String) A base64 encoded String of the bytes to be sent.
connID (String) Connection id (optional) (default=)
checkBluetoothState
Checks Bluetooth state.
returns: (Boolean) True if Bluetooth is enabled.
toggleBluetoothState
Toggle Bluetooth on and off.
enabled (Boolean) (optional)
prompt (Boolean) Prompt the user to confirm changing the Bluetooth state. (default=true)
returns: (Boolean) True if Bluetooth is enabled.