-
I would like to update a value of a BLE service and therefore send a notification with acknowledgement (using indicate). The server sends the notification to the client. After the notification is successfully received by the client it should send a confirmation message back to the server which acknowledges the successful communication.
Is there already implemented a callback to handle the received acknowledgement so that the server knows that the notification was successfully transmitted to the client? I have not found something in the references. Do you have a API with all callbacks?
Kind regards
-
-
@Gordon I tried now an Inline-Comment in a function which is called inside OnInit. If I use a letter like ä,ö or ü, it throws an Syntax error. This seems to be a bug.
-
-
-
-
-
-
-
-
-
-
Hello, I tried to transmit the battery level of a puck using NRF.setServices.
My source code is the following:NRF.setServices({ 0x180F : { 0x2A19 : { readable : true, notify: true, value: [ Puck.getBatteryPercentage() ] }
This morning the battery level was 58%, a few hours later it was 64% (using NRF Connect App). How could this happen and how can I get the real battery level?
Kind regards
-
-
Thank you for your help. I have tried to connect the smartphone with the Puck. The Puck sets a service and updates it on a click. The NRF Connect app shows the data. Everything works fine. Now I would like to send data from the smartphone (central), which is connected, to the puck (peripheral).
Are there functions to do this or is it only a one-way-communication? -
-
Does the Puck support Central/Peripheral mode? I have read that there are some problems connecting Android devices because they do not support Central mode. Could the Puck work as a Gatt Server and is further configuration required? That should allow more compatibility.
A nice update, really interesting functions.
-
This works. I tried to connect the Smartphone with the Puck instead of the connecting Puck with the smartphone.
However I always get the error "Connection timeout". Any idea how to solve this? I used the Bluetooth Mac Address I found on my Android Smartphone (Settings -> About the device -> Status).FindDevices also returns an empty array:
NRF.findDevices(function(devices) { console.log(devices); }, 1000);
-
Hello, I try to debug my source code for creating a bluetooth communication. The sourcecode looks like this:
NRF.connect(addr).then(function(d) { device = d; return d.getPrimaryService("service_uuid"); }).then(function(s) { LED2.set(); console.log("Service ",s); return s.getCharacteristic("characteristic_uuid"); }).then(function(c) { return c.readValue(); }).then(function(d) { console.log("Got:", JSON.stringify(d.buffer)); device.disconnect(); }).catch(function() { console.log("Something's broken."); LED1.set(); });
I know that the example above is not valid.
My general question: How can I debug a bluetooth communication? The problem:
I connect the Puck with Windows to transmit the program to the puck. For establishing a connection from another device (e.g. Android Smartphone), I have to disconnect the Puck from Windows to be able to connect the Android Smartphone with the Puck. If I am disconnected, I will not see the console output on my computer. So how can I see the console result after disconnecting the puck? Could it be stored on the device? -
-
-
-
-
Is the power consumption 20uA in one hour? So that I can calculate it this way:
20uA * 24 (hours) * 365 (days) = 0,1752 A
The lifetime would be for a battery with 230mAh: 0,23 A / 0,1752 A = 1,3 years.
Is that right?Still another question: How could I stop advertising? Should I listen for a response of a smartphone or stop advertising automatically after some minutes (max. 15-20 minutes)? What reduces the power consumption?
Hello, I did not find any reliable information on the website. Which ECMAScript Version is interpreted by Espruino? Is it ECMAScript 6 (also known as ECMAScript 2015) or a newer version?