Option Strict Off
Option Explicit On

Module basPCardRW32
    '*****************************************************************************
    '        Copyright (c) 2010 Panasonic System Networks Co., Ltd.
    '
    '        basPCardRW32.bas -- PCardRW32.dll を使うための標準モジュール
    '
    '        更新   2010.02.15    パナソニック システムネットワークス株式会社
    '
    '*****************************************************************************


    ' DLL-定数 定義宣言
    Public Const RET_CRW_SUCCESS As Short = 0
    Public Const RET_CRW_ACK As Short = 0
    Public Const RET_CRW_RESPONSE As Short = 0
    Public Const RET_CRW_FAILURE As Short = 1
    Public Const RET_CRW_NAK As Short = 1
    Public Const RET_CRW_READY As Short = 1
    Public Const RET_CRW_BUSY As Short = 2

    Public Const RET_CRW_ERR_PARAM As Short = 100
    Public Const RET_CRW_ERR_PORT As Short = 101
    Public Const RET_CRW_ERR_RES_TIMEOUT As Short = 110
    Public Const RET_CRW_ERR_CTS_TIMEOUT As Short = 111
    Public Const RET_CRW_ERR_DSR As Short = 112
    ' 下位バージョンとの互換性の為
    Public Const RET_CRW_ERR_DSR_TIMEOUT As Short = 112
    Public Const RET_CRW_ERR_BUSY_TIMEOUT As Short = 113
    Public Const RET_CRW_ERR_BCC_RETRY As Short = 120
    Public Const RET_CRW_ERR_BUFFEROVER As Short = 130
    Public Const RET_CRW_ERR_BUSY As Short = 140

    Public Const RET_CRW_ERR_COMM_WRITE As Short = 200
    Public Const RET_CRW_ERR_COMM_READ As Short = 201

    ' イベント定数 定義
    Public Const EVT_RSP_CRW_RESPONSE As Integer = &H1
    Public Const EVT_RSP_CRW_READY As Integer = &H2
    Public Const EVT_RSP_CRW_BUSY As Integer = &H4
    Public Const EVT_RSP_CRW_CANCELED As Integer = &H8
    Public Const EVT_RSP_CRW_ERR_RES_TIMEOUT As Integer = &H100
    Public Const EVT_RSP_CRW_ERR_CTS_TIMEOUT As Integer = &H200
    Public Const EVT_RSP_CRW_ERR_DSR As Integer = &H400
    Public Const EVT_RSP_CRW_ERR_BCC_RETRY As Integer = &H800
    Public Const EVT_RSP_CRW_ERR_COMM_WRITE As Integer = &H1000
    Public Const EVT_RSP_CRW_ERR_COMM_READ As Integer = &H2000
    Public Const EVT_RSP_CRW_ALL As Integer = &HFFFFFFFF

    Public Const EVT_BIN_CRW_RESPONSE As Integer = &H1
    Public Const EVT_BIN_CRW_CANCELED As Integer = &H8
    Public Const EVT_BIN_CRW_ERR_RES_TIMEOUT As Integer = &H100
    Public Const EVT_BIN_CRW_ERR_CTS_TIMEOUT As Integer = &H200
    Public Const EVT_BIN_CRW_ERR_DSR As Integer = &H400
    Public Const EVT_BIN_CRW_ERR_BCC_RETRY As Integer = &H800
    Public Const EVT_BIN_CRW_ERR_COMM_WRITE As Integer = &H1000
    Public Const EVT_BIN_CRW_ERR_COMM_READ As Integer = &H2000
    Public Const EVT_BIN_CRW_ALL As Integer = &HFFFFFFFF

    Public Const EVT_BCC_CRW_RESPONSE As Integer = &H1
    Public Const EVT_BCC_CRW_CANCELED As Integer = &H8
    Public Const EVT_BCC_CRW_ERR_RES_TIMEOUT As Integer = &H100
    Public Const EVT_BCC_CRW_ERR_CTS_TIMEOUT As Integer = &H200
    Public Const EVT_BCC_CRW_ERR_DSR As Integer = &H400
    Public Const EVT_BCC_CRW_ERR_BCC_RETRY As Integer = &H800
    Public Const EVT_BCC_CRW_ERR_COMM_WRITE As Integer = &H1000
    Public Const EVT_BCC_CRW_ERR_COMM_READ As Integer = &H2000
    Public Const EVT_BCC_CRW_ALL As Integer = &HFFFFFFFF

    Public Const EVT_CRW_RXCHAR As Integer = &H1
    Public Const EVT_CRW_TXEMPTY As Integer = &H4
    Public Const EVT_CRW_CANCELED As Integer = &H8
    Public Const EVT_CRW_ERR_FRAME As Integer = &H100
    Public Const EVT_CRW_ERR_OVERRUN As Integer = &H200
    Public Const EVT_CRW_ERR_PARITY As Integer = &H400
    Public Const EVT_CRW_CTS As Integer = &H1000
    Public Const EVT_CRW_DSR As Integer = &H2000
    Public Const EVT_CRW_RLSD As Integer = &H4000
    Public Const EVT_CRW_BREAK As Integer = &H8000
    Public Const EVT_CRW_RING As Integer = &H10000
    Public Const EVT_CRW_ALL As Integer = &HFFFFFFFF

End Module