|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sentilla.system.DriverAdapter
com.sentilla.net.RemotePropertyDriver
com.sentilla.platform.cmote.RemotePropertyDriver
public class RemotePropertyDriver
An implementation of RemotePropertyDriver that supports open and create.
To access remote properties, use this driver to obtain a RandomAccessFile. You specify a target Addressable and a string key to obtain the RandomAccessFile. Most read and write operations are supported.
Each read and write initiates a network action with a resource-constrained target mote. Ensure that the sum of the read/write length and the number of bytes in the property key does not exceed 32 bytes. For example:
byte[] buff = new byte[27]; openProperty("mykey").write(buff); // OK
Be careful to ensure that the remote target is not simultaneously modifying the property.
remove
is not supported at this time.
Field Summary |
---|
Fields inherited from class com.sentilla.system.DriverAdapter |
---|
m_nextDriver |
Constructor Summary | |
---|---|
RemotePropertyDriver()
|
Method Summary | |
---|---|
RandomAccessFile |
createProperty(Addressable target,
String key,
int maxlength)
Creates (and opens) remote property. |
String |
getDriverName(int n)
Returns the valid name(s) for each driver. |
RandomAccessFile |
openProperty(Addressable target,
String key)
Opens a remote property if it exists. |
void |
removeProperty(Addressable target,
String key)
Removes a specific remote property (not currently supported). |
void |
resetProperties(Addressable target)
Removes all user keys and restores all system keys to default values. |
Methods inherited from class com.sentilla.net.RemotePropertyDriver |
---|
create, open, register, remove, reset |
Methods inherited from class com.sentilla.system.DriverAdapter |
---|
getNextDriver, setNextDriver |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RemotePropertyDriver()
Method Detail |
---|
public RandomAccessFile openProperty(Addressable target, String key)
openProperty
in class RemotePropertyDriver
target
- from whom property is to be opened.key
- the key to access
IORuntimeException
- if open fails.public RandomAccessFile createProperty(Addressable target, String key, int maxlength)
createProperty
in class RemotePropertyDriver
target
- at which property is to be created.key
- the key to accessmaxlength
- number of bytes to reserve for this property
IORuntimeException
- if create fails.public void removeProperty(Addressable target, String key)
removeProperty
in class RemotePropertyDriver
target
- from whom property should be deletedkey
- the key to access
IORuntimeException
- if remove fails.public void resetProperties(Addressable target)
resetProperties
in class RemotePropertyDriver
target
- from whom property should be deleted
IORuntimeException
- if remove fails.public String getDriverName(int n)
DriverAdapter
getDriverName
returns a
string for n=0 to n=N-1, and returns null for all other values of n.
A driver may return multiple names because it provides the default implementation for a specific name, such as associating "flash" by default to the external flash, or "extflash" if an application specifically asserts it requires the external flash resources. Some drivers may return only a single valid name, such as "intflash" for the internal flash.
getDriverName
in interface Driver
getDriverName
in class DriverAdapter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |