noble / bleno

A Node.js module for implementing BLE (Bluetooth Low Energy) peripherals
MIT License
2.13k stars 450 forks source link

How to create a service than i can read and get a string from it ? #445

Closed S-Maxime closed 4 years ago

S-Maxime commented 5 years ago

Hello everyone,

My goal is simple : 1 - On my first laptop, i'm using bleno 2 - On my second laptop, i'm using nativescript-bluetooth v2.0.0-beta.23 3 - When my second laptop read the service from my second laptop -> get a string

How can i do that ? First, time to explain a bit what i did so far ! :)

First laptop: I created a project with bleno

On my second laptop (i'm using VMWare with Ubuntu) i try to get the service from my first laptop. Big problem : The services are empty...

{ UUID: '74:29:AF:80:17:BA', JS: name: 'echo', JS: state: 'connected', JS: services: [ [length]: 0 ]}

Here the full source code : https://gist.github.com/Ravaniss/3f4cf62e27acb9594204321052cc0b39

How can i create a service with bleno ? Read that service and get a string from it ?