QNScaleDataListener
Data listener, related measurement data is called back here
Method
onGetUnsteadyWeight
Received the real-time weight uploaded by the scale, which can be used to synchronously display the value on the scale
Parameters
| name | Types of | Explanation |
|---|---|---|
| device | QNBleDevice | Device for uploading real-time data. |
| weight | double | When the APP is connected for measurement, the value on the scale changes, and the APP will have a synchronous data callback, which is only displayed in the UI, not saved as the last data. |
onGetScaleData
The real-time stable measurement data is obtained. When the APP is connected and the measurement is performed, the data will enter this callback
Parameters
| name | Types of | Explanation |
|---|---|---|
| device | QNBleDevice | The device that uploaded the data. |
| data | QNScaleData | Yolanda measurement data, including weight, BMI、Data such as body fat percentage. |
onGetStoredScale
Obtained storage data, this kind of data is that when the user does not connect to the APP when measuring, the data will be stored to the scale side, and then when the next time is connected, the scale will upload the stored data to the APP, and then will enter this Callback.
Parameters
| name | Types of | Explanation |
|---|---|---|
| device | QNBleDevice | The device that uploaded the data. |
| storedDataList | List<QNScaleStoreData> | Storage data list, the old scale can store at most 20 data, the new one can store 40 data. QNScaleStoreData can generate QNScaleData by passing in user data (that is, QNUser) |
onGetElectric
Get battery
Currently only supports charging scales. When the battery is less than 20%When the power is low
| name | Types of | Explanation |
|---|---|---|
| device | QNBleDevice | The device that uploaded the data. |
| electric | int | Power unit% |
onScaleStateChange
Method callback after measuring state change, this method is not a callback for Bluetooth connection status
Parameters
| name | Types of | Explanation |
|---|---|---|
| device | QNBleDevice | Bluetooth device object |
| scaleState | int | Refer to Scale Status Code |
onScaleEventChange
Callback for scale events
Parameters
| name | Types of | Explanation |
|---|---|---|
| device | QNBleDevice | Bluetooth device object |
| scaleEvent | int | Refer to Scale Events |
readSnComplete
get sn code of device
Parameters
| name | Types of | Explanation |
|---|---|---|
| device | QNBleDevice | Bluetooth device object |
| sn | string | SN code |
onGetBarCode
Called when a barcode is successfully obtained.
Parameters
| Name | Type | Description |
|---|---|---|
| barCode | String | The barcode |
| mac | String | The device MAC address |
onGetBarCodeFail
Called when obtaining a barcode fails.
Parameters
| Name | Type | Description |
|---|---|---|
| mac | String | The device MAC address |
onGetBarCodeGunState
Called to obtain the connection state of the barcode scanner gun.
Parameters
| Name | Type | Description |
|---|---|---|
| state | bool | Whether it is connected (or installed) |
| mac | String | The device MAC address |
onSetHeightScaleConfigState
Callback for the setting status of height scale hardware information (details about whether each item was set successfully)
Parameters
| Name | Type | Description |
|---|---|---|
| isLanguageSuccess | bool | true: Language setting for normal voice succeeded; false: failed |
| isWeightUnitSuccess | bool | true: Weight unit setting succeeded; false: failed |
| isHeightUnitSuccess | bool | true: Height unit setting succeeded; false: failed |
| isVolumeSuccess | bool | true: Volume setting succeeded; false: failed |
| device | QNBleDevice | The current device |
onGetHeightScaleConfig
Callback for obtaining the current height scale hardware information
Parameters
| Name | Type | Description |
|---|---|---|
| function | QNHeightDeviceFunction | Current height scale hardware function info |
| device | QNBleDevice | The current device |
onResetHeightScaleState
Callback indicating whether the height scale factory reset succeeded
Parameters
| Name | Type | Description |
|---|---|---|
| state | bool | true: Success; false: Failed |
| device | QNBleDevice | The current device |
onClearHeightScaleWifiConfigState
Callback indicating whether clearing the height scale WiFi configuration succeeded
Parameters
| Name | Type | Description |
|---|---|---|
| state | bool | true: Success; false: Failed |
| device | QNBleDevice | The current device |
onGetHeightScaleWifiConfig
Callback for obtaining the height scale WiFi configuration (only returns the ssid information)
Parameters
| Name | Type | Description |
|---|---|---|
| state | bool | true: Obtained successfully; false: Failed |
| ssid | string | WiFi ssid |
| device | QNBleDevice | The current device |
onScanHeightScaleWifiSsidResult
Callback when scanning available WiFi names of the height scale
Parameters
| Name | Type | Description |
|---|---|---|
| ssids | string | Available WiFi name (one callback per found WiFi, …) |
| rssi | int | WiFi signal strength (value) |
| device | QNBleDevice | The current device |
onScanHeightScaleWifiSsidFinish
Callback when scanning available WiFi of the height scale finishes
Parameters
| Name | Type | Description |
|---|---|---|
| state | int | 0: Scan failed (will not continue scanning); 2: WiFi scan completed; |
| device | QNBleDevice | The current device |