bettercap / gatt

Gatt is a Go package for building Bluetooth Low Energy peripherals
BSD 3-Clause "New" or "Revised" License
53 stars 22 forks source link

ignore l2cap signal #17

Open anisbhsl opened 4 years ago

anisbhsl commented 4 years ago

I am running a custom service for BLE device. While trying to connect my mobile app with GATT server, it throws following log:

ignore l2cap signal:[ 06 00 05 00 13 02 02 00 00 00 ]

No communication is further carried out after this log message appears.

MoralCode commented 1 year ago

I believe this is likely to be data of some kind that results from the specific devices/usecases you are trying to use this gatt library to emulate (i'm working with basically the same devices, Concept2 indoor rowing machines and their bluetooth-capable, PM5 model monitors)

I suspect this is something that happens during/prior to the connection process as I got this error when trying to use the official app against your emulator. I was also able to replicate this with my own custom-made app, although i still have yet to narrow down specifically what is causing this signal.

More research definitely needs to be done to definitively place blame on this gatt library as opposed to either a higher, application level issue, or some lower level l2cap dependency or something

MoralCode commented 1 year ago

further investigation reveals im wrong in a number of ways.

  1. packet analysis (using a similar method to the instructions on the openscale wiki) reveals that the bytes in question (06 00 05 00 13 02 02 00 00 00 ) seem to appear within short/low level l2cap control/signalling packets, not the kind i would expect to contain data specific to the Concept2 machines
  2. this log message seems to not mean much other than "hey we got a thing that we dont yet know how to process" according to the source code in this repo. it also seems like PR #21 has been opened to fix this but hasnt yet been merged.

overall it seems like this signal is just a basic part of connecting to a device (which, based on my research, is one of the responsibilities of the l2cap layer of the bluetooth stack) that this library doesnt yet handle.

anisbhsl commented 1 year ago

It was super difficult to fix. I don't remember much of the context now. Unfortunately, there isn't much activity around this library anymore.

MoralCode commented 1 year ago

do you have a fix that you implemented on your local machine that you could push to a fork? id be curious to see how you solved it.

I also noticed the lack of activity around this library, so I've been working on my own fork that merges in the open PR's on this repo