|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object lejos.nxt.remote.RemoteNXT
public class RemoteNXT
Provides an API similar to the leJOS API for accessing motors, sensors etc. on a remote NXT accessed over Bluetooth using LCP.
Field Summary | |
---|---|
RemoteMotor |
A
|
RemoteMotor |
B
|
RemoteBattery |
Battery
|
RemoteMotor |
C
|
RemoteSensorPort |
S1
|
RemoteSensorPort |
S2
|
RemoteSensorPort |
S3
|
RemoteSensorPort |
S4
|
Constructor Summary | |
---|---|
RemoteNXT(String name,
NXTCommConnector connector)
|
Method Summary | |
---|---|
void |
close()
Close the connection to the remote NXT |
byte |
delete(String fileName)
Delete a file from the NXT. |
byte |
deleteFlashMemory()
Deletes all user programs and data in FLASH memory |
byte[] |
download(String fileName)
Download a file from the remote NXT. |
byte |
download(String fileName,
File destination)
Download a file from the NXT and save it to a file. |
String |
getBluetoothAddress()
Get the bluetooth address of the remote device |
String |
getBrickName()
Get the name of the remote brick |
String |
getCurrentProgramName()
Retrieves the file name of the Lego executable currently running on the NXT. |
String[] |
getFileNames()
Returns a list of all files on NXT brick. |
String[] |
getFileNames(String searchCriteria)
Returns a list of files on NXT brick. |
String |
getFirmwareVersion()
Return the (emulated) Lego firmware version on the remote NXT |
int |
getFlashMemory()
Get the free flash memory on the remote NXT |
String |
getProtocolVersion()
Return LCP protocol version |
byte |
playSoundFile(String fileName)
Plays a sound file on the remote NXT. |
byte |
playSoundFile(String fileName,
boolean repeat)
Plays a sound file on the remote NXT. |
int |
playTone(int frequency,
int duration)
Play a tone on the remote NXT |
byte[] |
receiveMessage(int remoteInbox,
int localInbox,
boolean remove)
Get a message from a remote index to a local inbox |
int |
sendMessage(byte[] message,
int inbox)
Send a message to a remote inbox |
byte |
startProgram(String fileName)
Starts a Lego executable file on the NXT. |
byte |
stopProgram()
Stops the currently running Lego executable on the NXT. |
int |
stopSoundPlayback()
Stops a sound file that has been playing/repeating on the remote NXT. |
byte |
upload(String fileName)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public RemoteMotor A
public RemoteMotor B
public RemoteMotor C
public RemoteBattery Battery
public RemoteSensorPort S1
public RemoteSensorPort S2
public RemoteSensorPort S3
public RemoteSensorPort S4
Constructor Detail |
---|
public RemoteNXT(String name, NXTCommConnector connector) throws IOException
IOException
Method Detail |
---|
public String getBrickName()
public String getBluetoothAddress()
public int getFlashMemory()
public String getFirmwareVersion()
public String getProtocolVersion()
public byte deleteFlashMemory()
public String[] getFileNames(String searchCriteria)
searchCriteria
- "*.*" or [FileName].* or or *.[Extension] or [FileName].[Extension]
public String[] getFileNames()
public byte delete(String fileName)
fileName
-
public byte startProgram(String fileName)
fileName
-
public byte stopProgram()
public String getCurrentProgramName()
public int sendMessage(byte[] message, int inbox)
message
- the messageinbox
- the remote inbox
public byte[] receiveMessage(int remoteInbox, int localInbox, boolean remove)
remoteInbox
- the remote inboxlocalInbox
- the local inboxremove
- true iff the message should be removed from the remote inbox
public int playTone(int frequency, int duration)
frequency
- the frequency of the toneduration
- the duration in milliseconds
public byte playSoundFile(String fileName, boolean repeat)
fileName
- e.g. "Woops.wav"repeat
- true = repeat, false = play once.
public byte playSoundFile(String fileName)
fileName
- e.g. "Woops.wav"
public int stopSoundPlayback()
public void close()
public byte upload(String fileName)
public byte[] download(String fileName)
fileName
- The name of the file on the NXT, including filename extension.
public byte download(String fileName, File destination)
fileName
- destination
- Where the file will be saved.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |