C# Class Atmo.Daq.Win32.BaseDaqUsbConnection

Inheritance: IDisposable
Datei anzeigen Open project: wind101net/atmo

Public Methods

Method Description
Connect ( ) : bool

Forces a connection if possible.

Dispose ( ) : void

Closes and disposes the connection.

Protected Methods

Method Description
BaseDaqUsbConnection ( Atmo.Daq.Win32.PicHidUsbConnection usbConn ) : System

Constructs a new connection wrapping the given connection object.

BaseDaqUsbConnection ( string deviceId ) : System

Constructs a new connection for the given device ID.

ClearPacket ( byte data ) : void

Clears an array formatted as a new data packet.

The first byte will have the value 0 while the remaining bytes will have the value 255. The 0 value appears to be required while the other values are set to 255 to supposedly reduce the power required to transmit the packet.

Dispose ( bool disposing ) : void

Closes and disposes the connection.

DisposeComm ( ) : void

Closes and disposes the connection.

GenerateEmptyPacketData ( ) : byte[]

Generates 65 bytes which have been cleared using ClearPacket.

GenerateEmptyPacketData ( int dataSize ) : byte[]

Generates bytes which have been cleared using ClearPacket.

Method Details

BaseDaqUsbConnection() protected method

Constructs a new connection wrapping the given connection object.
protected BaseDaqUsbConnection ( Atmo.Daq.Win32.PicHidUsbConnection usbConn ) : System
usbConn Atmo.Daq.Win32.PicHidUsbConnection The USB connection to use.
return System

BaseDaqUsbConnection() protected method

Constructs a new connection for the given device ID.
protected BaseDaqUsbConnection ( string deviceId ) : System
deviceId string The device ID to connect to.
return System

ClearPacket() protected static method

Clears an array formatted as a new data packet.
The first byte will have the value 0 while the remaining bytes will have the value 255. The 0 value appears to be required while the other values are set to 255 to supposedly reduce the power required to transmit the packet.
protected static ClearPacket ( byte data ) : void
data byte The data to clear.
return void

Connect() public method

Forces a connection if possible.
public Connect ( ) : bool
return bool

Dispose() public method

Closes and disposes the connection.
public Dispose ( ) : void
return void

Dispose() protected method

Closes and disposes the connection.
protected Dispose ( bool disposing ) : void
disposing bool
return void

DisposeComm() protected method

Closes and disposes the connection.
protected DisposeComm ( ) : void
return void

GenerateEmptyPacketData() protected static method

Generates 65 bytes which have been cleared using ClearPacket.
protected static GenerateEmptyPacketData ( ) : byte[]
return byte[]

GenerateEmptyPacketData() protected static method

Generates bytes which have been cleared using ClearPacket.
protected static GenerateEmptyPacketData ( int dataSize ) : byte[]
dataSize int
return byte[]