Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for l2ping alike functionality as Low-Level Protocol presence detection #71

Open
janlinders opened this issue Nov 19, 2018 · 14 comments

Comments

@janlinders
Copy link

No description provided.

@janlinders
Copy link
Author

Bluez l2ping utility (device does not need to be in discovery mode as long as the MAC is known)
I.e
Now, lets see how the command responds when the Bluetooth ON

$ sudo l2ping 6C:C4:D5:6C:C5:BC
Ping: 6C:C4:D5:6C:C5:BC from 70:1A:04:59:69:04 (data size 44) ...
44 bytes from 6C:C4:D5:6C:C5:BC id 0 time 5.93ms
44 bytes from 6C:C4:D5:6C:C5:BC id 1 time 8.76ms

Now, lets see how the command responds when the Bluetooth OFF

$ sudo l2ping 6C:C4:D5:6C:C5:BC
Can't connect: Host is down

@xrucka
Copy link
Contributor

xrucka commented Nov 19, 2018

Hi, this might not be realizable within the current architecture without adding middle layers. Speaking from experience on implementing bluez/dbus transport, bluez does not expose l2ping interface through dbus. Therefore, to perform l2ping, you need to actually call a seduid binary that can be bound to raw bluetooth socket + handle the way l2ping gets elevated priviledges.

Therefore, for practial use, I suggest to enable calling l2ping with sudoerrs and use - for example - exec binding or similar.

@janlinders
Copy link
Author

Hi xrucka, thanks for the comment. I have the l2ping working through the Exec binding and it works fine. Having similar functionality available in the BT Binding would be much cleaner i guess without sudoers etc.
However if that is becoming to complex, forget the requests.
KR

@vkolotov
Copy link
Contributor

Hi @janlinders, could you please elaborate what phone you are using?
As far as I know, the l2ping utility is used for older BT devices (prior BT 4.0), new devices that support BT 4.0 won't be able to respond for l2ping. It would be great if they could. Please confirm.

Also could you please let us know what is rationale not to have discoverable mode enabled on your phone? Is this to achieve privacy?

@janlinders
Copy link
Author

janlinders commented Nov 19, 2018 via email

@janlinders
Copy link
Author

janlinders commented Nov 19, 2018 via email

@vkolotov
Copy link
Contributor

Very interesting. Are you saying that even if your phones are not in discoverable mode (make sure you close BT settings and leave it for 2-3 mins), you still can ping them via l2ping?

@janlinders
Copy link
Author

janlinders commented Nov 19, 2018 via email

@vkolotov
Copy link
Contributor

Very good, thank you. As @xrucka mentioned earlier, that would not be very easy to add support for.

What is rationale not to enable/(force to be enabled) discoverable mode in your devices? Privacy/security?

@vkolotov
Copy link
Contributor

And yeah, just double checking. Do you mobile phones have fixed/static MAC address when in discoverable mode or they change it every so often?

@janlinders
Copy link
Author

janlinders commented Nov 19, 2018 via email

@janlinders
Copy link
Author

janlinders commented Nov 19, 2018 via email

@vkolotov
Copy link
Contributor

Right, that's the thing. This is quite unusual for new phones if they have static mac addresses. I'll try to ping my devices to see if it is possible, but I doubt it is... If it is possible, then we might have a good way to track presence, although that would be quite difficult to add support for. Furthermore, looks like bluegiga adapters do not support it at all.

@janlinders
Copy link
Author

janlinders commented Nov 19, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants