roBtClientManager
Â
This object represents a BLE GATT service, where the player acts as a peripheral and another device (phone, tablet, etc.) acts as the client/central. Unlike roBtManager, which allows for unidirectional, non-connectable communication (i.e. beaconing), the roBtClientManager object is used to facilitate two-way, connectable communication. It provides an event to an attached message port when a new client connects. It also manages the client state, provides client update events, and times out the client after a period of inactivity. The JavaScript equivalent is BSBtManager.
The BLE clients themselves are represented by the roBtClient object.Â
ifBtClientManager
Start(params As roAssociativeArray) As Boolean
Starts BLE communication. This method accepts the following parameters:
client_timeout
: The amount of time (in seconds) that a client can be inactive before being disconnectedservice_uuid
: A UUID that identifies the serviceclientid_uuid
: The client-identifier attribute. Once a client device connects to the player, it should write its unique client identifier value to this attribute.user_variable_uuid
: The user variables attribute. This attribute is intended to be writable by both the player and the client, providing the primary means for exchanging state data. User variables can be written as a JSON string.command_uuid
: The command attribute. When a client device writes to this attribute, an event containing the command string is generated by the associated roBtClient instance.device_info_uuid
: The attribute for device information. This attribute is read-only for clients.device_data_uuid
: The attribute for device data. This attribute can be used to communicate available commands to clients. It is read-only for clients.
There is a limit 512 bytes on each attribute.
Â
Stop() As Boolean
Stops BLE communication.
SetDeviceInfo(a As Object) As Boolean
Â
SetDeviceData(a As Object) As Boolean
ifMessagePort
SetPort(a As Object)
Posts messages of type roBtClientManagerEvent to the attached message port.
ifIdentity
GetIdentity() As Integer
Returns a unique number that can be used to identify roBtClientManagerEvent objects that originate from this object.
The ifIdentity interface has been deprecated. We recommend using the ifUserData interface instead.
ifUserData
SetUserData(user_data As Object)
Sets the user data that will be returned when events are raised.
GetUserData() As Object
Returns the user data that has previously been set via SetUserData()
. It will return Invalid if no data has been set.
ifFailureReason
GetFailureReason() As String
Returns additional useful information when a method on the ifBtClientManager interface returns False.
Â