Get the App
SLTechnology News&Howtos  ›  Development  › 

How to read the binary data values of the eigenvalues of low-power Bluetooth devices in Mini Program development

Shulou Source: shulou.com Published: 2022-06-02 01:07:11 09月28日 Update

This article mainly shows you how to read the binary data values of the eigenvalues of low-power Bluetooth devices in Mini Program development. The content is simple and clear. I hope it can help you solve your doubts. Next, let me take you to study and learn this article, "how to read the binary data values of low-power Bluetooth devices in Mini Program development."

Read the binary data value of the eigenvalue of the low-power Bluetooth device. Note: the eigenvalue of the device must support read before it can be successfully called. For more information, please see the properties attribute of characteristic.

OBJECT parameter description:

Parameter type is required to indicate that deviceIdString is the id of Bluetooth device. Reference device object serviceIdString is Bluetooth eigenvalue corresponding to the service uuidcharacteristicIdString is Bluetooth eigenvalue. If uuidsuccessFunction is successful, return local Bluetooth adapter status failFunction No API call failed callback function completeFunction No API call end callback function (both successful and failed calls will be executed)

Success return parameters:

Parameter type description errCodeNumber error code errMsgString success: ok, error: details

Sample code:

/ / the callback here is required to obtain the wx.onBLECharacteristicValueChange (function (characteristic) {console.log ('characteristic value comed:', characteristic)}) wx.readBLECharacteristicValue ({/ / the deviceId here needs to have established a link with the corresponding device through createBLEConnection [* * new**] deviceId: deviceId, / / the serviceId here needs to obtain serviceId: serviceId in the getBLEDeviceServices API above / / the characteristicId here needs to obtain characteristicId: characteristicId, success: function (res) {console.log ('readBLECharacteristicValue:', res.errCode)}} in the above getBLEDeviceCharacteristics API. What does Mini Program mean? Mini Program is an application that can be used without download or installation. By scanning the QR code or searching it for immediate use, it is easy to operate and easy to spread, and can achieve seven functions such as message notification, offline code scanning, official account association and so on. It is based on Wechat, similar to APP. You can use it whenever you want. After using it, you will leave without taking up memory.

The above is about "how to read the binary data values of eigenvalues of low-power Bluetooth devices in Mini Program development". If this article is helpful to you and think it is well written, please share it with your friends to learn new knowledge. if you want to know more about it, please pay more attention to the industry information channel.

Tags: Bluetooth features eigenvalues devices binaries power consumption data success parameters interfaces routines development content functions programs articles types errors facets learning Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS OPPO Reno Shulou Technology Xiaomi MySQL