QNBleBroadcastDevice
Yolanda Broadcast Scale Bluetooth Device Object
The broadcast scale is a device that does not need to be connected and obtains relevant data through the broadcast sent by the receiving device. The scale is different from the ordinary Bluetooth scale, the difference is that when the ordinary Bluetooth scale scans the surrounding device information, it can initiate a connection to a surrounding device, so you can choose whether to stop scanning the surrounding device information without affecting the connected device To obtain relevant measurement information.
However, because the broadcast scale obtains the broadcast data of the surrounding devices and then analyzes the related measurement information, there is no need to connect a certain device. Therefore, if the scanning of the surrounding equipment is stopped during the measurement process using the broadcast scale, it means that the measurement data of this time cannot be obtained.
Attributes
name | Types of | Explanation |
---|---|---|
mac | String | The MAC address and SDK will be parsed according to the scanned broadcast information. On the same device, Android and IOS will return the same result. Unique for each device |
name | String | The model name, the SDK will identify the scanned device model, if it cannot be identified, it will return a default model name, Scale |
modeId | String | Model identification |
bluetoothName | String | Bluetooth name, this is the broadcast name of the hardware device, different from name. APP is based on name. |
RSSI | int | The signal strength is a negative number, generally between -30 and -100. The larger the value, the greater the signal strength. The same device may be recalled multiple times. Each time the callback is performed, the signal strength value may be different. |
supportUnitChange | boolean | Whether to support the protocol to modify the scale unit |
unit | int | The unit currently displayed on the scale 0 is kg, the default value 1 to lb 2 kg |
weight | double | The weight value currently displayed on the scale body |
isComplete | boolean | Whether the measurement is completed |
measureCode | int | After the measurement is completed, the data is encoded. After the measurement is completed, multiple pieces of the same broadcast data may be received, so this field is used to distinguish whether the multiple pieces of measurement completion data received in the adjacent time are the same measurement data |
Method
generateScaleData
When the isComplete field is true, you can call this method to obtain related measurement data
Obtain measurement data
Parameters
name | Types of | Explanation |
---|---|---|
user | QNUser | User object |
callback | QNResultCallback | Returns whether the method call is successful |
return value
Type: QNScaleData
Yolanda measurement data, including weight, BMI、Data such as body fat percentage.
syncUnit
When the device supportUnitChange field is true, it indicates that the device is allowed to be modified by agreement, then this method can be used to modify the unit
When the method is successfully called, the SDK will send out a Bluetooth broadcast signal. When the target device's unit has been modified or 10s, the SDK will stop broadcasting.
After this method is called, the operation of the previously synchronized unit will be canceled, for example, the unit of the A device is being synchronized. When synchronizing the unit of the B device, the SDK will first cancel the synchronization of the A unit and then start the unit synchronization of the B device.
The unit is the unit set in QNConfig
Parameters
name | Types of | Explanation |
---|---|---|
callback | QNResultCallback | Returns whether the method call is successful |