Git Product home page Git Product logo

Comments (4)

sandeepmistry avatar sandeepmistry commented on August 11, 2024

@sb-mukul23 you have to pass in the device id (0, 1, etc.) into the bind* methods: https://github.com/sandeepmistry/node-bluetooth-hci-socket#bind

from node-bluetooth-hci-socket.

sb-mukul23 avatar sb-mukul23 commented on August 11, 2024

thanks alot, but I could not find the bind methods

from node-bluetooth-hci-socket.

sb-mukul23 avatar sb-mukul23 commented on August 11, 2024

var bleno = require('bleno');

var SystemInformationService = require('./systeminformationservice');
var BluetoothHciSocket = require('bluetooth-hci-socket');

var systemInformationService = new SystemInformationService();

var bluetoothHciSocket = new BluetoothHciSocket();

bluetoothHciSocket.bindRaw(6);
bluetoothHciSocket.bindUser(5);

bleno.on('stateChange', function(state) {
console.log('on -> stateChange: ' + state);

if (state === 'poweredOn') {

bleno.startAdvertising(bleno.name, [systemInformationService.uuid]);

}
else {

bleno.stopAdvertising();

}
});

bleno.on('advertisingStart', function(error) {

console.log('on -> advertisingStart: ' +
(error ? 'error ' + error : 'success')
);

if (!error) {

bleno.setServices([
  systemInformationService
]);

}
});

this is my index.js file. My bluetooth modules have device id 5 and 6 on the rpi and I am using lightblue which is an IOS app to detect ble. I can only find the rpi and cannot find the second bluetooth module. Also I wanted to know if I could make my rpi as the master and send commands from rpi to the phone

from node-bluetooth-hci-socket.

sandeepmistry avatar sandeepmistry commented on August 11, 2024

See: https://github.com/sandeepmistry/noble#multiple-adapters

and

https://github.com/sandeepmistry/bleno#multiple-adapters

from node-bluetooth-hci-socket.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.