私は、シリアルRS232を介してコマンドを受信する必要があるFASTRACKSUPREMEに基づいたプロジェクトに取り組んでいます。The
問題は次のとおりです。HyperTermを使用すると、コマンドATDxxxxxxxxx; 正常に動作します。CVI RS232ライブラリを使用しても、何も起こりません。私のコマンドがブロックされたままになる可能性はありますか
シリアルバッファ?これが私のコードです:
#include <ansi_c.h>
#include <cvirte.h>
#include <userint.h>
#include <rs232.h>
#include <utility.h>
#include <formatio.h>
#include <string.h>
int configurePort(void);
int sendCommand(void);
int port_open;
int error;
int main()
{
configurePort();
sendCommand ();
return 0;
}
int configurePort()
{
port_open = 0;
error = OpenComConfig (4, "COM4",115200 ,0,8,1,0, -1);
if (error)
{
printf("Error!\n");
}
if (error == 0)
{
port_open = 1;
SetXMode (4, 0);
SetCTSMode (4, 0);
SetComTime (4, 0);
}
return 0;
}
int sendCommand ()
{
char bufferWrite[100] ;
Fmt(bufferWrite,"%s","ATD0040761768027;");
ComWrt(4, bufferWrite, 18);
return 0;
}
問題はどこだ?助けてください!ありがとう。