Example extension api
This is example of API. Implementation contain in extension.
Parameters
Async Callback Returning Parameters: HASH
STATUS_* code. See error code by lastError property
Synchronous Return:
Method Access:
Rho.BluetoothConnection.createClientConnection(STRING serverName, CallBackHandler callback)
Rho::BluetoothConnection.createClientConnection(STRING serverName, CallBackHandler callback)
Parameters
Async Callback Returning Parameters: HASH
STATUS_* code. See error code by lastError property
Synchronous Return:
Method Access:
Rho.BluetoothConnection.createConnection(STRING role, CallBackHandler callback)
Rho::BluetoothConnection.createConnection(STRING role, CallBackHandler callback)
Parameters
Async Callback Returning Parameters: HASH
STATUS_* code. See error code by lastError property
Synchronous Return:
Method Access:
Rho.BluetoothConnection.createServerConnection(CallBackHandler callback)
Rho::BluetoothConnection.createServerConnection(CallBackHandler callback)
disable BT HW
Synchronous Return:
Method Access:
Rho.BluetoothConnection.disableBluetooth()
Rho::BluetoothConnection.disableBluetooth()
Synchronous Return:
Method Access:
myObject.disconnect()
enable BT HW
Synchronous Return:
Method Access:
Rho.BluetoothConnection.enableBluetooth()
Rho::BluetoothConnection.enableBluetooth()
Parameters
Synchronous Return:
Method Access:
Rho.BluetoothConnection.getConnectionByID(STRING connectionID)
Rho::BluetoothConnection.getConnectionByID(STRING connectionID)
Synchronous Return:
Method Access:
myObject.readData()
Synchronous Return:
Method Access:
myObject.readString()
Parameters
Async Callback Returning Parameters: HASH
see CONNECTION_STATUS_
Synchronous Return:
Method Access:
myObject.setCallback(CallBackHandler callback)
Synchronous Return:
Method Access:
Rho.BluetoothConnection.stopCurrentConnectionProcess()
Rho::BluetoothConnection.stopCurrentConnectionProcess()
Parameters
Synchronous Return:
Method Access:
myObject.writeData(ARRAY data)
Parameters
Synchronous Return:
Method Access:
myObject.writeString(STRING string)
Property Access:
myObject.connectionID
name of this device - show on connected device
Property Access:
myObject.deviceName
return TRUE if Bluetooth available for connection now
Property Access:
myObject.isAvailable
Property Access:
myObject.lastError
-1 if error, 0 if empty or more than zero if data waiting for read
Property Access:
myObject.status
all is OK
some error is occured during method call. Check error via lastError property
user cancelled operation
server role
client role