bluetooth.lookup_name() workaround N810-hezJul 16 Felküldte: GK, címkék: bluetooth, bug, nokia n810, programozás, python
//if (is_home() && (!$paged || $paged == 1) || is_search() || is_single() || is_page()): ?>
Nokia N810-en gond van a BlueZ lib-bel (vagy a környékén valamivel), mivel az alábbi Python kód import bluetooth near = bluetooth.discover_devices() for btaddr in near: name = bluetooth.lookup_name(btaddr): print name csak import os
def lookup_name_workaround(address):
stream = os.popen("hcitool scan")
output = stream.read()
output = output.replace("Scanning ...\n","")
output = output.split("\n")
for i in range(len(output)-1):
device = output[i].split("\t")
if device[1] == address:
return device[2]
return False
Persze kell hozzá hcitool, amit innen lehet letölteni N810-re. Sok szerencsét hozzá! //else: ?> //endif; ?> |
FrissHasznos postBelőlem máshol |
Hívj meg egy sörre!
CímkékMeta |














