manekinekko / angular-web-bluetooth

The missing Web Bluetooth module for Angular
https://manekinekko.github.io/angular-web-bluetooth/
MIT License
196 stars 59 forks source link

Performance improvement #77

Open wbrett opened 3 years ago

wbrett commented 3 years ago

Is your feature request related to a problem? Please describe. We are seeing very slow response times using the library to write to a NUS serial service tx characteristic. For example, using python with the bleak BLE library we are seeing around 7-10ms response times. For the same request using angular-web-bluetooth library we are seeing on average 300 - 400ms response times. Our application requires many requests to load data from our devices so we would love to see similar performance to the python script.

Describe the solution you'd like An improvement in the amount of time for the write subscription to return. Here is an example of a request we are making: this.bluetooth.writeValue$(this.feritConnection.rx, slice) .subscribe(() => { console.log("This on average takes around 300 - 400ms to return");};

Additional context Cleaner screenshot of code we are using to write to the NUS serial service tx characteristic:

angularBluetoothWriteRequestCode

Definition of the NUS serial service: nusSerialSerrvice

ArctoosR commented 1 year ago

any follow up on this?

manekinekko commented 1 year ago

@wbrett Thank you for reporting the performance issue. However, I cannot reproduce the issue because I don't have to the hardware/service. I will leave this question open in case someone can help/suggest a fix.