Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70817

ble.startNotification not working

$
0
0

Hi, any help would be greatly appreciated. I am also willing to pay for a screen share session with someone who is familiar with this bluetooth library.

ble.startNotification not working for me :frowning:

I am using this library: import { BLE } from ‘@awesome-cordova-plugins/ble/ngx’;

I am able to connect to my bluetooth remote and to get back device info. But the startNotification call never seems to run. I am using current angular and ionic versions. I am trying to listen to button clicks on the remote. I am not sure what values to use for the service and characteristic that would correspond to one of the buttons on my bluetooth remote, the two values listed in the startNotification call are my best guess.

this.ble.connect(this.deviceId).subscribe(results => {

this.tempOutput = ‘connected to remote’; // this works

this.ble.startNotification(this.deviceId, ‘1812’, ‘2a4e’).subscribe(buffer => {
this.tempOutput = ‘subscribe’; // this does NOT work
});

});

I have tried various methods of formatting what startNotification returns but nothing comes back:
// this.tempOutput = String.fromCharCode.apply(null, new Uint8Array(buffer));

Here is the device output from the connect function:

{
“name”: “AB Shutter3”,
“id”: “2A:07:98:10:40:05”,
“services”: [
“1801”,
“1800”,
“180a”,
“1812”,
“180f”
],
“characteristics”: [
{
“service”: “1801”,
“characteristic”: “2a05”,
“properties”: [
“Indicate”
],
“descriptors”: [
{
“uuid”: “2902”
}
]
},
{
“service”: “1800”,
“characteristic”: “2a00”,
“properties”: [
“Read”
]
},
{
“service”: “1800”,
“characteristic”: “2a01”,
“properties”: [
“Read”
]
},
{
“service”: “1800”,
“characteristic”: “2a04”,
“properties”: [
“Read”
]
},
{
“service”: “180a”,
“characteristic”: “2a50”,
“properties”: [
“Read”
]
},
{
“service”: “1812”,
“characteristic”: “2a4e”,
“properties”: [
“Read”,
“WriteWithoutResponse”
]
},
{
“service”: “1812”,
“characteristic”: “2a4d”,
“properties”: [
“Read”,
“Notify”
],
“descriptors”: [
{
“uuid”: “2902”
},
{
“uuid”: “2908”
}
]
},
{
“service”: “1812”,
“characteristic”: “2a4d”,
“properties”: [
“Read”,
“Notify”
],
“descriptors”: [
{
“uuid”: “2902”
},
{
“uuid”: “2908”
}
]
},
{
“service”: “1812”,
“characteristic”: “2a4b”,
“properties”: [
“Read”
]
},
{
“service”: “1812”,
“characteristic”: “2a4a”,
“properties”: [
“Read”
]
},
{
“service”: “1812”,
“characteristic”: “2a4c”,
“properties”: [
“WriteWithoutResponse”
]
},
{
“service”: “180f”,
“characteristic”: “2a19”,
“properties”: [
“Read”,
“Notify”
],
“descriptors”: [
{
“uuid”: “2902”
}
]
}
]
}

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 70817

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>