{IDO Device Binding Interface Description}
1. Function Overview
Provides the ability to check binding status, initiate binding and unbinding, and listen for binding mode.
2. Interface Capability
1. Check Binding Status:
1.1 Function Summary:
None
1.2 API ID:
Future<bool> get isBinded;
1.3 API Parameter Description:
@return: isBinded - Binding status flag, bool type, false: not bound, true: bound.
2. Check if Currently in Binding Mode:
2.1 Function Summary:
In binding mode, switching devices will be restricted.
2.2 API ID:
bool get isBinding;
2.3 API Parameter Description:
@return: isBinding - Flag indicating whether in binding mode, bool type, false: not in binding mode, true: in binding mode.
3. Initiate Binding:
3.1 Function Summary:
Initiates the binding process. After successful binding, the device information and function table information of the device are returned via a callback. ////TODO
3.2 API ID:
/// Initiate binding
/// osVersion: System version (take the major version number)
Stream<BindStatus> startBind(
{required int osVersion,
required BindValueCallback<IDODeviceInfo> deviceInfo,
required BindValueCallback<IDOFunctionTable> functionTable});
3.3 API Parameter Description:
@param: osVersion - System version, take the major version number.
@param: deviceInfo - Callback for device information after binding is initiated.
@param: functionTable - Callback for function table information of the device after binding is initiated. ////TODO
4. Initiate Unbinding:
4.1 Function Summary:
Initiates the unbinding process for the specified MAC address. The device can be forcefully unbound.
4.2 API ID:
Future<bool> unbind({required String macAddress, bool isForceRemove = false});
4.3 API Parameter Description:
@param: macAddress - MAC address.
@param: isForceRemove - Whether to forcefully unbind the device, even if the device does not respond. Set to true to forcefully unbind and remove the device. Default is false.
5. Initiate Authorization Code Binding:
5.1 Function Summary:
None
5.2 API ID:
Stream<bool> setAuthCode(String code, int osVersion);
5.3 API Parameter Description:
@param: code - Pairing code.
@param: osVersion - System version (take the major version number).
6. Register Update Mode Monitoring Callback:
6.1 Function Summary:
Registers a callback method for monitoring the current update mode. ////TODO
6.2 API ID:
StreamSubscription listenUpdateSetModeNotification(
void Function(int mode) func);
6.3 API Parameter Description:
@param: func - Callback method. The mode includes: 0 None Binding, 1 Already Binding, 2 Firmware Upgrade Mode, 3 Reconnection, 4 Realtek