This commit is contained in:
2021-07-30 08:25:11 +02:00
parent 87576af473
commit b0160f61fc
2 changed files with 28 additions and 24 deletions
+25 -24
View File
@@ -130,33 +130,34 @@ def click_b3(channel):
main_fun(BTN2_PIN)
def click_b2(channel):
global aplist
global idxWin
global idxLen
global start
global vert
global test
start = time.time()
if apIndx >= 0:
main_fun(998)
#print ''.join(pwdLst) #TODO change password for real...
start = stamp - SCREEN_SAVER + 5
global apIndx
global chaSel
if state == BTN3_PIN:
apIndx = -1
if vert == 1:
if horz == 1:
main_fun(995)
os.system("# enable hotspot")
else:
main_fun(996)
os.system("# disable hotspot")
elif vert == 2:
main_fun(997)
os.system("")
start = stamp - SCREEN_SAVER + 5
else:
main_fun(BTN1_PIN)
else:
result = os.popen("iwlist {0} scan 2>/dev/null | grep '^..*ESSID:\"..*\"$' | sed 's/^.*ESSID:\"\\(..*\\)\".*$/\\1/'".format(iface)).read()
aplist = result.splitlines()
idxLen = len(aplist)
if (idxWin + SCREEN_LINES) > idxLen:
idxWin = idxLen - SCREEN_LINES
if idxWin < 0:
idxWin = 0
if vert > idxLen:
vert = idxLen
main_fun(channel)
if apIndx < 0:
vert = 3 # Default
main_fun(BTN3_PIN)
else:
if chaSel < 2:
chaSel = chaSel + 1
pwdLst[horz] = choices[chaSel][vert]
main_fun(BTN2_PIN)
def select_h(channel):
global apIndx