2010-06-28 17:22 UTC+0300 Mindaugas Kavaliauskas (dbtopas/at/dbtopas.lt)

* harbour/include/hbcom.ch
  * harbour/rtl/hbcom.c
    * implemented new error code HB_COM_ALREADYOPEN in hb_comOpen()
  * harbour/contrib/hbct/ctcom1.c
    * changed COM_OPEN() behaviour to be compatible with HBCOM API 
      and original CT behaviour
This commit is contained in:
Mindaugas Kavaliauskas
2010-06-28 14:23:11 +00:00
parent cd96854d12
commit 8d2c665f98
4 changed files with 24 additions and 11 deletions

View File

@@ -16,6 +16,14 @@
The license applies to all entries newer than 2009-04-28.
*/
2010-06-28 17:22 UTC+0300 Mindaugas Kavaliauskas (dbtopas/at/dbtopas.lt)
* harbour/include/hbcom.ch
* harbour/rtl/hbcom.c
* implemented new error code HB_COM_ALREADYOPEN in hb_comOpen()
* harbour/contrib/hbct/ctcom1.c
* changed COM_OPEN() behaviour to be compatible with HBCOM API
and original CT behaviour
2010-06-28 10:58 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* config/win/msvc.mk
! Fixed HB_BUILD_SHARED=yes mode for msvc.

View File

@@ -387,11 +387,12 @@ HB_FUNC( COM_INIT )
*/
HB_FUNC( COM_OPEN )
{
int iPort = hb_parni( 1 );
/* TODO: add support for <nBufferIn> */
/* TODO: add support for <nBufferOut> */
/* TODO: add support for <lTrapMode> */
hb_retl( hb_comOpen( hb_parni( 1 ) ) != -1 );
hb_comClose( iPort );
hb_retl( hb_comOpen( iPort ) != -1 );
}
/* COM_CLOSE( <nComPort> ) -> <lClosed>

View File

@@ -124,5 +124,6 @@
#define HB_COM_ERR_PARAMVALUE 5
#define HB_COM_ERR_BUSY 6
#define HB_COM_ERR_OTHER 7
#define HB_COM_ERR_ALREADYOPEN 8
#endif /* HB_COM_CH_ */

View File

@@ -1187,9 +1187,10 @@ int hb_comOpen( int iPort )
if( pCom )
{
if( pCom->status & HB_COM_OPEN )
hb_comClose( iPort );
if( ( pCom->status & HB_COM_OPEN ) == 0 )
{
hb_comSetError( pCom, HB_COM_ERR_ALREADYOPEN );
}
else
{
char buffer[ HB_COM_DEV_NAME_MAX ];
const char * name = hb_comGetName( pCom, buffer, sizeof( buffer ) );
@@ -1874,9 +1875,10 @@ int hb_comOpen( int iPort )
if( pCom )
{
if( pCom->status & HB_COM_OPEN )
hb_comClose( iPort );
if( ( pCom->status & HB_COM_OPEN ) == 0 )
{
hb_comSetError( pCom, HB_COM_ERR_ALREADYOPEN );
}
else
{
char buffer[ HB_COM_DEV_NAME_MAX ];
const char * szName = hb_comGetName( pCom, buffer, sizeof( buffer ) );
@@ -2659,9 +2661,10 @@ int hb_comOpen( int iPort )
if( pCom )
{
if( pCom->status & HB_COM_OPEN )
hb_comClose( iPort );
if( ( pCom->status & HB_COM_OPEN ) == 0 )
{
hb_comSetError( pCom, HB_COM_ERR_ALREADYOPEN );
}
else
{
char buffer[ HB_COM_DEV_NAME_MAX ];
const char * pszName = hb_comGetName( pCom, buffer, sizeof( buffer ) );