virtualabs / btlejack

Bluetooth Low Energy Swiss-army knife
MIT License
1.88k stars 195 forks source link

Added __init__ before sniffing again after a connection loss. #33

Closed mh- closed 5 years ago

mh- commented 5 years ago

I started to use btlejack on a Raspberry Pi 3 Model B+, which runs Raspbian Stretch Lite Version "November 2018", Release date 2018-11-13, Kernel version 4.14, with three micro:bit sniffers flashed to version 1.3.

Running btlejack -c xx:xx:xx:xx:xx:xx I found that it would always follow the first connection that I set up after the start, but after that connection was lost, most of the time, btlejack would not follow the next connection.

So I inserted a super().__init__ call in on_connection_lost(), which solved this issue for me. btlejack now also follows all subsequent connections.

I'm not sure if this is the correct solution, i.e. if there are negative side-effects, or if there's a more elegant solution, but - well, it seems to work.

virtualabs commented 5 years ago

There is one side effect: btlejack will list again every available sniffer. I will have a look at it and see if a better fix can be found for this issue, i.e. that fixes the root cause of this problem.

mh- commented 5 years ago

Did you plan to merge this? I think that due to my incorrect git handling, the next pull request has reverted this again. (I intended to make two separate pull requests, where the next one (readme.rst) was independent from this one, but git interpreted in a different way...)