Class RehabDongleClient

Wrapper around SerialPort for the Rehab Dongle. Based on Silicon Labs BGX Bluetooth Xpress protocol.

Inheritance
RehabDongleClient
Implements
Namespace: MOSAIC.Components.Devices.HannesHand
Assembly: MOSAIC.dll
Syntax
internal sealed class RehabDongleClient : IDisposable

Fields

_serialPort

Declaration
private readonly SerialPort _serialPort
Field Value
Type Description
SerialPort

Properties

IsOpen

Declaration
public bool IsOpen { get; }
Property Value
Type Description
bool

Methods

ClearInput()

Clear input buffer.

Declaration
public void ClearInput()

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Declaration
public void Dispose()

EnterDongleCommandMode()

Enter dongle command mode by sending "$$$" (no line ending!)

Declaration
public void EnterDongleCommandMode()

Open(string)

Declaration
public void Open(string portName)
Parameters
Type Name Description
string portName

ReadAllLinesUntilTimeout()

Read all lines until timeout.

Declaration
public string[] ReadAllLinesUntilTimeout()
Returns
Type Description
string[]

ReadAllLinesWithTimeout(int)

Read with longer timeout for scan operations.

Declaration
public string[] ReadAllLinesWithTimeout(int timeoutMs)
Parameters
Type Name Description
int timeoutMs
Returns
Type Description
string[]

ReadExisting()

Read all available data as a string.

Declaration
public string ReadExisting()
Returns
Type Description
string

WriteLine(string)

Send a command with \r\n line ending.

Declaration
public void WriteLine(string cmd)
Parameters
Type Name Description
string cmd

WriteRaw(byte[])

Send raw bytes.

Declaration
public void WriteRaw(byte[] buffer)
Parameters
Type Name Description
byte[] buffer

Implements

IDisposable

Search documentation

Start typing to search the documentation.