AP&C API Reference
Public Member Functions | Static Public Member Functions | Protected Member Functions | Properties | List of all members
Apac.Dallas.OneWire.OneWireDevice Class Referenceabstract
Inheritance diagram for Apac.Dallas.OneWire.OneWireDevice:
Apac.Dallas.OneWire.OneWireDevice10 Apac.Dallas.OneWire.OneWireDevice26 Apac.Dallas.OneWire.OneWireDevice28 Apac.Dallas.OneWire.OneWireDevice81

Public Member Functions

abstract byte[] Read ()
 Reads this sensor's value. More...
 
abstract void Initialize (OneWire.Configuration.OneWireDeviceConfig config)
 Lets individual sensor implementations do routines to put the sensor in its expected state, such as setting the number of bits to resolve temperature readings. Some (many?) sensors will create a no-op method for this message. More...
 
override string ToString ()
 

Static Public Member Functions

static OneWireDevice Create (int port, OneWireDeviceConfig config)
 Factory method for getting specific 1-Wire device implementations that encapsulate their own communications routines by device type, by using configuration object. More...
 
static OneWireDevice Create (int port, byte[] serialNum)
 Factory method for getting specific 1-Wire device implementations that encapsulate their own communications routines by device type. More...
 
static OneWireDevice Create (int port, ulong serialNum)
 
static ulong DecodeSn (byte[] sn)
 
static string GetIdentifier (ulong sn)
 

Protected Member Functions

 OneWireDevice (int port, byte[] serialNumberBuf, owApi.FamilyCodes fc)
 Creates a new 1-Wire device instance and associates it to the port. More...
 

Properties

abstract ushort InputResolutionBits [get, set]
 Gets the input resolution bits. More...
 
abstract bool IsFunctionalSensor [get]
 Gets a value indicating whether this instance is functional sensor. More...
 
byte[] Buffer [get, protected set]
 Gets the last buffer of raw data retrieved from the device using Read. More...
 
ulong SerialNumber [get]
 Gets the unique 1-Wire identifier for this device. More...
 
byte[] RawSerialNumber [get]
 Gets the unique 1-Wire identifier for this device in binary format. More...
 
string Identifier [get]
 The SerialNumber as a hex string. More...
 
owApi.FamilyCodes FamilyCode [get]
 Gets the family code that is decoded from the SerialNumber . More...
 
string FamilyDescription [get, protected set]
 Gets a description that goes with FamilyCode . More...
 
string[] PartIds [get, protected set]
 Gets the list of part identifiers that apply to this family of devices. More...
 
int Port [get, set]
 Gets or sets the number for the port used to communicate with this device. More...
 
OneWireDeviceConfig Config [get]
 Gets or sets (protected) the configuration for this OneWireDevice. More...
 
log4net.ILog Log [get]
 Gets the log. More...
 

Constructor & Destructor Documentation

◆ OneWireDevice()

Apac.Dallas.OneWire.OneWireDevice.OneWireDevice ( int  port,
byte[]  serialNumberBuf,
owApi.FamilyCodes  fc 
)
inlineprotected

Creates a new 1-Wire device instance and associates it to the port.

Parameters
portA System.Int32 for the port through which this device is to be communicated.
serialNumberBufA System.Byte[] containing the raw data of 1-Wire unique identifier.

Member Function Documentation

◆ Create() [1/2]

static OneWireDevice Apac.Dallas.OneWire.OneWireDevice.Create ( int  port,
byte[]  serialNum 
)
inlinestatic

Factory method for getting specific 1-Wire device implementations that encapsulate their own communications routines by device type.

Parameters
portThe port used to connect to the device.
serialNumThe System.Byte[] holding the discovered device identifier.
Returns
Returns a OneWireDevice subclass appropriate for family code in the provided serial number or null if no match is found.

◆ Create() [2/2]

static OneWireDevice Apac.Dallas.OneWire.OneWireDevice.Create ( int  port,
OneWireDeviceConfig  config 
)
inlinestatic

Factory method for getting specific 1-Wire device implementations that encapsulate their own communications routines by device type, by using configuration object.

Parameters
portThe port used to connect to the device.
configThe OneWireDeviceConfig used to set up the device.
Returns
Returns a OneWireDevice subclass appropriate for family code in the provided serial number or null if no match is found.

◆ Initialize()

abstract void Apac.Dallas.OneWire.OneWireDevice.Initialize ( OneWire.Configuration.OneWireDeviceConfig  config)
pure virtual

Lets individual sensor implementations do routines to put the sensor in its expected state, such as setting the number of bits to resolve temperature readings. Some (many?) sensors will create a no-op method for this message.

◆ Read()

abstract byte [] Apac.Dallas.OneWire.OneWireDevice.Read ( )
pure virtual

Property Documentation

◆ Buffer

byte [] Apac.Dallas.OneWire.OneWireDevice.Buffer
getprotected set

Gets the last buffer of raw data retrieved from the device using Read.

◆ Config

OneWireDeviceConfig Apac.Dallas.OneWire.OneWireDevice.Config
get

Gets or sets (protected) the configuration for this OneWireDevice.

The config.

◆ FamilyCode

owApi.FamilyCodes Apac.Dallas.OneWire.OneWireDevice.FamilyCode
get

Gets the family code that is decoded from the SerialNumber .

◆ FamilyDescription

string Apac.Dallas.OneWire.OneWireDevice.FamilyDescription
getprotected set

Gets a description that goes with FamilyCode .

◆ Identifier

string Apac.Dallas.OneWire.OneWireDevice.Identifier
get

The SerialNumber as a hex string.

◆ InputResolutionBits

abstract ushort Apac.Dallas.OneWire.OneWireDevice.InputResolutionBits
getset

Gets the input resolution bits.

The input resolution bits.

◆ IsFunctionalSensor

abstract bool Apac.Dallas.OneWire.OneWireDevice.IsFunctionalSensor
get

Gets a value indicating whether this instance is functional sensor.

true if this instance is functional sensor; otherwise, false.

◆ Log

log4net.ILog Apac.Dallas.OneWire.OneWireDevice.Log
getprotected

Gets the log.

The log.

◆ PartIds

string [] Apac.Dallas.OneWire.OneWireDevice.PartIds
getprotected set

Gets the list of part identifiers that apply to this family of devices.

◆ Port

int Apac.Dallas.OneWire.OneWireDevice.Port
getset

Gets or sets the number for the port used to communicate with this device.

◆ RawSerialNumber

byte [] Apac.Dallas.OneWire.OneWireDevice.RawSerialNumber
get

Gets the unique 1-Wire identifier for this device in binary format.

◆ SerialNumber

ulong Apac.Dallas.OneWire.OneWireDevice.SerialNumber
get

Gets the unique 1-Wire identifier for this device.


The documentation for this class was generated from the following file: