|
Oracle Java Wireless Client | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.oracle.deviceaccess.spibus.SPIManager
public class SPIManager
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 |
public static SPISlave getSlave(int id) throws java.io.IOException, PeripheralTypeNotSupportedException, PeripheralNotFoundException, PeripheralNotAvailableException
SPISlave
of given id.
id
-
SPISlave
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
public static SPISlave getSlave(java.lang.String name) throws java.io.IOException, PeripheralTypeNotSupportedException, PeripheralNotFoundException, PeripheralNotAvailableException
hint
- hint of slave
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 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |