ZTCore
ZTCore
provides methods to work with ZT devices.
“apiKey”, “apiSecret” and “appId” should be set before working with it.
-
-
BLE manager is responsible for finding and connecting to peripherals. It can be subscribed to be notified about its events.
-
SDK settings used in curent session
-
Last command sent to device
-
Last command response from device
-
Last activity id
-
Command status for left module
-
Current connected device
-
Serial number for last device connected
-
Last QR code used to connect
-
Is DFU in progrss
-
Delegate for DFU. It can be used to:
- track progress of DFU process,
- track DFU state ‘finished’, ‘failed’, left module finished DFU, right modeule finished DFU
-
Current DFU state. If state is readyForCopy - shoes can be rebooted to apply new firmware
-
Notify when firmware dfu status is updated If state is readyForCopy - shoes can be rebooted to apply new firmware
-
Notify about firmware upload progress
-
Notify when DFU finished for left side
-
Notify when DFU finished for right side
-
Notify when DFU finished
-
Notify when firmware was copied
-
Setup ZTCore client
- ZTParameters:
- apiKey: api key
- secret: ape secret
- appId: application id
- ZTParameters:
-
Clear user settings and data for current session. This method must be called when user is signed out.
-
Update SDK with organization code
-
Use this method when need to do BLE scanning among several devices and get them. You can inspect the result in completion handler.
-
Use this method when need to stop BLE scanning.
-
Use this method when having QR code and need to connect to certain peripheral. You can inspect the result in completion handler
- ZTParameters:
- viewController: Optional view controller to present from. Default: topmost view controller.
- completion: Optional callback.
- ZTParameters:
-
Register device on ZCloud and get device information
-
Try to reconnect to last saved device WARNING: this method won’t work if you set ZTSettings.shared.autoConnect = false
-
Check if there is connected ZT device You can inspect the result in completion handler.
- ZTParameters:
- completion: Optional callback
- ZTParameters:
-
Initiate background DFU flow
-
Start background DFU using file path
-
Update current firmware if there is new version available
-
Update current firmware from image in file system
-
-
Check if there is activity(s) with stop event and data not sent to ZCloud. It can be used when
ZTSettings.shared.shouldAutoResendData = false
-
Resend all saved embedded activities which were not sent It will send stop event and not sent chunk data for it