public class UsbConnection extends Object
Modifier and Type | Class and Description |
---|---|
static class |
UsbConnection.DeviceType
Enum defining the device type
|
Modifier and Type | Field and Description |
---|---|
static int |
VARIABLE_LENGTH |
Constructor and Description |
---|
UsbConnection()
The constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
connect()
Try to connect to a TomTom Watch.
|
void |
disconnect()
Disconnects from the TTWatch
|
String |
getDeviceSerialNumber()
Returns the serial number of the device as string.
|
int |
getFileReadChunkSize()
Returns the maximum chunk size when reading files.
|
int |
getFileWriteChunkSize()
Returns the maximum chunk size when writing files
|
String |
getLastError()
Get a description of the last error.
|
boolean |
isError()
Indicates the result of last method
|
void |
sendRequest(byte msg,
UsbPacket txData,
UsbPacket rxData,
byte expectedRxMsg,
int expectedRxLength)
This message synchronously sends a requests and waits for the response.
|
public static final int VARIABLE_LENGTH
public void connect()
public void disconnect()
public void sendRequest(byte msg, UsbPacket txData, UsbPacket rxData, byte expectedRxMsg, int expectedRxLength)
msg
- The request message typetxData
- The data to sendrxData
- The response dataexpectedRxMsg
- Expected response ID, usually equal to the request ID. Exception is msg=MSG_READ_FILE_DATA_REQUEST,
in this case the response is MSG_READ_FILE_DATA_RESPONSEexpectedRxLength
- Expected response length.public boolean isError()
public String getLastError()
public int getFileReadChunkSize()
public int getFileWriteChunkSize()
public String getDeviceSerialNumber()
Copyright © 2023. All rights reserved.