Added setSyncDelta method to the library

This commit is contained in:
Luxferre
2022-12-23 17:02:10 +02:00
parent 760ad02672
commit 9a6d2acc31
3 changed files with 7 additions and 5 deletions
+2 -1
View File
@@ -40,7 +40,8 @@ The [library](rcvd.js) can be used "as is" or as a building block for more advan
- `RCVD.connect() -> Promise` - connect to a watch, perform the necessary handshake operations and resolve the Promise on success;
- `RCVD.disconnect()` - disconnect from the currently connected watch's GATT server;
- `RCVD.sync(Date obj?) -> Promise` - perform time synchronization with the **optional** Date object (if it's not passed, actual current local time will be set), running all the required DST/world time setting cycles before setting the actual time;
- `RCVD.getModel() -> String` - return the watch model name obdained during the connection process;
- `RCVD.setSyncDelta(ms)` - update the delta value (in milliseconds) to add to the current time before synchronization to make up for the Bluetooth transmission delay (500 ms by default, can be adjusted according to your host and watch latency);
- `RCVD.getModel() -> String` - return the watch model name obtained during the connection process;
- `RCVD.rawRead(uint8 param1, uint8 param2...) -> Promise(Uint8Array)` - accept variable number of integer parameters and execute the read command on the watch, resolving to the result in a Uint8Array value;
- `RCVD.rawWrite(Uint8Array command) -> Promise` - accept a write command shaped as byte data in Uint8Array and resolve on successful write operation.