react-native-ble-plx: [iOS] Cannot read characteristics after update to 2.0.0
Prerequisites
Please answer the following questions for yourself before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.
- I am running the latest version
- I checked the documentation and found no answer
- I checked to make sure that this issue has not already been filed
Expected Behavior
Read data from device in readeable characteristics.
Current Behavior
What is the current behavior? I have error: Operation was rejected
Steps to Reproduce
The system works properly with the 1.1.0 version. After the update to 2.0.0 this error appear.
Context
Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions. Both JS and platform logs can be enabled via setLogLevel function call.
- Library version: 2.0.0
- Platform: both Android/iOS.
- JS logs:
This is the scenario.
I have a peripheral with 3 services.
To read and write I use the third service. The service has 2 characteristics, the first one is used to write the second is used to read.

After the connection to the device I write in the Write service, and everithing is fine. But when I read from the other characteristics the error “Operation was rejected” appear:

-
Platform logs (logcat/XCode): Flipper This is the log that I see in Verbose mode with Flipper. The problem seems that the characteristic is not recognized as readable.

-
Contents of the
package.jsonfile:
"dependencies": {
"@react-native-community/async-storage": "^1.6.1",
"@react-native-community/masked-view": "^0.1.10",
"@react-navigation/bottom-tabs": "^5.3.3",
"@react-navigation/native": "^5.2.3",
"@react-navigation/stack": "^5.2.18",
"prop-types": "^15.7.2",
"react": "16.11.0",
"react-native": "0.62.2",
"react-native-animatable": "^1.3.3",
"react-native-base64": "^0.0.2",
"react-native-ble-plx": "^2.0.0",
"react-native-connectivity-status": "^1.5.1",
"react-native-dialog-input": "^1.0.7",
"react-native-fs": "^2.16.6",
"react-native-gesture-handler": "^1.6.1",
"react-native-localization": "^2.1.6",
"react-native-orientation": "^3.1.3",
"react-native-reanimated": "^1.8.0",
"react-native-safe-area-context": "^0.7.3",
"react-native-screens": "^2.7.0",
"react-native-share": "^3.3.0",
"react-native-svg": "^9.11.1",
"react-native-svg-charts": "^5.3.0",
"react-native-swipe-list-view": "^2.0.0",
"react-native-swiper": "^1.5.14",
"shortid": "^2.2.14"
},
- Formatted code sample or link to a repository:
console.log('READ - characteristic', this.characteristicR);
const read = await this.characteristicR.read();
const receivedAddress = read.value.charAt(2) + read.value.charAt(3);
console.log('Address Read Sent', sentAddress);
console.log('Address Read Received', receivedAddress, read.value);
In version 1.1.0 everything works fine.
Do you have any suggestion? Thanks in advance, Samuele
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 21 (1 by maintainers)
It’already printed in the last screen of js logs. Just over the error. READ - Characteristic.