Skip to content
This repository was archived by the owner on Nov 22, 2021. It is now read-only.

BluetoothClient

Víctor Daniel Guevara edited this page Aug 9, 2020 · 2 revisions

This class represents a BluetoothClient.

public static BluetoothClient: Bluetooth

Events

BluetoothClient.Connected

Raised when the client successfully connects to a server.

public event EventHandler Connected

It receives a ClientConnectedEventArgs as the event arguments, which has the following fields:

  • string ServerAddress: The address of the server the client connected to.

BluetoothClient.ConnectionLost

Raised when the connection to the server is lost. It does not receive arguments.

public event EventHandler ConnectionLost

BluetoothClient.Disconnected

Raised when the client disconnects from the server.

public event EventHandler Disconnected

Methods

BluetoothClient.Connect(string)

Connects to the server with the UUID of a serial port on the device with the MAC address specified in the first argument.

public void Connect(string)

BluetoothClient.Connect(string, string)

Connects to the server with the UUID specified in the second argument on the device with the MAC address specified in the first argument.

public void Connect(string, string)

BluetoothClient.Disconnect()

Disconnects from the server.

public void Disconnect()

BluetoothClient.Send(string)

Sends the message specified in the argument to the server it is connected to.

public void Send(string)

Constants

BluetoothClient.CONNECTION_LOST

Message sent to the ServerObject indicating that the connection to the server has been lost.

public const string CONNECTION_LOST = "client.connection_lost";

BluetoothClient.COULD_NOT_CONNECT

Message sent to the ServerObject indicating that for some reason the client could not connect to the server.

public const string COULD_NOT_CONNECT = "client.error.COULD_NOT_CONNECT";

BluetoothClient.COULD_NOT_CREATE_SOCKET

Message sent to the ServerObject indicating that the socket connecting to the server could not be created.

public const string COULD_NOT_CREATE_SOCKET = "client.error.COULD_NOT_CREATE_SOCKET";