Wasatch.NET 2.4.14
.NET application driver for Wasatch Photonics spectrometers
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
WasatchNET.Unpack Class Reference

A class to help unpack byte arrays returned from the spectrometer's various getCmd() results into standard datatypes. More...

Static Public Member Functions

static bool toBool (byte[] buf)
 
static byte toByte (byte[] buf)
 
static int toInt (byte[] buf)
 
static short toShort (byte[] buf)
 
static uint toUint (byte[] buf)
 This assumes input bytes are little-endian ([aa bb cc] = 0xccbbaa)
 
static UInt64 toUint64 (byte[] buf)
 
static ushort toUshort (byte[] buf)
 

Detailed Description

A class to help unpack byte arrays returned from the spectrometer's various getCmd() results into standard datatypes.

Differs from ParseData in that null-checks are required, and there are no offsets.

Member Function Documentation

◆ toBool()

static bool WasatchNET.Unpack.toBool ( byte[]  buf)
inlinestatic

◆ toByte()

static byte WasatchNET.Unpack.toByte ( byte[]  buf)
inlinestatic

◆ toInt()

static int WasatchNET.Unpack.toInt ( byte[]  buf)
inlinestatic

◆ toShort()

static short WasatchNET.Unpack.toShort ( byte[]  buf)
inlinestatic

◆ toUint()

static uint WasatchNET.Unpack.toUint ( byte[]  buf)
inlinestatic

This assumes input bytes are little-endian ([aa bb cc] = 0xccbbaa)

Parameters
buf
Returns

<todo>add msb:Bool flag to reverse order</todo>

◆ toUint64()

static UInt64 WasatchNET.Unpack.toUint64 ( byte[]  buf)
inlinestatic

◆ toUshort()

static ushort WasatchNET.Unpack.toUshort ( byte[]  buf)
inlinestatic

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