Wi-fi modem has arrived and is connected to my wi-fi and QL
And (after issuing a AT&T command to setup the NTP server) I now simply have to issue an ATI7 command to get current date/time
Still trying to find more details on the AT&T command so I can set the best timezone (given BST is on the way) and more importantly setting a better date/time format (my guesses haven't worked so far)
EDIT: sussed the format %dd/%MM/%yyyy %hh:%mm:%ss, now to sort the timezone (as BST is several hours out!)
Now I need to write a basic (or assembler) utility to run at boot to grab the date/time from the modem and set it on the QL
100 OPEN #8,ser2h
110 BAUD 1200
120 PRINT #8,"AT&T" & CHR$(34) & "GMT,%yyyy%MM%dd%HH%mm%ss,0.uk.pool.ntp.org" & CHR$(34)
130 INPUT #8,a$
140 IF a$(1 TO 2)<>"OK" THEN GO TO 130
150 PRINT #8,"ATI7"
160 t$=a$
170 INPUT #8,a$
180 IF a$(1 TO 2)<>"OK" THEN GO TO 160
190 CLOSE #8
200 ye=t$(1 TO 4)
210 mn=t$(5 TO 6)
220 dd=t$(7 TO 8)
230 hh=t$(9 TO 10)
240 mi=t$(11 TO 12)
250 s=t$(13 TO 14)
260 PRINT #0,"Date/Time: " & t$(1 TO 14)
270 SDATE ye,mn,dd,hh,mi,s
As I use the same QIMSI images for real QL & Q-emuLator I realised I needed a version that wouldn't hang up waiting for an input so have merged the following into my boot file
500 OPEN #8,ser2h
510 BAUD 1200
520 PRINT #8,"AT&T" & CHR$(34) & "GMT,%yyyy%MM%dd%HH%mm%ss,0.uk.pool.ntp.org" & CHR$(34)
530 a$=GetLine$(8)
540 IF a$="" THEN GO TO 700
550 IF a$(1 TO 2)<>"OK" THEN GO TO 530
560 PRINT #8,"ATI7"
570 t$=a$
580 a$=GetLine$(8)
590 IF a$="" THEN GO TO 700
600 IF a$(1 TO 2)<>"OK" THEN GO TO 570
620 ye=t$(1 TO 4)
630 mn=t$(5 TO 6)
640 dd=t$(7 TO 8)
650 hh=t$(9 TO 10)
660 mi=t$(11 TO 12)
670 s=t$(13 TO 14)
680 PRINT #0,"Date/Time: " & t$(7 TO 8) & "/" & t$(5 TO 6) & "/" & t$(1 TO 4) & " " & t$(9 TO 10) & ":" & t$(11 TO 12) & ":" & t$(13 TO 14)
690 SDATE ye,mn,dd,hh,mi,s
700 CLOSE #8
710 DEFine FuNction GetLine$(ch)
720 i$=""
730 c$=INKEY$(#ch,100)
740 IF c$="" THEN RETurn ""
750 IF c$=CHR$(10) THEN RETurn i$
760 i$=i$ & c$
770 GO TO 730
780 END DEFine