当前位置: 首页>>代码示例>>PHP>>正文


PHP COM::GetErrorDescription方法代码示例

本文整理汇总了PHP中COM::GetErrorDescription方法的典型用法代码示例。如果您正苦于以下问题:PHP COM::GetErrorDescription方法的具体用法?PHP COM::GetErrorDescription怎么用?PHP COM::GetErrorDescription使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在COM的用法示例。


在下文中一共展示了COM::GetErrorDescription方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: actionCheckComtool

 function actionCheckComtool()
 {
     if (class_exists('COM')) {
         try {
             $objComport = new COM("ActiveXperts.Comport");
             $objComport->Logfile = "C:\\PhpSerialLog.txt";
             $objComport->Device = "COM1";
             $objComport->Baudrate = 9600;
             $objComport->ComTimeout = 1000;
             $objComport->Open();
             print '<br>Check errros of COMport tool using (trying to connect with COM1)';
             if ($objComport->LastError != 0) {
                 if ($objComport->LastError >= 1000 && $objComport->LastError <= 1999) {
                     print '<br>LICENSING ERROR!!!';
                 } else {
                     print '<br>no licensing errors, some errors with com-port connection';
                 }
                 $ErrorNum = $objComport->LastError;
                 $ErrorDes = $objComport->GetErrorDescription($ErrorNum);
                 echo "<br><br>Error sending commands: #{$ErrorNum} ({$ErrorDes}).";
             }
         } catch (Exception $e) {
             print_r($e->getMessage());
         }
         $objComport->Close();
     } else {
         print "Class for work with COM ports is not available";
     }
 }
开发者ID:anton-itscript,项目名称:WM-Web,代码行数:29,代码来源:BugfixController.php

示例2: while

        echo "<BR>";
    }
    echo "Sending 'ATI'...<BR>";
    echo "<BR>";
    $objComport->WriteString("ATI");
    while ($objComport->LastError == 0) {
        echo $objComport->ReadString();
        echo "<BR>";
    }
    echo "Sending 'AT&C0'...<BR>";
    echo "<BR>";
    $objComport->WriteString("AT&C0");
    while ($objComport->LastError == 0) {
        echo $objComport->ReadString();
        echo "<BR>";
    }
} else {
    $ErrorNum = $objComport->LastError;
    $ErrorDes = $objComport->GetErrorDescription($ErrorNum);
    echo "Error sending commands: #{$ErrorNum} ({$ErrorDes}).";
}
echo "Ready.";
$objComport->Close();
?>

   <br>
   <br>
   <hr size="1" color="#707070">
   <font size="1" face="Verdana">This demo uses ActiveXperts Serial Port Component</font>
   </body>
</html>
开发者ID:pcanilho,项目名称:SMSGateway,代码行数:31,代码来源:DummySMS.php


注:本文中的COM::GetErrorDescription方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。