hbtpathy doesn't have a complete implementation
for Windows. There is however a comm subsystem
for Windows in hbwin.lib. See testprt1.prg and testprt2.prg
for example code.
Here is used read command and seem works
#include "hbwin.ch"
procedure main(cPortName)
local oWinPort := WinPort():Init(cPortName, CBR_9600, NOPARITY, 8,
ONESTOPBIT)
local cString := "ATE0" + chr(13) + "ATI3" + chr(13)
local nResult
if !oWinPort:Open
? "Open() failed :", oWinPort:Error()
else
? "Open() succeeded"
?
if oWinPort:SetDTR(.t.)
? "SetDTR(.t.) succeeded"
else
? "SetDTR(.t.) failed :", oWinPort:Error()
endif
if (nResult := oWinPort:Write(cString)) == len(cString)
? "Write() succeeded"
else
? "Write() failed, returned ", nResult, " expected ", len(cString)
endif
? "Scan something... we'll not read it but purge it, press enter"
inkey(0)
? "Read() ", oWinPort:Read(@cString, 32), len(cString), cString
? oWinPort:Error()
? "Close", oWinPort:Close()
endif
return
2009/3/3 <[email protected]>:
> Hello,
>
> I am trying to get serial commincations working.
>
> I have an older version of xharbour with xhbcomm. I bought xharbour becase
> it has serial support. After paying for it, I was told that the particular
> library that I need, xhbcomm, is not source code available, without
> explanation. I suppose that this is because it not open source licensed.
> This means that without source code, I cannot upgrade.
>
> I have tried to use the hbcomm.lib, but it always crashed with an "abnormal
> program termination" message. According to a previous post, this is because
> my input parameters are incorrect. I have tried different parameters, but
> it still crashes.
>
> Next, I tried telepathy, but it appears to support Linux and OS/2, not
> Windows32.
>
> Now I am trying testprt1.prg in contrib/hbwin. I have two computers connect
> via null modem cable. The owinport:write method seems to work, but
> oWinport:read does not.
>
> Any suggestions greatly appreciated, thanks, mattfriend88
> <mailto:[email protected]> at yahoo.com
>
> _______________________________________________
> Harbour-users mailing list
> [email protected]
> http://lists.harbour-project.org/mailman/listinfo/harbour-users
>
--
Massimo Belgrano
Albo Nazionale Informatici Professionisti 2620
Socio 2843 Associazione Informatici prof.
Analisi e sviluppo software per Lan e Web
Consulenza informatica - Formazione
Delta Informatica S.r.l. http://www.deltain.it
Via Torelli,31 - 28100 Novara - Tel: 0321/30281
_______________________________________________
Harbour-users mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour-users