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

[PATCH] Add non-RSSI inquiry results in example #29

Closed
GoogleCodeExporter opened this issue Jan 29, 2016 · 2 comments
Closed

[PATCH] Add non-RSSI inquiry results in example #29

GoogleCodeExporter opened this issue Jan 29, 2016 · 2 comments

Comments

@GoogleCodeExporter
Copy link

If either the local Bluetooth device or the remote one is < 2.1, RSSI can not 
be discovered by 
inquiry, a connection is necessary. This patch adds the "legacy" inquiry 
results, so at least the < 
2.1 devices will appear.

Another future improvement would be to actually connect to such devices and 
then measure RSSI. 
(Maybe I will suggest a patch myself in near future.)

--- inquiry-with-rssi.py    (revision 30)
+++ inquiry-with-rssi.py    (working copy)
@@ -108,8 +108,16 @@
                 print "uh oh..."
                 printpacket(pkt[3:7])
                 done = True
+        elif event == bluez.EVT_INQUIRY_RESULT:
+            pkt = pkt[3:]
+            nrsp = struct.unpack("B", pkt[0])[0]
+            for i in range(nrsp):
+                addr = bluez.ba2str( pkt[1+6*i:1+6*i+6] )
+                results.append( ( addr, -1 ) )
+                print "[%s] (no RRSI)" % addr
         else:
             print "unrecognized packet type 0x%02x" % ptype
+       print "event ", event

Original issue reported on code.google.com by elvis.pf...@gmail.com on 16 Apr 2010 at 11:45

@GoogleCodeExporter
Copy link
Author

applied to svn, thanks for the patch.

Original comment by ashu...@gmail.com on 29 Apr 2010 at 8:17

@GoogleCodeExporter
Copy link
Author

Original comment by ashu...@gmail.com on 29 Apr 2010 at 8:17

  • Changed state: Fixed

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

No branches or pull requests

1 participant