public class UsbInterface extends WatchInterface
Modifier and Type | Class and Description |
---|---|
static class |
UsbInterface.FileMode |
WatchInterface.FileType
FILEID_BLE_FIRMWARE, FILEID_BLE_UPDATE_LOG, FILEID_GPS_FIRMWARE, FILEID_GPSQUICKFIX_DATA, FILEID_INVALID, FILEID_LOG, FILEID_MANIFEST1, FILEID_MANIFEST2, FILEID_PLAYLIST, FILEID_PREFERENCES_XML, FILEID_SYSTEM_FIRMWARE, FILEID_UPDATE_LOG, fileList, listener, preferenceFile, PRODUCTID_UNKNOWN, TTWATCH_FILE_TYPE_MASK
Constructor and Description |
---|
UsbInterface(UsbConnection usbConnection)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
closeConnection()
Closes the USB connection
|
boolean |
deleteFile(UsbFile file)
Deletes the file on the watch indicated by the ID in the file
passed.
|
boolean |
fileExists(int fileId)
This method checks if a file exists
|
boolean |
formatDevice()
This method formats the device
|
String |
getDeviceSerialNumber()
Returns the serial number of the device.
|
ArrayList<UsbFile> |
getFileList(WatchInterface.FileType fileType)
This method requests the list of file of given type
|
int |
getProductId()
This method returns the firmware version
|
hirondelle.date4j.DateTime |
getWatchTime()
This method retrieves the time from the watch.
|
boolean |
openConnection()
Opens the USB connection
|
String |
readBleVersion()
This method returns the BLE version
|
boolean |
readFile(UsbFile file)
This method reads the file with file ID defined in the file
instance passed from the watch
|
String |
readFirmwareVersion()
This method returns the firmware version
|
boolean |
resetDevice()
Execute device reset
|
boolean |
resetGpsProcessor()
Resets the GPS processor
|
boolean |
sendMessageGroup1()
Another message sequence reported by ttwatch
|
boolean |
sendStartupSequence()
According to ttwatch (Ryan Binns) this is the sequence that should be
called after opening the watch connection
|
boolean |
writeFile(UsbFile file)
Write file to the watch.
|
getPreference, isFileType, readPreferences, setPreference, setProgressListener, writeGpxQuickFixFile, writePreferences, writeVerifyFile
public UsbInterface(UsbConnection usbConnection)
usbConnection
- The USB connection to usepublic boolean openConnection()
openConnection
in class WatchInterface
public void closeConnection()
closeConnection
in class WatchInterface
public boolean sendStartupSequence()
sendStartupSequence
in class WatchInterface
public boolean sendMessageGroup1()
sendMessageGroup1
in class WatchInterface
public boolean fileExists(int fileId)
WatchInterface
fileExists
in class WatchInterface
fileId
- Id of the file to checkpublic boolean readFile(UsbFile file)
readFile
in class WatchInterface
file
- File defining the file ID. The file data is read into
this file instancepublic boolean writeFile(UsbFile file)
writeFile
in class WatchInterface
file
- The file to writepublic boolean deleteFile(UsbFile file)
deleteFile
in class WatchInterface
file
- File defining the file ID to deletepublic ArrayList<UsbFile> getFileList(WatchInterface.FileType fileType)
getFileList
in class WatchInterface
fileType
- The type of files to requestpublic hirondelle.date4j.DateTime getWatchTime()
getWatchTime
in class WatchInterface
public String readBleVersion()
readBleVersion
in class WatchInterface
public String readFirmwareVersion()
readFirmwareVersion
in class WatchInterface
public int getProductId()
getProductId
in class WatchInterface
public String getDeviceSerialNumber()
getDeviceSerialNumber
in class WatchInterface
public boolean resetDevice()
resetDevice
in class WatchInterface
public boolean resetGpsProcessor()
resetGpsProcessor
in class WatchInterface
public boolean formatDevice()
formatDevice
in class WatchInterface
Copyright © 2023. All rights reserved.