|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface I2CDatagramConnection
This interface defines an I2C serial datagram connection.
A URI (Uniform Resource Identifier) with the below parameters is used to open an I2C connection.
The scheme must be as follows:
"i2c://"<bus_id>:[<device_address>][<bus_mode>][<data_rate>]
Any parameters must be separated by a semi-colon (;), spaces are not allowed in the string.
Only one I2CDatagramConnection may be opened for each bus identifier.
A java.io.IOException is thrown when trying to open 2nd I2CDatagramConection with the same bus identifier.
Legal parameters are defined below.
Illegal or unrecognized parameters result with an IllegalArgumentException
.
If the value of a parameter is supported by the device, it must be honored.
If the value of a parameter is not supported a java.io.IOException
is thrown.
The URI must conform to the BNF syntax specified below. If the URI
does not conform to this syntax, an IllegalArgumentException
is thrown.
<i2c_datagram_connection_string> | ::= "i2c://"<bus_id>:[<device_address>][<bus_mode>][<data_rate>] |
<bus_id> | ::= The bus identifier name. Use System.getProperty("microedition.i2cbusids") to get available i2c buses.
|
<device_address> | ::= The device address in Hexadecimal representation. To be use in slave mode. |
<bus_mode> | ::= ;bus_mode=<bus_mode_value> |
<bus_mode_value> | ::= "singleMaster" |"multiMaster" | "slave" |
<data_rate> | ::= ;data_rate=<data_rate_value> |
<data_rate_value> | ::= "standard" | "fast" | "high" |
IOException
.The URI must conform to the BNF syntax specified below. Otherwise, an IllegalArgumentException is thrown.
<new_datagram_address_string> | ::= "i2c://"[<device_address>]:[<register_address>] |
<device_address> | ::= address of the remote device in hexadecimal representation respective to the remote device address type |
<register_address> | ::= address of the register in hexadecimal representation respective to the register address length |
Field Summary | |
---|---|
static int |
DATA_RATE_FAST
Specifies a fast data rate - up to 400Kbits/sec. |
static int |
DATA_RATE_HIGH
Specifies a high data rate - up to 3.4Mbits/sec. |
static int |
DATA_RATE_STANDARD
Specifies a standard data rate - up to 100Kbits/sec. |
static int |
MODE_MULTI_MASTER
Specifies an I2C multi master mode. |
static int |
MODE_SINGLE_MASTER
Specifies an I2C single master mode. |
static int |
MODE_SLAVE
Specifies an I2C slave mode. |
Method Summary | |
---|---|
void |
allSlavesReaddress()
Sends a general call address message to all slaves with a request to re-address. |
void |
allSlavesResetAndReaddress()
Sends a general call address message to all slaves with a request to reset and re-address. |
int |
getDataRate()
Gets the I2CDatagramConnection data rate. |
int |
getMode()
Gets the I2CDatagramConnection mode. |
Methods inherited from interface javax.microedition.io.DatagramConnection |
---|
getMaximumLength, getNominalLength, newDatagram, newDatagram, newDatagram, newDatagram, receive, send |
Methods inherited from interface javax.microedition.io.Connection |
---|
close |
Field Detail |
---|
static final int MODE_SINGLE_MASTER
static final int MODE_MULTI_MASTER
static final int MODE_SLAVE
static final int DATA_RATE_STANDARD
static final int DATA_RATE_FAST
static final int DATA_RATE_HIGH
Method Detail |
---|
int getMode()
MODE_SINGLE_MASTER
,MODE_MULTI_MASTER
,MODE_SLAVE
.int getDataRate()
DATA_RATE_STANDARD
,DATA_RATE_FAST
,DATA_RATE_HIGH
.void allSlavesReaddress() throws java.io.IOException
java.io.IOException
- Failed sending all slaves a re-address broadcast message.void allSlavesResetAndReaddress() throws java.io.IOException
java.io.IOException
- Failed sending all slaves a reset and re-address broadcast message.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |