Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Update COM.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
Ari Madian authored Jan 24, 2019
1 parent 650f71a commit 705fac6
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions docs/SDK-Docs/COM.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,73 @@ NZXTSharp.COM
The :code:`NZXTSharp.COM` namespace contains classes used for facilitating communication between INZXTDevices and their respective hardware.

Nothing in the COM namespace is meant to be accessed by the user of NZXTSharp. All classes serve infrastructural purposes.

.. contents:: Table Of Contents

*****
Classes
*****

SerialController.cs
=====

**Inherets** :code:`NZXTSharp.COM.ICOMController.cs`

Properties
-----
:code:`SerialPort Port { get; }` The serial port operated by the SerialController.

:code:`SerialCOMData StartData { get; }` The SerialCOMData used to start the SerialController.

:code:`bool IsOpen { get => Port.IsOpen; }` Whether or not the SerialPort operated by the SerialController is open.

Constructors
-----
:code:`SerialController(string[] PossiblePorts, SerialCOMData Data) {}`
Params:
- :code:`PossiblePorts` - A string array containing the ports to attempt opening. Format: "COM3".
- :code:`Data` - A SerialCOMData object containing the information needed to open the port.

Methods
-----
:code:`byte[] Write(byte[] buffer, int responselength) {}` Writes the bytes in the given buffer, and returns the device's response.
Params:
- :code:`buffer` - The bytes to write to the device.
- :code:`responselength` - The expected length of the response: dictates the size of the returned buffer. Improper sizing will result in lost data.

:code:`void WriteNoResponse(byte[] buffer) {}` Writes the bytes in the given buffer to the device. Does not return a response.
Params:
- :code:`buffer` - The bytes to write to the device.

:code:`void Reconnect() {}` Disposes of and reinitializes the SerialController instance.

:code:`void Dispose() {}` Disposes of the SerialController instance.

SerialCOMData.cs
=====

Properties
-----
:code:`System.IO.Ports.Parity Parity { get; }` The parity type to use.

:code:`System.IO.Ports.StopBits StopBits { get; }` The stopbits to use.

:code:`int WriteTimeout { get; }` The write timeout in ms.

:code:`int ReadTimeout { get; }` The read timeout in ms.

:code:`int Baud { get; }` The baud rate to open the port with.

:code:`int DataBits { get; }` The number of databits to use.

Constructors
-----
The SerialCOMData class only has one constructor, and takes arguments corresponding to each of the available properties. The name parameter is optional, and defaults to an empty string.

*****
Interfaces
*****

ICOMController.cs
=====
Currently empty.

0 comments on commit 705fac6

Please sign in to comment.