/// <summary>売上データA送信</summary>
        public CardMachineErrorClass RmSendSellA(RmSendSellAParamClass Param)
        {
            int ret = -1;

            try
            {
                IntPtr ptr = Marshal.AllocCoTaskMem(Marshal.SizeOf(Param.stsendsaledatainf));
                Marshal.StructureToPtr(Param.stsendsaledatainf, ptr, false);

                ret = TCSPOS110PWrapperClass.RmSendSellA(ref port_hndl,
                                                         ptr,
                                                         Param.datacount,
                                                         Param.services,
                                                         Param.sales,
                                                         Param.paddflag,
                                                         Param.dmflag);

                Marshal.DestroyStructure(ptr, typeof(StSendSaleDataInf));
                Marshal.FreeCoTaskMem(ptr);
            }
            catch
            {
                throw;
            }

            return(ErrorCodeCheck(ret));
        }
        /// <summary>モード要求</summary>
        public CardMachineErrorClass RmGetMode(RmGetModeParamClass Param)
        {
            int ret = -1;

            try
            {
                ret = TCSPOS110PWrapperClass.RmGetMode(ref port_hndl,
                                                       ref Param.mrate,
                                                       ref Param.gpoint,
                                                       ref Param.special,
                                                       ref Param.service,
                                                       ref Param.sprint,
                                                       ref Param.exchange,
                                                       ref Param.division,
                                                       ref Param.rank,
                                                       ref Param.birthday,
                                                       ref Param.ncard,
                                                       ref Param.tcard,
                                                       ref Param.reserve
                                                       );
            }
            catch
            {
                throw;
            }

            return(ErrorCodeCheck(ret));
        }
        /// <summary>カードデータA要求</summary>
        public CardMachineErrorClass RmGetCardDataA(RmGetCardDataAParamClass Param)
        {
            int ret = -1;

            try
            {
                ret = TCSPOS110PWrapperClass.RmGetCardDataA(ref port_hndl,
                                                            Param.cardid,
                                                            ref Param.rank,
                                                            ref Param.ownpoint,
                                                            ref Param.ownbalance,
                                                            Param.issuedate,
                                                            ref Param.usecount,
                                                            Param.usedate,
                                                            Param.limit,
                                                            Param.plimit,
                                                            ref Param.expired,
                                                            ref Param.ctype,
                                                            ref Param.pflag,
                                                            Param.birthday,
                                                            ref Param.birthdayplag,
                                                            ref Param.luckplag,
                                                            ref Param.memlist,
                                                            Param.namedata);
            }
            catch
            {
                throw;
            }

            return(ErrorCodeCheck(ret));
        }
        /// <summary>モデム起動モード送信</summary>
        public CardMachineErrorClass RmSendModem()
        {
            int ret = -1;

            try
            {
                ret = TCSPOS110PWrapperClass.RmSendModem(ref port_hndl);
            }
            catch
            {
                throw;
            }

            return(ErrorCodeCheck(ret));
        }
        /// <summary>取引データ要求</summary>
        public CardMachineErrorClass RmGetICM(RmGetICMParamClass Param)
        {
            int ret = -1;

            try
            {
                ret = TCSPOS110PWrapperClass.RmGetICM(ref port_hndl, Param.filename);
            }
            catch
            {
                throw;
            }

            return(ErrorCodeCheck(ret));
        }
        /// <summary>名前データ送信</summary>
        public CardMachineErrorClass RmSendName(RmSendNameParamClass Param)
        {
            int ret = -1;

            try
            {
                ret = TCSPOS110PWrapperClass.RmSendName(ref port_hndl, Param.namedata);
            }
            catch
            {
                throw;
            }

            return(ErrorCodeCheck(ret));
        }
        /// <summary>交換データ送信</summary>
        public CardMachineErrorClass RmSendExchnge(RmSendExchngeParamClass Param)
        {
            int ret = -1;

            try
            {
                ret = TCSPOS110PWrapperClass.RmSendExchnge(ref port_hndl, Param.chgpoint);
            }
            catch
            {
                throw;
            }

            return(ErrorCodeCheck(ret));
        }
        //--------------------------------------------------
        // カード機制御命令
        //--------------------------------------------------
        #region カード機制御命令
        /// <summary>通信ポートオープン</summary>
        public CardMachineErrorClass OpenPort(OpenPortParamClass Param)
        {
            int ret = -1;

            try
            {
                ret = TCSPOS110PWrapperClass.OpenPort(ref port_hndl, Param.ComPort, Param.Baud);
            }
            catch
            {
                throw;
            }

            return(ErrorCodeCheck(ret));
        }
        /// <summary>通信ポートクローズ</summary>
        public CardMachineErrorClass ClosePort()
        {
            int ret = 0;

            try
            {
                if ((int)port_hndl != -1)
                {
                    ret = TCSPOS110PWrapperClass.ClosePort(ref port_hndl);
                }
            }
            catch
            {
                throw;
            }

            return(ErrorCodeCheck(ret));
        }
        /// <summary>サービスメッセージ送信</summary>
        public CardMachineErrorClass RmSendMessageData(RmSendMessageDataParamClass Param)
        {
            int ret = -1;

            try
            {
                ret = TCSPOS110PWrapperClass.RmSendMessageData(ref port_hndl,
                                                               Param.memory,
                                                               Param.block,
                                                               Param.msg1,
                                                               Param.msg2,
                                                               Param.msg3);
            }
            catch
            {
                throw;
            }

            return(ErrorCodeCheck(ret));
        }
        /// <summary>バージョンデータ要求</summary>
        public CardMachineErrorClass RmGetVersion(RmGetVersionParamClass Param)
        {
            int ret = -1;

            try
            {
                ret = TCSPOS110PWrapperClass.RmGetVersion(ref port_hndl,
                                                          ref Param.tmcode,
                                                          ref Param.sfver,
                                                          ref Param.mkmode,
                                                          ref Param.card,
                                                          ref Param.mcard,
                                                          ref Param.reserve2);
            }
            catch
            {
                throw;
            }

            return(ErrorCodeCheck(ret));
        }
        /// <summary>演算データA要求</summary>
        public CardMachineErrorClass RmGetCalcA(RmGetCalcAParamClass Param)
        {
            int ret = -1;

            try
            {
                ret = TCSPOS110PWrapperClass.RmGetCalcA(ref port_hndl,
                                                        ref Param.point,
                                                        ref Param.chgflag,
                                                        ref Param.chgpoint,
                                                        ref Param.tmoney,
                                                        ref Param.tolpoint,
                                                        ref Param.ownbalance,
                                                        ref Param.usecout);
            }
            catch
            {
                throw;
            }

            return(ErrorCodeCheck(ret));
        }
        /// <summary>ステータス要求</summary>
        public CardMachineErrorClass RmGetStatus(RmGetStatusParamClass Param)
        {
            int ret = -1;

            try
            {
                ret = TCSPOS110PWrapperClass.RmGetStatus(ref port_hndl,
                                                         ref Param.card,
                                                         ref Param.rwsStatus,
                                                         ref Param.mvmode,
                                                         ref Param.icStatus,
                                                         ref Param.datanum,
                                                         ref Param.datamax,
                                                         ref Param.errcode
                                                         );
            }
            catch
            {
                throw;
            }

            return(ErrorCodeCheck(ret));
        }