Well, in that version it was because of the NUL device (although there are
ways around that - any channel could be used as the target of a Turbo
Toolkit SET_CHANNEL).

However, I have now implemented three new commands which remove the need for
all that mucking about ...

USB_PUTCMD Byte [,Byte]: Put a command in the driver's command pipe.

USB_GETCMD(): Get a long word command response from the driver's command
pipe.

USB_GETCMD$(): Get a long word command response from the driver's command
pipe and return it as a string to S*BASIC.

... which makes the S*BASIC example look like this (also much faster):

100 PRINT "The Response to Command $01 (Get Driver Version) was: " &
GetResponse$(1)
110 PRINT "The Response to Command $02 (Get Hardware Version) was: " &
GetResponse$(2)
120 PRINT "The Response to Command $03 (Get Hardware Type) was: " &
GetResponse$(3)
130 PRINT "The Response to Command $04 (Get I/O Queue Status) was: " &
GetDWordResponse$(4)
140 PRINT "The Response to Command $05 (Get I/O State) was: " &
GetDWordResponse$(5)
150 PRINT "The Response to Command $06 (Get Flags) was: " &
Get32BitResponse$(6)
160 PRINT "The Response to Command $11 (Get Mapped Physical Drive 1) was: "
& GetDWordResponse$(HEX("11"))
170 REMark :
180 REMark =======================================================
190 REMark :
200 DEFine FuNction GetResponse$(Cmd%)
210 USB_PUTCMD Cmd%
220 RETurn USB_GETCMD$
230 END DEFine GetResponse$
240 REMark :
250 REMark =======================================================
260 REMark :
270 DEFine FuNction GetDWordResponse$(Cmd%)
280 LOCal Response, High%, Low%
290 USB_PUTCMD Cmd%
300 Response= USB_GETCMD
310 High%= Response DIV 65536
320 Low%= Response MOD 65536
330 RETurn High% & '/' & Low%
340 END DEFine GetDWordResponse$
350 REMark :
360 REMark =======================================================
370 REMark :
380 DEFine FuNction Get32BitResponse$(Cmd%)
390 LOCal Response, High%, Low%
400 USB_PUTCMD Cmd%
410 Response= USB_GETCMD
420 High%= Response DIV 65536
430 Low%= Response MOD 65536
440 RETurn BIN$(High%,16) & "/" & BIN$(Low%,16)
450 END DEFine Get32BitResponse$

-----Original Message-----
From: ql-users-boun...@lists.q-v-d.com
[mailto:ql-users-boun...@lists.q-v-d.com] On Behalf Of Plastic
Sent: 13 February 2011 11:16
To: ql-us...@q-v-d.com
Subject: Re: [Ql-Users] Ser-USB Driver Update: External Command Interface
(and Progress Update)

On Sun, Feb 13, 2011 at 1:09 AM, Adrian Ives <adr...@acanthis.co.uk> wrote:

> [SNIP]
> Here is a tidier version of the example S*BASIC program that I posted 
> in my last mail. It shows how to use the interface in its current 
> form. Requires SMSQ & Turbo Toolkit (and the Ser-USB Driver).
> [SNIP]


Is the SMSQ requirement permanent, or just for development purposes?

Dave
_______________________________________________
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm

_______________________________________________
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm

Reply via email to