react-native-ble-plx | React Native BLE library
kandi X-RAY | react-native-ble-plx Summary
kandi X-RAY | react-native-ble-plx Summary
This is React Native Bluetooth Low Energy library wrapping Multiplatform Ble Adapter.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of react-native-ble-plx
react-native-ble-plx Key Features
react-native-ble-plx Examples and Code Snippets
npm install -g react-native-cli
npm run eject
react-native link react-native-ble-plx
Community Discussions
Trending Discussions on react-native-ble-plx
QUESTION
I am developing an react-native app that gets the weight value of a scale(MI SCALE2) that supports Bluetooth.(I have no knowledge of bluetooth.)
// version
"react-native": "0.66.1",
"react-native-ble-plx": "https://github.com/below/react-native-ble-plx",
I was able to get these values when I got on the scale.
...ANSWER
Answered 2022-Feb-24 at 09:31As far as I understand your Code, your weight scale makes use of Bluetooth Weight Scale Profile and Weight Scale Service. The data you find in the corresponding characteristics needs to be interpreted as described in Personal Health Devices Transcoding
Edit: You can find more information on the data structure here: GATT Specification Supplement 5
example:
Feature([33,0,0,0]) => 0x00000011 => ...00 0010 0001 =>
value description 1 Time Stamp Supported: True 0 Multiple Users Supported: False 0 BMI Supported: False 0100 Weight Measurement Resolution: Resolution of 0.05 kg or 0.1 lb 000 Height Measurement Resolution: Not specifiedWeight = [34, 156, 74, 178, 7, 1, 7, 22, 33, 2] => 0x22 0x9c 0x4a 0xb2 0x07 0x01 0x07 0x16 0x21 0x02
First byte is a flags field => 0x22 => 0010 0010
value description 0 Measurement Units: SI 1 Time Stamp present: True 0 User ID present: False 0 BMI and Height present: False 0010 Reserved for Future UseWeight in kilograms with resolution 0.005 (uint16) => 0x4a9c => 95,5 kg
Time Stamp 0xb2 0x07 0x01 0x07 0x16 0x21 0x02
year(uint16) => 0x07b2 => 1970
month(uint8) => 0x01 => 1
day(uint8) => 0x07 => 7
hours(uint8) => 0x16 => 22
minutes(uint8) => 0x21 => 33
seconds(uint8) => 0x02 => 2
date 1970-01-07T22:33:02
QUESTION
I use react-native-ble-plx in my project to communicante with my tool, and I'm trying to monitor one of its characteristics.
The result is rather long so the monitoringCharacteristic function is looping until it has send me everything, but I don't know how to be sure that the loop is done.
Here is my monitoring function :
...ANSWER
Answered 2022-Feb-14 at 11:17Finally I went around the problem by defining an ending pattern to the info I wanted to send/read via BLE, and then I wrote a loop to continue reading while the ending pattern was not encountered:
QUESTION
Im total noob in RN and Expo. I'v generated new project expo init test
, then cd test
, then npm install --save react-native-ble-plx
and started expo by npm start
.
In my code I added following lines:
ANSWER
Answered 2021-Aug-08 at 16:26QUESTION
My mobile app has functionality to turn on Bluetooth of mobile and show list of Bluetooth devices on the screen. I am using react-native-ble-plx lib for achieving this functionality. I need to turn on BLE of mobile by using react-native-ble-plx lib. Any method is available in that lib for turn on BLE?
...ANSWER
Answered 2021-Jul-05 at 13:19react-native-ble-plx does not have this functionality but you can use react-native-bluetooth-state-manager. It allows you to read the current bluetooth state (enabled/disabled) and open the bluetooth settings page on iOS and android. It is even possible to enable (and disable) bluetooth on android without user interaction but you have to add the BLUETOOTH_ADMIN
permission to you manifest.
But I would suggest you do not activate Bluetooth without user interaction. Simply check the state and show a message like
Bluetooth is required to use this app. Please activate it trough your settings
Only allow the usage of the rest of the app after bluetooth got enabled. A user is probably confused if he deactivated bluetooth and it is suddenly activated.
QUESTION
Hi I need to work with BLE integration using React-native.
I am using this package: https://polidea.github.io/react-native-ble-plx/
I have successfully searched a BLE device now I need to read it's manufacturer data and check for some values
issue: I am getting manufacturer data in string (Base64) format and I converted into byte array with following code.
...ANSWER
Answered 2020-Nov-05 at 07:03Found solution string was base64 ENCODED I have to decode string first then convert to byte array
QUESTION
i used bluetooth low energy in my mobile app with react-native . and i want to just find other mobile devices, so i can't find any other mobile phone and theirs supported bluetooth low-energy , but i find my Smartwatch , well my question is bluetooth low energy can find other mobile phone or is just for Accessory?
and what are you advicing me to find other mobile phone .
my code
...ANSWER
Answered 2020-Oct-26 at 06:20Bluetooth Low Energy (BLE) works different than the "old" Bluetooth (Bluetooth Classic). As soon as you turn on Bluetooth your device is visible for Bluetooth Classic scans, but not for BLE scans.
To find a BLE device it's necessary that the device advertises its present. That's one of the differences between BLE and Bluetooth Classic and allows small accessories to save power. You need to run a GATT Server on your other phone and advertise a service. One very generic tool that would work is nRF Connect.
Please read more about how BLE works.
QUESTION
My goal is to setup my Raspberry Pi 4 to be able to run scripts when a button is clicked in an app I am making with React Native. I need to be able to do it so that they can connect without wifi, which is why I have decided to use Bluetooth.
So far I have an RFCOMM server set up on the Pi, and have installed the react-native-ble-plx module to be able to handle bluetooth communications, but I'm not sure how to get React Native to connect to this server.
I'd really appreciate it if anyone can tell me how to connect them and send data to the Pi to get it to run terminal commands, and return the result.
...ANSWER
Answered 2020-Oct-23 at 22:12There are two types of Bluetooth that are not compatible with each other. RFCOMM and BLE will not work together.
On the Raspberry Pi you need to create a GATT server. RPi uses the BlueZ stack and they have an example in their source tree: https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/test/example-gatt-server
You will also need to have an advertisement so that your phone can find the gatt server. There is also an example of that: https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/test/example-advertisement
Another suggestion is not to try and develop both ends of the Bluetooth link at the same time as that is tricky. Use a generic BLE tool to check you have the server working correctly before you develop the react app.
QUESTION
I am trying to return data from the BlueTooth device after connected because to use the read and write function, need some data.
Example data name, overflowServiceUUIDs, solicitedServiceUUIDs, mtu, rssi...
and many others. Because if I want to read or write I need some attributes. I am using the library react-native-ble-plx
.
After the device connected I lost some values.
Important ...ANSWER
Answered 2020-Oct-04 at 22:35Checking the lib you're using, it creates another device object from the reponse it gets when calling the native module, it could be the case this new object comes with null values on those fields and replaces the values you need. Because it's just as it works by now, you could copy those values to another object before they get erased
QUESTION
I want to send a command to my scooter via polidea ble but I don't know how to compose the package and encode it to base64, I tried different ways but it seems it does not work. Here is the documentation of how I need to make the package:
...ANSWER
Answered 2020-Sep-04 at 07:08My understanding of the documentation you have included, is that to turn on the light the code to create the packet in base64 would be:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install react-native-ble-plx
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page