apple2idiot/examples/wifi_scan/SCANWIFI.BAS

41 lines
1.0 KiB
QBasic
Raw Normal View History

2021-09-19 17:47:33 +00:00
100 CA = 49664: REM CARD ADDRESS 0XCN0
120 AA = CA +1: REM APPL CMD ADDRESS
140 ESPA = CA: REM ESP CMD ADDRESS
150 MAXSTR = 22: REM TO LIMIT GOING BEZERK
160 NAP = PEEK(CA +3): REM #ACCESS POINTS
165 OFF = CA +4: REM ADDRESS OFFSET
167 PRINT ""
168 PRINT "AP #","ACCESS POINT"
169 PRINT "----","-------------------"
170 FOR J = 0 TO NAP
171 S$ = ""
200 FOR N = 0 TO MAXSTR
215 P = N +OFF
220 C = PEEK(P)
230 IF C = 3 THEN GOTO 400
240 S$ = S$ + CHR$(C)
245 REM PRINT N+1,P,C, CHR$ (C)
250 NEXT N
400 PRINT J +1,S$
420 OFF = P +1
450 NEXT J
590 PRINT ""
600 INPUT "SELECT WIFI AP #:";APN
620 INPUT "PASSWORD (BLANK IF NONE): ";PASS$
630 POKE AA +1,APN
640 WS$ = PASS$
645 WA = AA +2
650 GOSUB 2000
700 POKE AA,112: REM TELL ESP TO USE AP
1066 END
1900 REM ##### SUBS #######
2000 REM WRITE WS$ TO WA
2100 IF LEN(WS$) = 0 THEN GOTO 2360
2200 FOR N = 0 TO LEN(WS$) -1
2210 P = WA +N
2220 C$ = MID$ (WS$,N +1,1)
2230 REM PRINT C$, ASC (C$)
2240 POKE P, ASC(C$)
2350 NEXT N
2360 POKE P +1,3
2370 RETURN