Git Product home page Git Product logo

Comments (8)

pierreduf avatar pierreduf commented on August 14, 2024

Initialiazing a noble object I get the following debug messages:

hci-usb HCI event: 0e0402030c00 +20ms
hci onSocketData: 040e0402030c00 +0ms
hci event type = 4 +0ms
hci sub event type = 14 +0ms
hci cmd = 3075 +0ms
hci status = 0 +0ms
hci result = +0ms

and the reset is considered OK when the message "0e0401030c00" is received (https://github.com/sandeepmistry/node-bluetooth-hci-socket/blob/master/lib/usb.js#L103)

I doesn't know what this "2" instead of "1" means in the payload.

By forcing status to "poweredOn", I can start a scanning but I'm not sure if it's really working (I can't see my phone but I guess the scanning only sees BLE element and not juste BT 4.0 ones ?)

from node-bluetooth-hci-socket.

sandeepmistry avatar sandeepmistry commented on August 14, 2024

@pierreduf interesting, here's by understanding of the break down:

0e     // EVT_CMD_COMPLETE
04     // length 
01     // ncmd
030c   // command - 0x0C03 = 3075 => reset
00     // status - 00 => success

See: http://git.kernel.org/cgit/bluetooth/bluez.git/tree/lib/hci.h#n1849

So it looks like the ncmd field value doesn't need to be an exact match to 1, it's just the command number. If you verify this works with your Intel adapter. I'd be happy to merge a pull request or make the change ...

Btw, what phone are your using (hardware, and OS)?

from node-bluetooth-hci-socket.

pierreduf avatar pierreduf commented on August 14, 2024

It's a Huawei P8 Lite that has BLE (I can use it to pilot my rolling spider :))

Do you think I should see it using "your" scanning ? Because if I sjould, it's not the case so there's another pbm beyond the "wrong" check of the reset :(

from node-bluetooth-hci-socket.

sandeepmistry avatar sandeepmistry commented on August 14, 2024

@pierreduf not sure if your phone is advertising, if it's running Android 5.0 or above it does have built-in peripheral API's.

I expect noble to only report BLE advertisements anyways.

The better question is does noble's advertisement-discovery.js example detect your Rolling Spider?

from node-bluetooth-hci-socket.

pierreduf avatar pierreduf commented on August 14, 2024

Nope it doesn't work :(

I tried with your source, removing the "onStateChange" function and adding at the end:

noble.state = "poweredOn"
noble.startScanning();

The output is:

hci-usb using USB VID = 32903, PID = 2602 +0ms
hci-usb reset +20ms
hci-usb write: 01030c00 +0ms
hci set scan enabled - writing: 010c20020101 +0ms
hci-usb write: 010c20020101 +20ms
hci-usb HCI event: 0e0402030c00 +0ms
hci onSocketData: 040e0402030c00 +10ms
hci event type = 4 +0ms
hci sub event type = 14 +0ms
hci cmd = 3075 +0ms
hci status = 0 +0ms
hci result = +10ms
hci-usb HCI event: 0e04020c2000 +20ms
hci onSocketData: 040e04020c2000 +0ms
hci event type = 4 +0ms
hci sub event type = 14 +0ms
hci cmd = 8204 +0ms
hci status = 0 +0ms
hci result = +0ms
noble scanStart +10ms

But nothing more :(

from node-bluetooth-hci-socket.

sandeepmistry avatar sandeepmistry commented on August 14, 2024

@pierreduf make sure reset command is processed before scanning is started, some things to try out:

  1. Change: https://github.com/sandeepmistry/node-bluetooth-hci-socket/blob/master/lib/usb.js#L103 to check for: 0e0402030c00

  2. Add a delay before scanning is started, using setTimeout with value of 1000ms or so

from node-bluetooth-hci-socket.

sandeepmistry avatar sandeepmistry commented on August 14, 2024

@pierreduf ping, any updates?

from node-bluetooth-hci-socket.

sandeepmistry avatar sandeepmistry commented on August 14, 2024

Closing for now due to lack of activity, feel free to open again with updates.

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.