com.eurotech.framework.net.admin.modem.telit.de910
Class SmBus

java.lang.Object
  extended by com.eurotech.framework.net.admin.modem.telit.de910.SmBus
All Implemented Interfaces:
ICatalystSmBusService

public class SmBus
extends Object
implements ICatalystSmBusService


Field Summary
static int ERR_SMBUS_ACCESS_DENIED
           
static int ERR_SMBUS_COPYING_DRIVER
           
static int ERR_SMBUS_DRIVER_OPEN
           
static int ERR_SMBUS_INVALID_HANDLE
           
static int ERR_SMBUS_SERVICE_ALREADY_RUNNING
           
static int ERR_SMBUS_SERVICE_DOES_NOT_EXIST
           
static int ERR_SMBUS_SERVICE_EXISTS
           
static int ERR_SMBUS_SERVICE_NAME_INVALID
           
static int ERR_SMBUS_TIMEOUT
           
static int ERR_SMBUS_TIMEOUT_WAITING_FOR_MUTEX
           
static int ERR_SMBUS_UNKNOWN_ERROR
           
static int ERR_SMBUS_UNKNOWN_EXCEPTION
           
static int SMBUS_1_KHZ
           
static int SMBUS_1_MHZ
           
static int SMBUS_10_KHZ
           
static int SMBUS_100_KHZ
           
static int SMBUS_400_KHZ
           
static int SMBUS_50_KHZ
           
static int SMBUS_ERROR_BASE
           
 
Fields inherited from interface com.eurotech.framework.net.admin.modem.telit.de910.ICatalystSmBusService
SERVICE_NAME
 
Method Summary
static SmBus getInstance()
           
 int getLastError()
          gets the last error provided by the SMBus native library
 byte[] readBlock(byte slaveAddress, byte command)
          reads a block of bytes from the SMBus
 byte readByte(byte slaveAddress, byte command)
          reads a byte from the SMBus
 short readWord(byte slaveAddress, byte command)
          reads a 16 bit word from the SMBus
 void setLastError(int error)
          sets the last error in the SMBus native library
 void write(byte slaveAddress, byte command, byte[] data)
          writes data to the SMbus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SMBUS_1_KHZ

public static final int SMBUS_1_KHZ
See Also:
Constant Field Values

SMBUS_10_KHZ

public static final int SMBUS_10_KHZ
See Also:
Constant Field Values

SMBUS_50_KHZ

public static final int SMBUS_50_KHZ
See Also:
Constant Field Values

SMBUS_100_KHZ

public static final int SMBUS_100_KHZ
See Also:
Constant Field Values

SMBUS_400_KHZ

public static final int SMBUS_400_KHZ
See Also:
Constant Field Values

SMBUS_1_MHZ

public static final int SMBUS_1_MHZ
See Also:
Constant Field Values

SMBUS_ERROR_BASE

public static final int SMBUS_ERROR_BASE
See Also:
Constant Field Values

ERR_SMBUS_UNKNOWN_ERROR

public static final int ERR_SMBUS_UNKNOWN_ERROR
See Also:
Constant Field Values

ERR_SMBUS_DRIVER_OPEN

public static final int ERR_SMBUS_DRIVER_OPEN
See Also:
Constant Field Values

ERR_SMBUS_UNKNOWN_EXCEPTION

public static final int ERR_SMBUS_UNKNOWN_EXCEPTION
See Also:
Constant Field Values

ERR_SMBUS_ACCESS_DENIED

public static final int ERR_SMBUS_ACCESS_DENIED
See Also:
Constant Field Values

ERR_SMBUS_SERVICE_NAME_INVALID

public static final int ERR_SMBUS_SERVICE_NAME_INVALID
See Also:
Constant Field Values

ERR_SMBUS_SERVICE_DOES_NOT_EXIST

public static final int ERR_SMBUS_SERVICE_DOES_NOT_EXIST
See Also:
Constant Field Values

ERR_SMBUS_SERVICE_ALREADY_RUNNING

public static final int ERR_SMBUS_SERVICE_ALREADY_RUNNING
See Also:
Constant Field Values

ERR_SMBUS_COPYING_DRIVER

public static final int ERR_SMBUS_COPYING_DRIVER
See Also:
Constant Field Values

ERR_SMBUS_SERVICE_EXISTS

public static final int ERR_SMBUS_SERVICE_EXISTS
See Also:
Constant Field Values

ERR_SMBUS_INVALID_HANDLE

public static final int ERR_SMBUS_INVALID_HANDLE
See Also:
Constant Field Values

ERR_SMBUS_TIMEOUT_WAITING_FOR_MUTEX

public static final int ERR_SMBUS_TIMEOUT_WAITING_FOR_MUTEX
See Also:
Constant Field Values

ERR_SMBUS_TIMEOUT

public static final int ERR_SMBUS_TIMEOUT
See Also:
Constant Field Values
Method Detail

getInstance

public static SmBus getInstance()

write

public void write(byte slaveAddress,
                  byte command,
                  byte[] data)
           throws Exception
Description copied from interface: ICatalystSmBusService
writes data to the SMbus

Specified by:
write in interface ICatalystSmBusService
Parameters:
slaveAddress - the slave address to write to
command - the command to write
data - the data to write
Throws:
Exception - if the write can not succeed

readByte

public byte readByte(byte slaveAddress,
                     byte command)
              throws Exception
Description copied from interface: ICatalystSmBusService
reads a byte from the SMBus

Specified by:
readByte in interface ICatalystSmBusService
Parameters:
slaveAddress - the slave address to read from
command - the command to send
Returns:
the byte read from the SMBus
Throws:
Exception - if the read fails

readWord

public short readWord(byte slaveAddress,
                      byte command)
               throws Exception
Description copied from interface: ICatalystSmBusService
reads a 16 bit word from the SMBus

Specified by:
readWord in interface ICatalystSmBusService
Parameters:
slaveAddress - the slave address to read from
command - the command to send
Returns:
the word read from the SMBus
Throws:
Exception - if the read fails

readBlock

public byte[] readBlock(byte slaveAddress,
                        byte command)
                 throws Exception
Description copied from interface: ICatalystSmBusService
reads a block of bytes from the SMBus

Specified by:
readBlock in interface ICatalystSmBusService
Parameters:
slaveAddress - the slave address to read from
command - the command to send
Returns:
an array of bytes read from the SMBus
Throws:
Exception - if the read fails

getLastError

public int getLastError()
                 throws Exception
Description copied from interface: ICatalystSmBusService
gets the last error provided by the SMBus native library

Specified by:
getLastError in interface ICatalystSmBusService
Returns:
an int representing the last error provided by the SMBus native library
Throws:
Exception - if there is an error reading the last error

setLastError

public void setLastError(int error)
                  throws Exception
Description copied from interface: ICatalystSmBusService
sets the last error in the SMBus native library

Specified by:
setLastError in interface ICatalystSmBusService
Parameters:
error - the error code to set in the natvie library
Throws:
Exception - if there is an error setting the error code


Copyright © 2013. All Rights Reserved.