请求程序注释

kongyanmin 2010-04-14 06:11:48
要求注释详细些

_LIT(CSYMOD, "ECACM");
_LIT(KACMPort1, "ACM::1");
// RComm is a client to the RCommServ Comms server
// Start this service before any connections are made.
TInt ret = StartC32();
if ( ret != KErrNone && ret != KErrAlreadyExists )
{
User::Leave ( ret );
}
// Connect to CommServer
RCommServ server;
User::LeaveIfError( server.Connect() );
// Load CSY Module
User::LeaveIfError( server.LoadCommModule( CSYMOD ) );
TBuf16<KMaxPortName> portName;
portName.Copy( KACMPort1 );
// Open the comm. port
RComm commPort;
User::LeaveIfError( commPort.Open( server, portName, ECommShared ) );
// Verify capabilities of the port and configure it
TCommCaps portCaps;
commPort.Caps( portCaps );
if (((portCaps().iRate & KCapsBps115200) == 0) |
((portCaps().iDataBits & KCapsData8) == 0) |
((portCaps().iStopBits & KCapsStop1) == 0) |
((portCaps().iParity & KCapsParityNone) == 0))
{
User::Leave( KErrNotSupported );
}
TCommConfig portCfg;
commPort.Config( portCfg );
portCfg().iRate = EBps115200;
portCfg().iParity = EParityNone;
portCfg().iDataBits = EData8;
portCfg().iStopBits = EStop1;
portCfg().iHandshake = 0;
User::LeaveIfError( commPort.SetConfig( portCfg ) );

...全文
84 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
kongyanmin 2010-04-17
  • 打赏
  • 举报
回复
谢谢各位了
漁_夫 2010-04-16
  • 打赏
  • 举报
回复
加载驱动时有物理和逻辑驱动,那么_LIT(CSYMOD, "ECACM");_LIT(KACMPort1, "ACM::1");中的CSYMOD是自己定义的吗,还有KACMPort1是不是自定义的,还是系统函数就有的。

红色标记表示这些内容是一定的。。你起名字。随便了。。

另外谁能说说为什么要开启Comms Server呢,小弟不懂Symbian.c++,望见谅
这个你就要研究一下symbian的c/s结构了。。所以如果理解不了。也不用管。这么写就好了
kongyanmin 2010-04-16
  • 打赏
  • 举报
回复
另外谁能说说为什么要开启Comms Server呢,小弟不懂Symbian.c++,望见谅
kongyanmin 2010-04-16
  • 打赏
  • 举报
回复
加载驱动时有物理和逻辑驱动,那么_LIT(CSYMOD, "ECACM");_LIT(KACMPort1, "ACM::1");中的CSYMOD是自己定义的吗,还有KACMPort1是不是自定义的,还是系统函数就有的

漁_夫 2010-04-16
  • 打赏
  • 举报
回复
串口通信原理都一致。。区分不同设备而已
dyw 2010-04-16
  • 打赏
  • 举报
回复
英文注释已经说的很清楚了...
bsr2009 2010-04-15
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 kongyanmin 的回复:]

TCommCaps portCaps;
这是什么呢
[/Quote]
(TCommCaps) The capabilities block is used to inform the client as to whether a specific combination is possible before attempting to implement that particular configuration.
kongyanmin 2010-04-15
  • 打赏
  • 举报
回复
TCommCaps portCaps;
这是什么呢
bsr2009 2010-04-14
  • 打赏
  • 举报
回复
USB串口连接,无非就是加载驱动(LoadCommModule( CSYMOD ) ),打开串口(commPort.Open( server, portName, ECommShared )),设置参数而已。//ACM::1代表USB串口端口

3,120

社区成员

发帖
与我相关
我的任务
社区描述
塞班系统(Symbian系统)是塞班公司为手机而设计的操作系统,它的前身是英国宝意昂公司的 EP ( Electronic Piece of cheese)操作系统。
社区管理员
  • Symbian社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧