由于这些常数和变量类型很可能与其他控件或系统参数相同,
都在 TYbCustomCommDevice 里面定义的,
可以用 TYbCustomCommDevice::TBaudRate 或者 TYbCommDevice::TBaudRate 来定义。
int n = 2; //COM2
TYbCommDevice::TBaudRate b = TYbCommDevice::br115200; //115200 bps
TYbCommDevice::TParity p = TYbCommDevice::ptNoParity; //无奇偶校验
int t = 8; //8 bit 数据
TYbCommDevice::TStopBits s = TYbCommDevice::sbOneStopBit;
TYbCommDevice::TFlowControl f = TYbCommDevice::fcRtsCts; //采用RTS/CTS数据流控
unsigned char a = 3; //电话响3声之后自动应答
YbCommDevice1->PortNo = n;
YbCommDevice1->Baud = b;
YbCommDevice1->Parity = p;
YbCommDevice1->ByteSize = t;
YbCommDevice1->StopBits = s;
YbCommDevice1->FlowControl = f;
YbCommDevice1->AutoAnswer = a;
--------------------next---------------------
阅读(1212) | 评论(0) | 转发(0) |