Mds class

Constructors

Mds()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

connect(String address, void onConnected(String), void onDisconnected(), void onConnectionError(String)) → void
Try to connect to a Movesense device with the given address. Address is Bluetooth MAC address for Android devices and UUID for iOS devices. When connection is established, onConnected is called with the device serial. onDisconnected is called when device disconnects. onConnectionError is called when an error occurs during connection attempt.
createRequestUri(String serial, String resource) String
createSubscriptionUri(String serial, String resource) String
del(String uri, String contract, void onSuccess(String, int), void onError(String, int)) → void
Make a DEL request for a resource. uri must include "suunto://" prefix and device serial if needed. contract must be a json string. If the request is successful, onSuccess is called with response data in json string format, and status code. Upon error, onError is called with reason and status code.
disconnect(String address) → void
Disconnect from the device with the given address.
get(String uri, String contract, void onSuccess(String, int), void onError(String, int)) → void
Make a GET request for a resource. uri must include "suunto://" prefix and device serial if needed. contract must be a json string. If the request is successful, onSuccess is called with response data in json string format, and status code. Upon error, onError is called with reason and status code.
post(String uri, String contract, void onSuccess(String, int), void onError(String, int)) → void
Make a POST request for a resource. uri must include "suunto://" prefix and device serial if needed. contract must be a json string. If the request is successful, onSuccess is called with response data in json string format, and status code. Upon error, onError is called with reason and status code.
put(String uri, String contract, void onSuccess(String, int), void onError(String, int)) → void
Make a PUT request for a resource. uri must include "suunto://" prefix and device serial if needed. contract must be a json string. If the request is successful, onSuccess is called with response data in json string format, and status code. Upon error, onError is called with reason and status code.
startScan(void onNewDeviceFound(String?, String?)) → void
Starts scanning for Movesense devices. When a new Movesense device is found, onNewDeviceFound is called with device name and address. Android devices will get the Bluetooth MAC address of the sensor, where iOS devices will get UUID as the address parameter. Scanning is terminated automatically after 60 seconds. Only devices with Movesense services are returned.
stopScan() → void
Stops the ongoing scan.
subscribe(String uri, String contract, void onSuccess(String, int), void onError(String, int), void onNotification(String), void onSubscriptionError(String, int)) int
Make a SUBSCRIPTION request for a resource. uri must include "suunto://" prefix and device serial if needed. contract must be a json string. If the request is successful, onSuccess is called with response data in json string format, and status code. Upon error, onError is called with reason and status code. When there is a notification, onNotification is called with notification data, which is in json string format. onSubscriptionError is called when an error occurs with subscription, with reason and error status code.
unsubscribe(int subscriptionId) → void
Unsubscribe from the subscription with the given subscriptionId.