BLE client. How to subscribe for multiple notifications? #5352
Replies: 1 comment
-
Posted at 2022-09-14 by Mark_M it looks like async/await is not supported, is it? Posted at 2022-09-15 by @fanoush well, for chaining you can simply continue in same way, before line 23 you can continue like line 12 with another service? Posted at 2022-09-15 by Mark_M Hmm... well, yes, why not.... I'll try. Posted at 2022-11-06 by ThomasVikström I'm in a bit of similar situation, did you get it working? Able to share the code? Posted at 2022-11-06 by ThomasVikström Slight progress as I was able to chain two characteristics, but only the second one showing co2 values is doing something. The first one is supposed to show temperature, but seems it is not reached as I only see co2 values. I've read up on JS promises but haven't found out how to receive and show several values.
Posted at 2022-11-07 by @fanoush
maybe because you commented out line 14 ?
Posted at 2022-11-07 by ThomasVikström Thx, but I've tried that as well. If I uncomment it, I get a message on next line Posted at 2022-11-07 by @fanoush oh, of course you need to add one more
chain between returns like lines 15-19 Posted at 2022-11-07 by ThomasVikström Yes, this works! It makes sense now when I added it and see the whole code.
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2022-09-14 by Mark_M
Hi.
I've created Android app that serves Location and Navigation service, Device info, and Time service (standard GATT profiles). LNS has 3 characteristics.
Currently in Bangle JS2 client app I can subscribe to one service, one characteristic.
How to subscribe for LNS multiple characteristics, and to Time service, and also query Device info? Each .then() has only one return, I am not getting how to fork or chain it.
Beta Was this translation helpful? Give feedback.
All reactions