QNConfig
SDK configuration object, which controls the scanning behavior, and sets some SDK behaviors through it
Attributes
name | Types of | Explanation |
---|---|---|
onlyScreenOn | Boolean | Whether to return only the devices that have been turned on (bright screen), the default is false, that is, return to the scale that is turned on and not turned on. |
allowDuplicates | Boolean | Whether the same device returns multiple times, in general, the device will always send Bluetooth broadcasts, the system will call back to the same device multiple times during scanning, and the SDK will process the same device, so that during a scan, one device will only return Once, the merchant can set this parameter, and the SDK returns directly every time. Default false (this field is invalid for onBroadcastDeviceDiscover-monitoring) |
duration | int | Scan duration, unit ms, the default is 0, that is to scan, unless the APP calls stopBleDeviceDiscovery. When it is not 0, the minimum value is 3000ms, the scan will be stopped automatically after a delay of duration ms. (If you have access to a broadcast scale, you need to pay attention to the setting of this field, see Working Principle of Broadcast Scale) |
connectOutTime | long | (Only for Android) The limited time to connect the device, the unit is ms, the default is 10000, that is, within 10 seconds of starting the connection, if the entire connection process cannot be completed, the connection will be stopped and callback error;When the set value is less than or equal to 0, it means no callback;When the set value is less than 3000 and greater than 0, it means that the timeout period is 3000ms. If the connection has been stopped before the connection times out, even if the device is not successfully connected during the period, there will be no error callback. |
unit | int | 0 is kg, the default value 1 is lb, pound, all scales can support this unit 2 is kg. If the scale does not support it, kg will be displayed 3 is st, British stone, if the scale end does not support, it will display the value of lb, |
setNotCheckGPS | bool | (Android only) The default is false. When it is true, the SDK will not judge GPS permission when scanning, and continue to perform scanning |
enhanceBleBoradcast | bool | Whether it is necessary to start the enhanced broadcast scale signal during scanning (invalid for ordinary scales, this option is only for broadcast scales) |
unit
The unit displayed on the terminal, if not set, the SDK defaults to kg. After setting, it will be saved locally. If there is currently a connected device, the unit display on the scale will be updated in real time as much as possible.
The SDK will always return the value of kg. APP needs to convert values by itself.
Method
save
Save modified settings
Parameters
name | Types of | Explanation |
---|---|---|
callback | QNResultCallback | Returns whether the setting operation is successful |