AP&C API Reference
Public Types | Public Member Functions | Static Public Member Functions | List of all members
Apac.Dallas.OneWire.owApi Class Reference

A managed wrapper on the native 1-Wire Public Domain Kit API for the 1-Wire USB master devices based on the DS2490. It relies on a native shared library (owusb.dll/libowusb.so) to expose external calls to the p/invoke layer.
This is not yet a full implementation at either the C++ native API export level (not all 1-Wire calls are exported) or this managed level. More...

Public Types

enum class  FamilyCodes : byte {
  Unknown = 0x00 , HighResolutionDigitalThermometer = 0x10 , EconoThermometer = 0x22 , MultisensorTH = 0x26 ,
  ProgrammableThermometer = 0x28 , SerialIDButton = 0x81
}
 
enum class  LineLevel : int { Normal = 0x00 , Strong5 = 0x02 , Program = 0x04 , Break = 0x08 }
 The constants used to describe the line power level on the 1-Wire network.
More...
 

Public Member Functions

delegate void OneWireSerialNumberHandler (ulong serialNum)
 A delegate used to handle calls for a 1-Wire serial number. More...
 

Static Public Member Functions

static void WalkNetwork (int port, bool connected, OneWireSerialNumberHandler match)
 Walks the 1-Wire network at port and calls match for every device found. More...
 
static int Detect (usb_dev_handle handle)
 
static bool Acquire (int port)
 
static bool First (int port, bool doReset, bool alarmOnly)
 
static bool Next (int port, bool doReset, bool alarmOnly)
 
static byte[] GetSerialNumber (int port)
 
static void SetSerialNumber (int port, byte[] serialNumBuf)
 
static bool Access (int port)
 
static void Release (int port)
 
static byte ReadBytePower (int port)
 
static bool WriteBytePower (int port, byte sendbyte)
 
static byte ReadByte (int port)
 
static bool WriteByte (int port, byte sendbyte)
 
static LineLevel SetLineLevel (int port, LineLevel newLevel)
 
static bool TransferBlock (int port, bool doReset, ref byte[] buffer)
 
static void SetCrc (int port, ushort reset)
 
static void SetCrc (int port, byte reset)
 
static ushort CheckCrc (int port, ushort data)
 
static byte CheckCrc (int port, byte data)
 
static string GetLastError ()
 
static int Test (int val)
 A simple test method that echos the provided integer back to the caller. Note that this is a wrapper method so the call does go through the native library. More...
 

Detailed Description

A managed wrapper on the native 1-Wire Public Domain Kit API for the 1-Wire USB master devices based on the DS2490. It relies on a native shared library (owusb.dll/libowusb.so) to expose external calls to the p/invoke layer.
This is not yet a full implementation at either the C++ native API export level (not all 1-Wire calls are exported) or this managed level.

Member Enumeration Documentation

◆ LineLevel

The constants used to describe the line power level on the 1-Wire network.

Member Function Documentation

◆ OneWireSerialNumberHandler()

delegate void Apac.Dallas.OneWire.owApi.OneWireSerialNumberHandler ( ulong  serialNum)

A delegate used to handle calls for a 1-Wire serial number.

Parameters
serialNumThe serial number being handled.

◆ Test()

static int Apac.Dallas.OneWire.owApi.Test ( int  val)
inlinestatic

A simple test method that echos the provided integer back to the caller. Note that this is a wrapper method so the call does go through the native library.

Parameters
valThe Int32 value to be echoed.
Returns
Returns the value provided in val .

◆ WalkNetwork()

static void Apac.Dallas.OneWire.owApi.WalkNetwork ( int  port,
bool  connected,
OneWireSerialNumberHandler  match 
)
inlinestatic

Walks the 1-Wire network at port and calls match for every device found.

Parameters
portThe port to use for communications.
connectedIndicates the caller is managing the connection.
matchThe delegate called for each device on the network.

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