• / 56
  • 下载费用:10 金币  

rc632用户手册.pdf

关 键 词:
rc632用户手册.pdf
资源描述:
READER COMPONENTS HostRdCom - Host to Reader Communication User Rs232* p_Rs232; ProtocolBase* p_PB = NULL; . if( (p_Rs232 = new RS232()) != NULL ) {if( (status = p_Rs232-SetDefaultBaud-rate( 115200 )) == COM_SUCCESS ){if( (status = p_Rs232-SetComPort( 1 )) == COM_SUCCESS ){if( (status = p_Rs232-OpenInterface()) == COM_SUCCESS ){if( (p_PB = new RS232BlockFramingProtocol( *p_Rs232 )) != NULL ){status = MI_OK;}else{status = MI_PROTOCOL_FAILURE;}}}} } else {status = MI_INTERFACE_FAILURE; } . // successful initialization of the interface and the protocol ? if( status == MI_OK ) {// do the work you want } . . // all work is done – release the interface and protocol objects if( p_PB != NULL ) {delete p_PB;p_PB = NULL; } if(p_Rs232 != NULL ) {delete p_Rs232;p_Rs232 = NULL; } . The RS232 communication in the example above uses the COM1 port and a default baud rate of 115 kbaud. Having set the port and the baud rate, the open port command enables the communication and additional parameters e.g. stop bit and parity are set. Additionally, the timeout period for reading and writing are set to their default values.Philips Semiconductors Preliminary Rev. 1.1 November 2001Host To Reader Communication HostRdCom 10 The communication channel and the selected protocol is now fixed and only a pointer to the protocol is needed for communication with the reader (under the pre-condition that the baud rate and used com-port remain the same). Attention has to be paid to the scope of the objects. The interface object has to have a larger scope than the protocol object, because the interface is passed to the constructor of the selected protocol as parameter. When using the protocol during communication with the reader all the interface operations will be carried out by the protocol using the pointer passed in the constructor.Philips Semiconductors Preliminary Rev. 1.1 November 2001Host To Reader Communication HostRdCom 11 The use of the defined RS232 protocol is described in the following sess
展开阅读全文
  微传网所有资源均是用户自行上传分享,仅供网友学习交流,未经上传用户书面授权,请勿作他用。
0条评论

还可以输入200字符

暂无评论,赶快抢占沙发吧。

关于本文
本文标题:rc632用户手册.pdf
链接地址:https://www.weizhuannet.com/p-9812044.html
微传网是一个办公文档、学习资料下载的在线文档分享平台!

微传网博客

网站资源均来自网络,如有侵权,请联系客服删除!

 网站客服QQ:80879498  会员QQ群:727456886

copyright@ 2018-2028 微传网络工作室版权所有

     经营许可证编号:冀ICP备18006529号-1 ,公安局备案号:13028102000124

收起
展开