Yes, there is a COMM module with the below functions already developed but we had some problems with PB owner.
To make it short PB is saying we have violated compiler licence so we cannot use PB communication fuctionalities in a thinBasic module.
After reading again and again the few lines of PB compiler licence we didn't found any limitation but, you know, our project is a free project and we are not in a condition (at the moment) to try to go against.
What do you need COMM module for?
We can try to develop something in another way.
Let me know.
Eros
_________________________________________________
List of already supported COMM functionalities:
[code=thinbasic]
COMM_Get, COMM_Close, COMM_Line,
COMM_Open, COMM_Print, COMM_Recv,
COMM_Reset, COMM_Send, COMM_Set,
COMM_FreeFile, COMM_EOF[/code]
List of COMM equates:
[code=thinbasic]
%COMM_BAUD, %COMM_BREAK, %COMM_BYTE,
%COMM_CD, %COMM_CTSFLOW, %COMM_DSRFLOW,
%COMM_DSRSENS, %COMM_DTRFLOW, %COMM_DTRLINE,
%COMM_NULL, %COMM_PARITY, %COMM_PARITYCHAR,
%COMM_PARITYREPL, %COMM_PARITYTYPE, %COMM_RING,
%COMM_RLSD, %COMM_RTSFLOW, %COMM_RXBUFFER,
%COMM_RXQUE, %COMM_STOP, %COMM_TXBUFFER,
%COMM_TXQUE, %COMM_XINPFLOW, %COMM_XOUTFLOW
[/code]
A little test modem script:
[code=thinbasic]
uses "Console"
uses "COMM"
dim nModems as long = 9
dim Count as long
dim CountATI as long
dim hComm as long
dim nBytes as long
dim sBuffer as string
for count = 1 to 9
hComm = comm_freefile
console_writeline("Opening COM" & Count & " as hComm=" & hComm)
comm_open("COM" & Count, hComm)
if err = 0 then
console_writeline("...open ok.")
for CountATI = 1 to 5
console_writeline("Now sending ATI" & CountATI)
comm_print(hComm, "ATI" & CountATI)
SLEEP 1000 ' delay for modem to respond
nBytes = COMM_Get(hComm, %comm_RXQUE)
COMM_recv(hComm, nBytes, sBuffer)
console_writeline(sBuffer)
next
console_writeline("...closing port COM" & Count)
comm_close(hComm)
else
console_writeline("Error: " & err)
end if
next
console_writeline("----------------------------------------")
console_writeline("End testing. Press any key to finish.")
console_writeline("----------------------------------------")
[/code]
Bookmarks