LogicalLabs Bluetooth Module

API Docs for: 1.0.3
Show:

BluetoothServerSocket Class

Module: Readme

BluetoothServerSocket objects can be created by calling the createServerSocket function on the BluetoothModule object.

Methods

close

() Void

Available since 1.0.0

Closes the server socket.

Returns:

Void:

isAccepting

() Boolean

Available since 1.0.0

Returns true if the server socket is currently accepting connections, false otherwise.

Returns:

Boolean:

True if the server socket is currently accepting connections, false otherwise.

startAccept

(
  • param
)
Void

Available since 1.0.0

Instructs the server socket to start accepting incoming connections.

Parameters:

  • param Object
    • [keepListening=true] Boolean optional

      Defines whether the server socket should keep listening after an incoming connection was received. The default is true. If you set this parameter to false, make sure that you implement an event handler for error events and call the startAccept function as appropriate, because the server socket will stop listening even if the incoming connection fails subsequently.

Returns:

Void:

stopAccept

() Void

Available since 1.0.0

Instructs the server socket to stop accepting incoming connections.

Returns:

Void:

Events

connectionReceived

Fired when the server socket receives an incoming connection.

Event Payload:

error

Fired when a socket operation fails.

Event Payload:

  • errorMessage String