Oracle Java Wireless Client

com.oracle.deviceaccess.spibus
Class SPIManager

java.lang.Object
  extended by com.oracle.deviceaccess.spibus.SPIManager

public class SPIManager
extends java.lang.Object

Class for SPIManager management In order to communicate with specific slave. application should acquire SPISlave instance of slave that application will exchange data to/from.

 int slaveId = 3;
 SPISlave slave = SPIManager.getSlave(slaveId);
 
 
 
Application should then send/receive data by using exchange() method of SPISlave class. When data transfer is over, application should call release() method to release SPIManager slave.
 slave.exchange(sndBuf,1,rcvBuf,0);
 slave.release();
 
 

Because SPIManager protocol use separated rx/tx line. read and write operation is handled simultaneously. that's why exchange() method needs both rx buffer and tx buffer.


Method Summary
static SPISlave getSlave(int id)
          get SPISlave of given id.
static SPISlave getSlave(java.lang.String name)
          get SPISlave instance by given name.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getSlave

public static SPISlave getSlave(int id)
                         throws java.io.IOException,
                                PeripheralTypeNotSupportedException,
                                PeripheralNotFoundException,
                                PeripheralNotAvailableException
get SPISlave of given id.

Parameters:
id -
Returns:
SPISlave
Throws:
java.io.IOException - if the device has any problem to be used.
PeripheralTypeNotSupportedException - would be thrown if the device is not supported.
java.lang.SecurityException - Application has no permission to access peripheral.
PeripheralNotFoundException
PeripheralNotAvailableException

getSlave

public static SPISlave getSlave(java.lang.String name)
                         throws java.io.IOException,
                                PeripheralTypeNotSupportedException,
                                PeripheralNotFoundException,
                                PeripheralNotAvailableException
get SPISlave instance by given name.

Parameters:
hint - hint of slave
Returns:
SPISlave
Throws:
java.io.IOException - if the device has any problem to be used.
PeripheralTypeNotSupportedException - would be thrown if the device is not supported.
java.lang.SecurityException - Application has no permission to access peripheral.
PeripheralNotFoundException
PeripheralNotAvailableException

Oracle Java Wireless Client

Copyright (c) 1990, 2012, Oracle and/or its affiliates. All rights reserved.