com.esf.sbc.catalyst.smbus.service
Interface ICatalystSmBusService


public interface ICatalystSmBusService


Field Summary
static java.lang.String SERVICE_NAME
           
 
Method Summary
 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
 

Field Detail

SERVICE_NAME

public static final java.lang.String SERVICE_NAME
Method Detail

write

public void write(byte slaveAddress,
                  byte command,
                  byte[] data)
           throws java.lang.Exception
writes data to the SMbus

Parameters:
slaveAddress - the slave address to write to
command - the command to write
data - the data to write
Throws:
java.lang.Exception - if the write can not succeed

readByte

public byte readByte(byte slaveAddress,
                     byte command)
              throws java.lang.Exception
reads a byte from the SMBus

Parameters:
slaveAddress - the slave address to read from
command - the command to send
Returns:
the byte read from the SMBus
Throws:
java.lang.Exception - if the read fails

readWord

public short readWord(byte slaveAddress,
                      byte command)
               throws java.lang.Exception
reads a 16 bit word from the SMBus

Parameters:
slaveAddress - the slave address to read from
command - the command to send
Returns:
the word read from the SMBus
Throws:
java.lang.Exception - if the read fails

readBlock

public byte[] readBlock(byte slaveAddress,
                        byte command)
                 throws java.lang.Exception
reads a block of bytes from the SMBus

Parameters:
slaveAddress - the slave address to read from
command - the command to send
Returns:
an array of bytes read from the SMBus
Throws:
java.lang.Exception - if the read fails

getLastError

public int getLastError()
                 throws java.lang.Exception
gets the last error provided by the SMBus native library

Returns:
an int representing the last error provided by the SMBus native library
Throws:
java.lang.Exception - if there is an error reading the last error

setLastError

public void setLastError(int error)
                  throws java.lang.Exception
sets the last error in the SMBus native library

Parameters:
error - the error code to set in the natvie library
Throws:
java.lang.Exception - if there is an error setting the error code


Copyright © 2009 Eurotech Inc. All rights reserved.