2010-06-09 19:56 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* utils/hbmk2/hbmk2.prg
+ Quite big commit aiming to clean path forming in different
situations. After this is change it should be more or less
true that internally hbmk2 always uses native path format,
it should accept _any_ format regardless of platform,
and it should convert filenames to proper format only when
calling external compiler tools, according to their specific
taste.
F.e. this should fix problems when doing Windows cross-build
on *nix systems, with watcom, or other compilers (except
mingw) which has native compiler. It should continue to
work with WINE based on compilers in similar situations.
There is one specific exception when passing around
filenames as part of options. In this case hbmk2 cannot do
too much magic, so try to avoid it.
Though I never actualluy tried this latter case.
Please test it, regressions are possible. I'd be happy to
see stress tests with passing various combination of pathseps
and watching -trace output whether everything is properly
converted to right format.
+ Will now convert filenames to Cygwin format for Cygwin
targets.
! Fixed to accept .hbi files without '@' prefix.
* config/postinst.prg
% Do not add '@' prefix when referring to .hbi files.
* src/vm/extend.c
! Fixed TRACE message of new hb_parnintdef() function.
* src/rtl/hbcomhb.c
* Minor correction to one function description in comment.
* src/rtl/hbsocket.c
* Minor formatting.
* include/hbcom.ch
+ Added comments.
* Formatting.
+ Added comment that code is used by .c code.
* contrib/hbtpathy/telepath.prg
* Rewritten to use native HB_COM*() API (instead of hbct
specific COM_() one).
+ tp_send() code rewritten to use core timeout functionality.
+ Implemented formerly disabled tp_ctrldtr() function.
(pls review it)
% FetchChars() internal function simplified.
* contrib/hbcomm/hbcomm.prg
* Rewritten to use native HB_COM*() API (instead of hbct
specific COM_() one).
* contrib/hbsms/hbsms.prg
* Rewritten to use native HB_COM*() API (instead of hbct
specific COM_() one).
* Receive code rewritten to rely on core timeout functionality
instead of rolling local implementation.
; I didn't make any tests with API converted COM code, so please
review and test these changes.
* contrib/hbtpathy/hbtpathy.hbc
* contrib/hbcomm/hbcomm.hbc
* contrib/hbsms/hbsms.hbc
- Deleted hbct dependency.
* INSTALL
* package/winuni/RELNOTES
* QT 4.6.2 -> 4.6.3
This commit is contained in:
@@ -16,6 +16,78 @@
|
||||
The license applies to all entries newer than 2009-04-28.
|
||||
*/
|
||||
|
||||
2010-06-09 19:56 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* utils/hbmk2/hbmk2.prg
|
||||
+ Quite big commit aiming to clean path forming in different
|
||||
situations. After this is change it should be more or less
|
||||
true that internally hbmk2 always uses native path format,
|
||||
it should accept _any_ format regardless of platform,
|
||||
and it should convert filenames to proper format only when
|
||||
calling external compiler tools, according to their specific
|
||||
taste.
|
||||
F.e. this should fix problems when doing Windows cross-build
|
||||
on *nix systems, with watcom, or other compilers (except
|
||||
mingw) which has native compiler. It should continue to
|
||||
work with WINE based on compilers in similar situations.
|
||||
There is one specific exception when passing around
|
||||
filenames as part of options. In this case hbmk2 cannot do
|
||||
too much magic, so try to avoid it.
|
||||
Though I never actualluy tried this latter case.
|
||||
Please test it, regressions are possible. I'd be happy to
|
||||
see stress tests with passing various combination of pathseps
|
||||
and watching -trace output whether everything is properly
|
||||
converted to right format.
|
||||
+ Will now convert filenames to Cygwin format for Cygwin
|
||||
targets.
|
||||
! Fixed to accept .hbi files without '@' prefix.
|
||||
|
||||
* config/postinst.prg
|
||||
% Do not add '@' prefix when referring to .hbi files.
|
||||
|
||||
* src/vm/extend.c
|
||||
! Fixed TRACE message of new hb_parnintdef() function.
|
||||
|
||||
* src/rtl/hbcomhb.c
|
||||
* Minor correction to one function description in comment.
|
||||
|
||||
* src/rtl/hbsocket.c
|
||||
* Minor formatting.
|
||||
|
||||
* include/hbcom.ch
|
||||
+ Added comments.
|
||||
* Formatting.
|
||||
+ Added comment that code is used by .c code.
|
||||
|
||||
* contrib/hbtpathy/telepath.prg
|
||||
* Rewritten to use native HB_COM*() API (instead of hbct
|
||||
specific COM_() one).
|
||||
+ tp_send() code rewritten to use core timeout functionality.
|
||||
+ Implemented formerly disabled tp_ctrldtr() function.
|
||||
(pls review it)
|
||||
% FetchChars() internal function simplified.
|
||||
|
||||
* contrib/hbcomm/hbcomm.prg
|
||||
* Rewritten to use native HB_COM*() API (instead of hbct
|
||||
specific COM_() one).
|
||||
|
||||
* contrib/hbsms/hbsms.prg
|
||||
* Rewritten to use native HB_COM*() API (instead of hbct
|
||||
specific COM_() one).
|
||||
* Receive code rewritten to rely on core timeout functionality
|
||||
instead of rolling local implementation.
|
||||
|
||||
; I didn't make any tests with API converted COM code, so please
|
||||
review and test these changes.
|
||||
|
||||
* contrib/hbtpathy/hbtpathy.hbc
|
||||
* contrib/hbcomm/hbcomm.hbc
|
||||
* contrib/hbsms/hbsms.hbc
|
||||
- Deleted hbct dependency.
|
||||
|
||||
* INSTALL
|
||||
* package/winuni/RELNOTES
|
||||
* QT 4.6.2 -> 4.6.3
|
||||
|
||||
2010-06-09 18:42 UTC+0300 Mindaugas Kavaliauskas (dbtopas/at/dbtopas.lt)
|
||||
* harbour/examples/commouse/commouse.prg
|
||||
* added $id$
|
||||
@@ -58,8 +130,8 @@
|
||||
+ harbour/examples/commouse
|
||||
+ harbour/examples/commouse/commouse.prg
|
||||
+ sample application to decode and display COM port mouse data.
|
||||
Two types of mouse protocol is supported. You just need to
|
||||
find COM port mouse! :)
|
||||
Two types of mouse protocol is supported. You just need to
|
||||
find COM port mouse! :)
|
||||
|
||||
* harbour/src/rtl/hbcom.c
|
||||
! fixed timeouts on Windows platform (thanks Przemek!)
|
||||
|
||||
@@ -1394,7 +1394,7 @@ HARBOUR
|
||||
http://get.qt.nokia.com/qt/source/
|
||||
Currently supported Windows binary package:
|
||||
http://get.qt.nokia.com/qt/source/qt-win-opensource-4.5.3-mingw.exe
|
||||
http://get.qt.nokia.com/qt/source/qt-win-opensource-4.6.2-mingw.exe
|
||||
http://get.qt.nokia.com/qt/source/qt-win-opensource-4.6.3-mingw.exe
|
||||
How to create static and MSVC builds:
|
||||
http://doc.trolltech.com/4.5/deployment-windows.html
|
||||
NOTES:
|
||||
|
||||
@@ -86,7 +86,7 @@ PROCEDURE Main()
|
||||
IF hb_FileExists( "contrib" + _PS_ + tmp + _PS_ + tmp + ".hbi" )
|
||||
mk_hb_processRun( GetEnv( "HB_HOST_BIN_DIR" ) + _PS_ + "hbmk2" +;
|
||||
" -quiet -lang=en" +;
|
||||
" @contrib/" + tmp + "/" + tmp + ".hbi" +;
|
||||
" contrib/" + tmp + "/" + tmp + ".hbi" +;
|
||||
" -o${HB_LIB_INSTALL}/" )
|
||||
ENDIF
|
||||
NEXT
|
||||
|
||||
@@ -5,5 +5,3 @@
|
||||
incpaths=.
|
||||
|
||||
libs=${hb_name}
|
||||
|
||||
libs=../hbct/hbct.hbc
|
||||
|
||||
@@ -52,6 +52,8 @@
|
||||
|
||||
#include "common.ch"
|
||||
|
||||
#include "hbcom.ch"
|
||||
|
||||
STATIC s_hPort := { => }
|
||||
STATIC s_hbcomm_mutex := hb_mutexCreate()
|
||||
|
||||
@@ -68,10 +70,11 @@ FUNCTION INIT_PORT( cPort, nBaud, nData, nParity, nStop, nBufferSize )
|
||||
nPort := Len( s_hPort ) + 1
|
||||
|
||||
IF ISCHARACTER( cPort )
|
||||
cOldPortName := com_DevName( nPort, cPort )
|
||||
cOldPortName := hb_comGetDevice( nPort )
|
||||
hb_comSetDevice( nPort, cPort )
|
||||
ENDIF
|
||||
|
||||
IF com_Open( nPort )
|
||||
IF hb_comOpen( nPort )
|
||||
|
||||
IF ! ISNUMBER( nBaud )
|
||||
nBaud := 9600
|
||||
@@ -93,17 +96,17 @@ FUNCTION INIT_PORT( cPort, nBaud, nData, nParity, nStop, nBufferSize )
|
||||
|
||||
HB_SYMBOL_UNUSED( nBufferSize )
|
||||
|
||||
IF com_Init( nPort, nBaud, cParity, nData, nStop )
|
||||
IF hb_comInit( nPort, nBaud, cParity, nData, nStop )
|
||||
s_hPort[ nPort ] := cOldPortName
|
||||
hb_mutexUnLock( s_hbcomm_mutex )
|
||||
RETURN nPort
|
||||
ELSE
|
||||
com_Close( nPort )
|
||||
hb_comClose( nPort )
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
IF cOldPortName != NIL
|
||||
com_DevName( nPort, cOldPortName )
|
||||
hb_comSetDevice( nPort, cOldPortName )
|
||||
ENDIF
|
||||
|
||||
hb_mutexUnLock( s_hbcomm_mutex )
|
||||
@@ -112,7 +115,7 @@ FUNCTION INIT_PORT( cPort, nBaud, nData, nParity, nStop, nBufferSize )
|
||||
|
||||
/* Purge output buffer */
|
||||
FUNCTION OUTBUFCLR( nPort )
|
||||
RETURN com_sflush( nPort )
|
||||
RETURN hb_comFlush( nPort, HB_COM_OFLUSH )
|
||||
|
||||
/* See if port is opened correctly */
|
||||
FUNCTION ISWORKING( nPort )
|
||||
@@ -124,20 +127,19 @@ FUNCTION ISWORKING( nPort )
|
||||
[vszakats] */
|
||||
/* Fetch <nCount> chars into <cString> */
|
||||
FUNCTION INCHR( nPort, nCount, /* @ */ cString )
|
||||
cString := com_read( nPort, nCount )
|
||||
RETURN Len( cString )
|
||||
RETURN hb_comRecv( nPort, @cString, nCount )
|
||||
|
||||
/* Send out characters. Returns .t. if successful. */
|
||||
FUNCTION OUTCHR( nPort, cString )
|
||||
RETURN com_send( nPort, cString ) == 0
|
||||
RETURN hb_comSend( nPort, cString ) == Len( cString )
|
||||
|
||||
/* Find out how many chars are in input buffer */
|
||||
FUNCTION INBUFSIZE( nPort )
|
||||
RETURN com_count( nPort )
|
||||
RETURN hb_comInputCount( nPort )
|
||||
|
||||
/* Find out how many characters are in out buf? */
|
||||
FUNCTION OUTBUFSIZE( nPort )
|
||||
RETURN com_scount( nPort )
|
||||
RETURN hb_comOutputCount( nPort )
|
||||
|
||||
/* Close port and clear handle */
|
||||
FUNCTION UNINT_PORT( nPort )
|
||||
@@ -146,10 +148,10 @@ FUNCTION UNINT_PORT( nPort )
|
||||
hb_mutexLock( s_hbcomm_mutex )
|
||||
|
||||
IF nPort $ s_hPort
|
||||
IF com_Close( nPort )
|
||||
IF hb_comClose( nPort )
|
||||
/* Restore com port name */
|
||||
IF s_hPort[ nPort ] != NIL
|
||||
com_DevName( nPort, s_hPort[ nPort ] )
|
||||
hb_comSetDevice( nPort, s_hPort[ nPort ] )
|
||||
ENDIF
|
||||
hb_HDel( s_hPort, nPort )
|
||||
lRetVal := .T.
|
||||
|
||||
@@ -5,5 +5,3 @@
|
||||
incpaths=.
|
||||
|
||||
libs=${hb_name}
|
||||
|
||||
libs=../hbct/hbct.hbc
|
||||
|
||||
@@ -61,27 +61,12 @@
|
||||
#include "common.ch"
|
||||
|
||||
STATIC FUNCTION port_send( h, s )
|
||||
RETURN com_send( h, s )
|
||||
RETURN hb_comSend( h, s )
|
||||
|
||||
/* NOTE: EXPERIMENTAL CODE. USE AT YOUR OWN RISK. NO GUARANTEES. */
|
||||
STATIC FUNCTION port_rece( h, n, t )
|
||||
LOCAL cString
|
||||
LOCAL nEnd
|
||||
LOCAL cString := ""
|
||||
|
||||
IF ! ISNUMBER( n )
|
||||
n := 64
|
||||
ENDIF
|
||||
|
||||
IF ! ISNUMBER( t )
|
||||
t := 5
|
||||
ENDIF
|
||||
|
||||
cString := ""
|
||||
nEnd := hb_milliSeconds() + ( t * 1000 )
|
||||
DO WHILE Len( cString ) < t .AND. hb_milliSeconds() < nEnd
|
||||
cString += com_read( h, n - Len( cString ) )
|
||||
hb_idleSleep( 0.01 )
|
||||
ENDDO
|
||||
hb_comRecv( h, @cString, n, t )
|
||||
|
||||
RETURN cString
|
||||
|
||||
@@ -128,17 +113,18 @@ FUNCTION smsctx_New( xPort )
|
||||
smsctx[ _SMSCTX_cPrevName ] := NIL
|
||||
ELSEIF ISCHARACTER( xPort )
|
||||
smsctx[ _SMSCTX_xHnd ] := 1
|
||||
smsctx[ _SMSCTX_cPrevName ] := com_DevName( smsctx[ _SMSCTX_xHnd ], xPort )
|
||||
smsctx[ _SMSCTX_cPrevName ] := hb_comGetDevice( smsctx[ _SMSCTX_xHnd ] )
|
||||
hb_comSetDevice( smsctx[ _SMSCTX_xHnd ], xPort )
|
||||
ELSE
|
||||
smsctx[ _SMSCTX_xHnd ] := NIL
|
||||
ENDIF
|
||||
|
||||
IF smsctx[ _SMSCTX_xHnd ] != NIL
|
||||
IF com_Open( smsctx[ _SMSCTX_xHnd ] )
|
||||
IF com_Init( smsctx[ _SMSCTX_xHnd ], 9600, "N", 8, 1 )
|
||||
IF hb_comOpen( smsctx[ _SMSCTX_xHnd ] )
|
||||
IF hb_comInit( smsctx[ _SMSCTX_xHnd ], 9600, "N", 8, 1 )
|
||||
RETURN smsctx
|
||||
ELSE
|
||||
com_Close( smsctx[ _SMSCTX_xHnd ] )
|
||||
hb_comClose( smsctx[ _SMSCTX_xHnd ] )
|
||||
ENDIF
|
||||
ENDIF
|
||||
ENDIF
|
||||
@@ -151,13 +137,13 @@ FUNCTION smsctx_Close( smsctx )
|
||||
RETURN .F.
|
||||
ENDIF
|
||||
|
||||
IF ! com_Close( smsctx[ _SMSCTX_xHnd ] )
|
||||
IF ! hb_comClose( smsctx[ _SMSCTX_xHnd ] )
|
||||
RETURN .F.
|
||||
ENDIF
|
||||
|
||||
/* Restore com port name */
|
||||
IF smsctx[ _SMSCTX_cPrevName ] != NIL
|
||||
com_DevName( smsctx[ _SMSCTX_xHnd ], smsctx[ _SMSCTX_cPrevName ] )
|
||||
hb_comSetDevice( smsctx[ _SMSCTX_xHnd ], smsctx[ _SMSCTX_cPrevName ] )
|
||||
ENDIF
|
||||
|
||||
RETURN .T.
|
||||
|
||||
@@ -5,5 +5,3 @@
|
||||
incpaths=.
|
||||
|
||||
libs=${hb_name}
|
||||
|
||||
libs=../hbct/hbct.hbc
|
||||
|
||||
@@ -61,6 +61,8 @@
|
||||
#include "common.ch"
|
||||
#include "telepath.ch"
|
||||
|
||||
#include "hbcom.ch"
|
||||
|
||||
|
||||
#define TPFP_NAME 1 /* Structure of ports array */
|
||||
#define TPFP_HANDLE 2
|
||||
@@ -92,7 +94,7 @@ FUNCTION tp_baud( nPort, nNewBaud )
|
||||
ENDIF
|
||||
|
||||
IF nNewBaud > 0
|
||||
IF com_Init( t_aPorts[ nPort, TPFP_HANDLE ], nNewBaud, t_aPorts[ nPort, TPFP_PARITY ], t_aPorts[ nPort, TPFP_DBITS ], t_aPorts[ nPort, TPFP_SBITS ] )
|
||||
IF hb_comInit( t_aPorts[ nPort, TPFP_HANDLE ], nNewBaud, t_aPorts[ nPort, TPFP_PARITY ], t_aPorts[ nPort, TPFP_DBITS ], t_aPorts[ nPort, TPFP_SBITS ] )
|
||||
t_aPorts[ nPort, TPFP_BAUD ] := nNewBaud
|
||||
ELSE
|
||||
// set error code
|
||||
@@ -144,7 +146,7 @@ FUNCTION tp_close( nPort, nTimeout )
|
||||
|
||||
IF t_aPorts[ nPort, TPFP_HANDLE ] >= 0
|
||||
|
||||
com_Close( t_aPorts[ nPort, TPFP_HANDLE ] )
|
||||
hb_comClose( t_aPorts[ nPort, TPFP_HANDLE ] )
|
||||
|
||||
/* Port parameters should stay the same for the case the port
|
||||
gets reopened
|
||||
@@ -197,7 +199,7 @@ FUNCTION tp_open( nPort, nInSize, nOutSize, nBaud, nData, cParity, nStop, cPortn
|
||||
nStop := 1
|
||||
ENDIF
|
||||
IF ISCHARACTER( cPortname )
|
||||
com_DevName( nPort, cPortname )
|
||||
hb_comSetDevice( nPort, cPortname )
|
||||
ENDIF
|
||||
|
||||
t_aPorts[ nPort, TPFP_NAME ] := cPortname
|
||||
@@ -210,11 +212,11 @@ FUNCTION tp_open( nPort, nInSize, nOutSize, nBaud, nData, cParity, nStop, cPortn
|
||||
t_aPorts[ nPort, TPFP_INBUF_SIZE ] := nInSize
|
||||
t_aPorts[ nPort, TPFP_HANDLE ] := -1
|
||||
|
||||
IF com_Open( nPort )
|
||||
IF hb_comOpen( nPort )
|
||||
|
||||
t_aPorts[ nPort, TPFP_HANDLE ] := nPort
|
||||
|
||||
IF com_Init( t_aPorts[ nPort, TPFP_HANDLE ], t_aPorts[ nPort, TPFP_BAUD ], t_aPorts[ nPort, TPFP_PARITY ], t_aPorts[ nPort, TPFP_DBITS ], t_aPorts[ nPort, TPFP_SBITS ] )
|
||||
IF hb_comInit( t_aPorts[ nPort, TPFP_HANDLE ], t_aPorts[ nPort, TPFP_BAUD ], t_aPorts[ nPort, TPFP_PARITY ], t_aPorts[ nPort, TPFP_DBITS ], t_aPorts[ nPort, TPFP_SBITS ] )
|
||||
t_aPorts[ nPort, TPFP_OC ] := .T.
|
||||
RETURN 0
|
||||
ELSE
|
||||
@@ -273,49 +275,20 @@ FUNCTION tp_recv( nPort, nLength, nTimeout )
|
||||
|
||||
FUNCTION tp_send( nPort, cString, nTimeout )
|
||||
|
||||
LOCAL nWritten, nTotWritten, nDone
|
||||
|
||||
IF ! ISCHARACTER( cString )
|
||||
cString := ""
|
||||
ENDIF
|
||||
IF ! ISNUMBER( nTimeout )
|
||||
nTimeout := 0
|
||||
ENDIF
|
||||
|
||||
IF ! isopenport( nPort )
|
||||
RETURN 0
|
||||
ENDIF
|
||||
|
||||
IF Len( cString ) == 0
|
||||
RETURN 0
|
||||
ENDIF
|
||||
|
||||
nDone := Seconds() + iif( nTimeout >= 0, nTimeout, 0)
|
||||
nTotWritten := 0
|
||||
|
||||
DO WHILE nTotWritten < Len( cString ) .AND. ;
|
||||
( nTimeout < 0 .OR. Seconds() <= nDone )
|
||||
|
||||
nWritten := com_send( t_aPorts[ nPort, TPFP_HANDLE ], SubStr( cString, nTotWritten + 1 ) )
|
||||
|
||||
IF nWritten >= 0
|
||||
|
||||
nTotWritten += nWritten
|
||||
|
||||
IF nTotWritten < Len( cString )
|
||||
|
||||
IF ! tp_idle()
|
||||
hb_idleSleep( 1 )
|
||||
ELSE
|
||||
EXIT
|
||||
ENDIF
|
||||
ENDIF
|
||||
ELSE // nWritten < 0, error occurred
|
||||
EXIT
|
||||
ENDIF
|
||||
ENDDO
|
||||
|
||||
RETURN nTotWritten
|
||||
RETURN hb_comSend( t_aPorts[ nPort, TPFP_HANDLE ], cString )
|
||||
|
||||
|
||||
FUNCTION tp_sendsub( nPort, cString, nStart, nLength, nTimeout )
|
||||
@@ -554,17 +527,25 @@ FUNCTION tp_waitfor( ... )
|
||||
/* We cannot set, well, _I_ think we cannot, CTS without setting RTS flowcontrol, so this
|
||||
function and tp_ctrlrts() do the same thing, that is set/reset CRTSCTS flowcontol */
|
||||
FUNCTION tp_ctrlcts( nPort, nNewCtrl )
|
||||
|
||||
LOCAL nCurValue
|
||||
LOCAL nFlag
|
||||
|
||||
IF ! isopenport( nPort )
|
||||
RETURN 0
|
||||
ENDIF
|
||||
|
||||
IF Valtype( nNewCtrl ) == "U"
|
||||
nCurValue := __tp_ctrlcts( t_aPorts[ nPort, TPFP_HANDLE ] )
|
||||
ELSE
|
||||
nCurValue := __tp_ctrlcts( t_aPorts[ nPort, TPFP_HANDLE ], nNewCtrl )
|
||||
IF hb_comFlowControl( t_aPorts[ nPort, TPFP_HANDLE ], @nCurValue )
|
||||
nFlag := hb_bitOr( HB_COM_FLOW_IRTSCTS, HB_COM_FLOW_ORTSCTS )
|
||||
IF ISNUMBER( nNewCtrl )
|
||||
IF nNewCtrl == 0
|
||||
nNewCtrl := hb_bitAnd( nCurValue, hb_bitNot( nFlag ) )
|
||||
ELSE
|
||||
nNewCtrl := hb_bitOr( nCurValue, nFlag )
|
||||
ENDIF
|
||||
|
||||
hb_comFlowControl( t_aPorts[ nPort, TPFP_HANDLE ], NIL, nNewCtrl )
|
||||
ENDIF
|
||||
nCurValue := iif( hb_bitAnd( nCurValue, nFlag ) != 0, 1, 0 )
|
||||
ENDIF
|
||||
|
||||
RETURN nCurValue
|
||||
@@ -575,57 +556,77 @@ FUNCTION tp_ctrlrts( nPort, nNewCtrl )
|
||||
RETURN tp_ctrlcts( nPort, nNewCtrl )
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
// telepathy says...
|
||||
// returns old dtr value 0,1,2
|
||||
// sets to 0 = dtr off, 1 dtr on, 2 = dtr flow control autotoggle
|
||||
// I don't support 2. who uses dtr for flow control anyway...
|
||||
FUNCTION tp_ctrldtr( nPort, nParamNewval )
|
||||
LOCAL nph, nnewval, noldval
|
||||
FUNCTION tp_ctrldtr( nPort, nNewCtrl )
|
||||
LOCAL nCurValue
|
||||
LOCAL nFlag
|
||||
|
||||
IF ! isopenport( nPort )
|
||||
RETURN TE_PARAM
|
||||
RETURN 0
|
||||
ENDIF
|
||||
nph := t_aPorts[ nPort, TPFP_HANDLE ]
|
||||
|
||||
__tp_ctrldtr( nph, @nnewval, @noldval )
|
||||
IF hb_comFlowControl( t_aPorts[ nPort, TPFP_HANDLE ], @nCurValue )
|
||||
nFlag := hb_bitOr( HB_COM_FLOW_IDTRDSR, HB_COM_FLOW_ODTRDSR )
|
||||
IF ISNUMBER( nNewCtrl )
|
||||
IF nNewCtrl == 0
|
||||
nNewCtrl := hb_bitAnd( nCurValue, hb_bitNot( nFlag ) )
|
||||
ELSE
|
||||
nNewCtrl := hb_bitOr( nCurValue, nFlag )
|
||||
ENDIF
|
||||
|
||||
RETURN noldval
|
||||
*/
|
||||
hb_comFlowControl( t_aPorts[ nPort, TPFP_HANDLE ], NIL, nNewCtrl )
|
||||
ENDIF
|
||||
nCurValue := iif( hb_bitAnd( nCurValue, nFlag ) != 0, 1, 0 )
|
||||
ENDIF
|
||||
|
||||
RETURN nCurValue
|
||||
|
||||
FUNCTION tp_isdcd( nPort )
|
||||
LOCAL nValue
|
||||
|
||||
IF ! isopenport( nPort )
|
||||
RETURN .F.
|
||||
ENDIF
|
||||
|
||||
RETURN com_DCD( t_aPorts[ nPort, TPFP_HANDLE ] )
|
||||
hb_comMSR( nPort, @nValue )
|
||||
|
||||
RETURN hb_bitAnd( nValue, HB_COM_MSR_DCD ) != 0
|
||||
|
||||
FUNCTION tp_isri( nPort )
|
||||
LOCAL nValue
|
||||
|
||||
IF ! isopenport( nPort )
|
||||
RETURN .F.
|
||||
ENDIF
|
||||
|
||||
RETURN com_Ring( t_aPorts[ nPort, TPFP_HANDLE ] )
|
||||
hb_comMSR( nPort, @nValue )
|
||||
|
||||
RETURN hb_bitAnd( nValue, HB_COM_MSR_RI ) != 0
|
||||
|
||||
FUNCTION tp_isdsr( nPort )
|
||||
LOCAL nValue
|
||||
|
||||
IF ! isopenport( nPort )
|
||||
RETURN .F.
|
||||
ENDIF
|
||||
|
||||
RETURN com_DSR( t_aPorts[ nPort, TPFP_HANDLE ] )
|
||||
hb_comMSR( nPort, @nValue )
|
||||
|
||||
RETURN hb_bitAnd( nValue, HB_COM_MSR_DSR ) != 0
|
||||
|
||||
FUNCTION tp_iscts( nPort )
|
||||
LOCAL nValue
|
||||
|
||||
IF ! isopenport( nPort )
|
||||
RETURN .F.
|
||||
ENDIF
|
||||
|
||||
RETURN com_CTS( t_aPorts[ nPort, TPFP_HANDLE ] )
|
||||
hb_comMSR( nPort, @nValue )
|
||||
|
||||
RETURN hb_bitAnd( nValue, HB_COM_MSR_CTS ) != 0
|
||||
|
||||
FUNCTION tp_flush( nPort, nTimeout )
|
||||
|
||||
@@ -694,11 +695,10 @@ STATIC FUNCTION FetchChars( nPort )
|
||||
RETURN 0
|
||||
ENDIF
|
||||
|
||||
cStr := com_read( t_aPorts[ nPort, TPFP_HANDLE ] )
|
||||
cStr := ""
|
||||
hb_comRecv( t_aPorts[ nPort, TPFP_HANDLE ], @cStr )
|
||||
|
||||
IF Len( cStr ) > 0
|
||||
t_aPorts[ nPort, TPFP_INBUF ] += cStr
|
||||
ENDIF
|
||||
t_aPorts[ nPort, TPFP_INBUF ] += cStr
|
||||
|
||||
RETURN Len( cStr )
|
||||
|
||||
@@ -774,12 +774,6 @@ STATIC FUNCTION __TP_INFREE()
|
||||
STATIC FUNCTION __TP_OUTFREE()
|
||||
RETURN -1
|
||||
|
||||
STATIC FUNCTION __TP_CTRLCTS( nPort, nValue )
|
||||
RETURN com_Hard( nPort, iif( ISNUMBER( nValue ), nValue != 0, NIL ), .F. )
|
||||
|
||||
STATIC FUNCTION __TP_CTRLDTR( nPort, nValue )
|
||||
RETURN com_Hard( nPort, iif( ISNUMBER( nValue ), nValue != 0, NIL ), .T. )
|
||||
|
||||
FUNCTION BIN_AND( ... )
|
||||
RETURN HB_BITAND( ... )
|
||||
|
||||
|
||||
@@ -50,28 +50,34 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/* NOTE: This file is also used by C code. */
|
||||
|
||||
#ifndef HB_COM_CH_
|
||||
#define HB_COM_CH_
|
||||
|
||||
#define HB_COM_IFLUSH 1
|
||||
#define HB_COM_OFLUSH 2
|
||||
#define HB_COM_IOFLUSH 3
|
||||
/* HB_COMFLUSH() modes */
|
||||
#define HB_COM_IFLUSH 1
|
||||
#define HB_COM_OFLUSH 2
|
||||
#define HB_COM_IOFLUSH 3
|
||||
|
||||
#define HB_COM_MCR_DTR 0x01 /* Data terminal ready (DTR) TIOCM_DTR */
|
||||
#define HB_COM_MCR_RTS 0x02 /* Request to send (RTS) TIOCM_RTS */
|
||||
#define HB_COM_MCR_OUT1 0x04 /* OUT 1 TIOCM_OUT1 */
|
||||
#define HB_COM_MCR_OUT2 0x08 /* OUT 2 TIOCM_OUT2 */
|
||||
#define HB_COM_MCR_LOOP 0x10 /* LOOP TIOCM_LOOP */
|
||||
/* HB_COMMCR() parameters */
|
||||
#define HB_COM_MCR_DTR 0x01 /* Data terminal ready (DTR) TIOCM_DTR */
|
||||
#define HB_COM_MCR_RTS 0x02 /* Request to send (RTS) TIOCM_RTS */
|
||||
#define HB_COM_MCR_OUT1 0x04 /* OUT 1 TIOCM_OUT1 */
|
||||
#define HB_COM_MCR_OUT2 0x08 /* OUT 2 TIOCM_OUT2 */
|
||||
#define HB_COM_MCR_LOOP 0x10 /* LOOP TIOCM_LOOP */
|
||||
|
||||
#define HB_COM_MSR_DELTA_CTS 0x01 /* DELTA ready to send (DCTS) */
|
||||
#define HB_COM_MSR_DELTA_DSR 0x02 /* DELTA data terminal ready (DDSR) */
|
||||
#define HB_COM_MSR_TERI 0x04 /* Trailing edge RING (TERI) */
|
||||
#define HB_COM_MSR_DELTA_DCD 0x08 /* DELTA data carrier detected (DDCD) */
|
||||
#define HB_COM_MSR_CTS 0x10 /* Clear to send (CTS) TIOCM_CTS */
|
||||
#define HB_COM_MSR_DSR 0x20 /* Data terminal ready (DSR) TIOCM_DSR */
|
||||
#define HB_COM_MSR_RI 0x40 /* RING indicator (RI) TIOCM_RI */
|
||||
#define HB_COM_MSR_DCD 0x80 /* Data carrier detected (DCD) TIOCM_CD */
|
||||
/* HB_COMMSR() parameters */
|
||||
#define HB_COM_MSR_DELTA_CTS 0x01 /* DELTA ready to send (DCTS) */
|
||||
#define HB_COM_MSR_DELTA_DSR 0x02 /* DELTA data terminal ready (DDSR) */
|
||||
#define HB_COM_MSR_TERI 0x04 /* Trailing edge RING (TERI) */
|
||||
#define HB_COM_MSR_DELTA_DCD 0x08 /* DELTA data carrier detected (DDCD) */
|
||||
#define HB_COM_MSR_CTS 0x10 /* Clear to send (CTS) TIOCM_CTS */
|
||||
#define HB_COM_MSR_DSR 0x20 /* Data terminal ready (DSR) TIOCM_DSR */
|
||||
#define HB_COM_MSR_RI 0x40 /* RING indicator (RI) TIOCM_RI */
|
||||
#define HB_COM_MSR_DCD 0x80 /* Data carrier detected (DCD) TIOCM_CD */
|
||||
|
||||
/* HB_COMLSR() parameters */
|
||||
#define HB_COM_LSR_DATA_READY 0x01 /* Data ready */
|
||||
#define HB_COM_LSR_OVERRUN_ERR 0x02 /* Overflow error */
|
||||
#define HB_COM_LSR_PARITY_ERR 0x04 /* Parity error */
|
||||
@@ -80,38 +86,43 @@
|
||||
#define HB_COM_LSR_TRANS_HOLD_EMPTY 0x20 /* Transmission holder register empty */
|
||||
#define HB_COM_LSR_TRANS_EMPTY 0x40 /* TX shift register empty */
|
||||
|
||||
#define HB_COM_FLOW_IRTSCTS 0x01
|
||||
#define HB_COM_FLOW_ORTSCTS 0x02
|
||||
#define HB_COM_FLOW_IDTRDSR 0x04
|
||||
#define HB_COM_FLOW_ODTRDSR 0x08
|
||||
#define HB_COM_FLOW_DCD 0x10
|
||||
#define HB_COM_FLOW_XOFF 0x20 /* XON/XOFF on input */
|
||||
#define HB_COM_FLOW_XON 0x40 /* XON/XOFF on output */
|
||||
/* HB_COMFLOWCONTROL() parameters */
|
||||
#define HB_COM_FLOW_IRTSCTS 0x01
|
||||
#define HB_COM_FLOW_ORTSCTS 0x02
|
||||
#define HB_COM_FLOW_IDTRDSR 0x04
|
||||
#define HB_COM_FLOW_ODTRDSR 0x08
|
||||
#define HB_COM_FLOW_DCD 0x10
|
||||
#define HB_COM_FLOW_XOFF 0x20 /* XON/XOFF on input */
|
||||
#define HB_COM_FLOW_XON 0x40 /* XON/XOFF on output */
|
||||
|
||||
#define HB_COM_FL_OOFF 0x01
|
||||
#define HB_COM_FL_OON 0x02
|
||||
#define HB_COM_FL_IOFF 0x04
|
||||
#define HB_COM_FL_ION 0x08
|
||||
#define HB_COM_FL_SOFT 0x10
|
||||
#define HB_COM_FL_RTSCTS 0x20
|
||||
#define HB_COM_FL_DTRDSR 0x40
|
||||
#define HB_COM_FL_DCD 0x80
|
||||
/* HB_COMFLOWSET() parameters */
|
||||
#define HB_COM_FL_OOFF 0x01
|
||||
#define HB_COM_FL_OON 0x02
|
||||
#define HB_COM_FL_IOFF 0x04
|
||||
#define HB_COM_FL_ION 0x08
|
||||
#define HB_COM_FL_SOFT 0x10
|
||||
#define HB_COM_FL_RTSCTS 0x20
|
||||
#define HB_COM_FL_DTRDSR 0x40
|
||||
#define HB_COM_FL_DCD 0x80
|
||||
|
||||
#define HB_COM_TX_CTS 0x01
|
||||
#define HB_COM_TX_DSR 0x02
|
||||
#define HB_COM_TX_DCD 0x04
|
||||
#define HB_COM_TX_XOFF 0x08
|
||||
#define HB_COM_TX_EMPTY 0x10
|
||||
#define HB_COM_TX_RFLUSH 0x20
|
||||
/* HB_COMOUTPUTSTATE() return values */
|
||||
#define HB_COM_TX_CTS 0x01
|
||||
#define HB_COM_TX_DSR 0x02
|
||||
#define HB_COM_TX_DCD 0x04
|
||||
#define HB_COM_TX_XOFF 0x08
|
||||
#define HB_COM_TX_EMPTY 0x10
|
||||
#define HB_COM_TX_RFLUSH 0x20
|
||||
|
||||
#define HB_COM_RX_XOFF 0x01
|
||||
/* HB_COMINPUTSTATE() return values */
|
||||
#define HB_COM_RX_XOFF 0x01
|
||||
|
||||
#define HB_COM_ERR_WRONGPORT 1
|
||||
#define HB_COM_ERR_CLOSED 2
|
||||
#define HB_COM_ERR_TIMEOUT 3
|
||||
#define HB_COM_ERR_NOSUPPORT 4
|
||||
#define HB_COM_ERR_PARAMVALUE 5
|
||||
#define HB_COM_ERR_BUSY 6
|
||||
#define HB_COM_ERR_OTHER 7
|
||||
/* HB_COMGETERROR() return values */
|
||||
#define HB_COM_ERR_WRONGPORT 1
|
||||
#define HB_COM_ERR_CLOSED 2
|
||||
#define HB_COM_ERR_TIMEOUT 3
|
||||
#define HB_COM_ERR_NOSUPPORT 4
|
||||
#define HB_COM_ERR_PARAMVALUE 5
|
||||
#define HB_COM_ERR_BUSY 6
|
||||
#define HB_COM_ERR_OTHER 7
|
||||
|
||||
#endif /* HB_COM_CH_ */
|
||||
|
||||
@@ -66,7 +66,7 @@ Tool/lib versions used to create this package:
|
||||
OCILIB 3.6.0
|
||||
OpenSSL 1.0.0
|
||||
PostgreSQL 8.4.2-1
|
||||
QT 4.6.2
|
||||
QT 4.6.3
|
||||
WATTCP 2.2.10
|
||||
|
||||
Changes since previous (2.0.0) release:
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
* HB_COMDISCARDCHAR( nPort, nChar | cChar ) --> lSuccess
|
||||
* HB_COMERRORCHAR( nPort, nChar | cChar ) --> lSuccess
|
||||
* HB_COMFLOWCHARS( nPort, nXONchar | cXONchar, nXOFFchar | cXOFFchar ) --> lSuccess
|
||||
* HB_COMFLOWCONTROL( nPort, @iValue, nFlow ) --> lSuccess
|
||||
* HB_COMFLOWCONTROL( nPort, @nOldFlow, nFlow ) --> lSuccess
|
||||
* HB_COMFLOWSET( nPort, nFlow ) --> lSuccess
|
||||
* HB_COMFLUSH( nPort, [ nType = HB_COM_IOFLUSH ] ) --> lSuccess
|
||||
* HB_COMGETDEVICE( nPort ) --> cDeviceName
|
||||
@@ -100,7 +100,7 @@ HB_FUNC( HB_COMERRORCHAR )
|
||||
|
||||
HB_FUNC( HB_COMFLOWCHARS )
|
||||
{
|
||||
hb_retl( hb_comFlowChars( hb_parni( 1 ), HB_ISCHAR( 2 ) ? hb_parc( 2 ) [ 0 ] : hb_parni( 2 ),
|
||||
hb_retl( hb_comFlowChars( hb_parni( 1 ), HB_ISCHAR( 2 ) ? hb_parc( 2 ) [ 0 ] : hb_parni( 2 ),
|
||||
HB_ISCHAR( 3 ) ? hb_parc( 3 ) [ 0 ] : hb_parni( 3 ) ) == 0 );
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ HB_FUNC( HB_COMGETDEVICE )
|
||||
{
|
||||
char buffer[ HB_COM_DEV_NAME_MAX ];
|
||||
const char * name = hb_comGetDevice( hb_parni( 1 ), buffer, sizeof( buffer ) );
|
||||
hb_retc( name );
|
||||
hb_retc( name );
|
||||
}
|
||||
|
||||
HB_FUNC( HB_COMGETERROR )
|
||||
@@ -140,7 +140,7 @@ HB_FUNC( HB_COMGETOSERROR )
|
||||
|
||||
HB_FUNC( HB_COMINIT )
|
||||
{
|
||||
hb_retl( hb_comInit( hb_parni( 1 ), hb_parni( 2 ), HB_ISCHAR( 3 ) ? hb_parc( 3 ) [ 0 ] : 0,
|
||||
hb_retl( hb_comInit( hb_parni( 1 ), hb_parni( 2 ), HB_ISCHAR( 3 ) ? hb_parc( 3 ) [ 0 ] : 0,
|
||||
hb_parni( 4 ), hb_parni( 5 ) ) == 0 );
|
||||
}
|
||||
|
||||
@@ -170,7 +170,7 @@ HB_FUNC( HB_COMMCR )
|
||||
{
|
||||
int iValue = 0;
|
||||
hb_retl( hb_comMCR( hb_parni( 1 ), &iValue, hb_parni( 3 ), hb_parni( 4 ) ) == 0 );
|
||||
hb_storni( 2, iValue );
|
||||
hb_storni( 2, iValue );
|
||||
}
|
||||
|
||||
HB_FUNC( HB_COMMSR )
|
||||
|
||||
@@ -2807,7 +2807,7 @@ char * hb_socketResolveAddr( const char * szAddr, int af )
|
||||
# if defined( HB_HAS_INET_NTOP )
|
||||
char buf[ INET6_ADDRSTRLEN ];
|
||||
szAddr = inet_ntop( AF_INET6, &sin, buf, sizeof( buf ) );
|
||||
#else
|
||||
# else
|
||||
int iTODO;
|
||||
# endif
|
||||
szResult = hb_strdup( szAddr );
|
||||
|
||||
@@ -649,7 +649,7 @@ HB_MAXINT hb_parnintdef( int iParam, HB_MAXINT lDefValue )
|
||||
{
|
||||
HB_STACK_TLS_PRELOAD
|
||||
|
||||
HB_TRACE(HB_TR_DEBUG, ("hb_parnint(%d)", iParam));
|
||||
HB_TRACE(HB_TR_DEBUG, ("hb_parnintdef(%d, %" PFHL "d)", iParam, lDefValue));
|
||||
|
||||
if( iParam >= -1 && iParam <= hb_pcount() )
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user