Replies: 2 comments 4 replies
-
@BAyotte is this on Android or iOS? |
Beta Was this translation helpful? Give feedback.
4 replies
-
I ran into the same problem and finally, after a lot of trial and error, I ended up filtering the features based on what I needed to do. In my case, I needed to write, so I filtered the ones that had write=true let bleService: BleService[] = await BleClient.getServices(deviceId);
const writableServices = bleService.filter((service) =>
service.characteristics.some(
(characteristic) => characteristic.properties.write === true
)
);
if (writableServices.length > 0) {
//save uuid and use on write call
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I have been trying to communicate with a BLE device in a new app (Android) I am writing. I have communicated with this device without issue with older apps that used https://www.npmjs.com/package/@ionic-native/ble. But when I use this package, when I try to write(), I get an error: "Writing characteristic failed with status code 200.". I have seen other posts that suggest that the combination service / characteristic I am using is not writeable. However, it absolutely is writable as I have done so with other programs and other packages. To be clear I first register for notifications with the service and characteristic below, and then I start writing to it as well. I am able to register for the notifications without any issues. Please let me know if you have any suggestions or ideas as to why this is not working. I can also provide additional information if necessary. Thanks!
More information:
service: "BC2F4CC6-AAEF-4351-9034-D66268E328F0"
characteristic: "06D1E5E7-79AD-4A71-8FAA-373789F7D93C"
Here is the relevant output from getServices():
{
"uuid": "bc2f4cc6-aaef-4351-9034-d66268e328f0",
"characteristics": [
{
"uuid": "06d1e5e7-79ad-4a71-8faa-373789f7d93c",
"properties": {
"broadcast": false,
"read": false,
"writeWithoutResponse": false,
"write": false,
"notify": true,
"indicate": false,
"authenticatedSignedWrites": false,
"extendedProperties": false
},
"descriptors": [
{
"uuid": "00002902-0000-1000-8000-00805f9b34fb"
},
{
"uuid": "00002901-0000-1000-8000-00805f9b34fb"
}
]
},
{
"uuid": "06d1e5e7-79ad-4a71-8faa-373789f7d93c",
"properties": {
"broadcast": false,
"read": false,
"writeWithoutResponse": true,
"write": true,
"notify": false,
"indicate": false,
"authenticatedSignedWrites": false,
"extendedProperties": false
},
"descriptors": [
{
"uuid": "00002901-0000-1000-8000-00805f9b34fb"
}
]
},
{
"uuid": "06d1e5e7-79ad-4a71-8faa-373789f7d93c",
"properties": {
"broadcast": false,
"read": false,
"writeWithoutResponse": false,
"write": false,
"notify": true,
"indicate": false,
"authenticatedSignedWrites": false,
"extendedProperties": false
},
"descriptors": [
{
"uuid": "00002902-0000-1000-8000-00805f9b34fb"
}
]
}
]
}
Beta Was this translation helpful? Give feedback.
All reactions