if ( nBytes := WriteComm( nComm, "ATZ0" + Chr( 13 ) ) ) < 0
nError = GetCommError( nComm )
MsgStop( "Error initializing modem!" )
return .f.
endif
IF (nBytes := WriteComm( nComm, "D8" ) ) < 0
MsgInfo("Nothing to connect to.")
ENDIF
#include "Fivewin.ch"
FUNCTION MAIN()
LOCAL nCom, cDcb
nCom = OPENCOMM( "COM1", 16384, 16384 )
IF nCom < 0
? "Communication port open error"
RETURN NIL
ENDIF
BUILDCOMMDCB( "COM1:19200,N,8,1", @cDcb )
IF !SETCOMMSTATE( nCom, cDcb )
? "Communication port set error"
RETURN NIL
ENDIF
IF !SENDSTR( nCom, "AT" + CHR( 13 ) )
? "Communication port write error"
RETURN NIL
ENDIF
CLOSECOMM( nCom )
? "OK"
RETURN NIL
STATIC FUNCTION SENDSTR( nCom, cString )
RETURN WRITECOMM( nCom, cString ) = LEN( cString )
#include "Fivewin.ch"
Function FindCom()
LOCAL cData:="", cDataRead:=Space(8), cDCB, nComm
nComm:= OpenComm("COM4", 16384,16384 )
IF nComm < 0
MsgInfo("Error opening port")
ENDIF
BuildCommDcb( "COM4:9600,N,8,1", @cDcb )
IF ! SetCommState( nComm, cDcb )
MsgInfo("SetCommState Error")
CloseComm(nComm)
ENDIF
MsgInfo("Just before writing to com port")
IF ! SendStr( nComm, "D8" )
MsgInfo("No Connection but passed problem with locking up") //never gets this far
ENDIF
MsgInfo("After writing to com port")
Return Nil
STATIC FUNCTION SendStr( nComm, cString )
RETURN WriteComm( nComm, cString ) = LEN(cString)
#include "Fivewin.ch"
Function FindCom()
LOCAL cDCB, nComm
nComm:= OpenComm("COM4", 16384,16384 )
IF nComm < 0
MsgInfo("Error opening port")
RETURN NIL
ENDIF
BuildCommDcb( "COM4:9600,N,8,1", @cDcb )
IF ! SetCommState( nComm, cDcb )
MsgInfo("SetCommState Error")
CloseComm(nComm)
RETURN NIL
ENDIF
MsgInfo("Just before writing to com port")
IF ! SendStr( nComm, "D8" )
MsgInfo("No Connection but passed problem with locking up") //never gets this far
ENDIF
MsgInfo("After writing to com port")
Return Nil
STATIC FUNCTION SendStr( nComm, cString )
RETURN WriteComm( nComm, cString ) = LEN(cString)
bluetooth serial ports
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 92 guests