You Are Here:

Community: Wiki

This page was last modified 22:47, 3 November 2008.

TSS000601 - Serial communication over USB on S60 3rd Edition devices

From Forum Nokia Wiki



ID TSS000601 Creation date March 8, 2007
Platform S60 3rd Edition
S60 3rd Edition, FP1
Devices
Category Symbian C++ Subcategory Local connectivity, USB


Keywords (APIs, classes, methods, functions):

Overview

Serial communication over USB on S60 3rd Edition devices

Description

The RComm API can be used to transfer data over USB serial connection. On S60 3rd Edition, loading of physical (PDD) and logical (LDD) device drivers is not required. Only the CSY module ECACM should be loaded.
The port name available for USB communication is usually "ACM::1". Some devices may support multiple ACM ports. The first port (ACM::0) is reserved for fax/modem process, but ACM::1 and onwards can be used in other applications.
A simplified example for initializing the serial port:
    _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 ) );
After this you can read from and write to the port. An application listening to the port should be running on the host (PC).

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditFurlTechnocratiMagnoliaTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZdescriptionQSxEa0E20WikiE20javaE20symbianE5fosE20s60E20maemoE20cE2bE2bE20WikiE20HomeE20WikiE20HelpE20OverviewE20GlossaryE20CreateE20PageE20ProposeE20anE20ArticleE20SpotlightE20TopicE20E2dE20WE52TE20WidgetsE20ProgrammingE20E4canguageE20E2dE20SymbianE20CE2bE2bE20E2dE20OpenE20CE2fCE2bE2bE20E2dE20JavaE20E2dE20FlashE20E4citeE20E2dE20PythonE20WebE20TechnologiesE20E2dE20WE52TE20WidgetsE20E2dE20WidSetsE20ToolsE20andE20SE44KE20CodeE20E45E78amplesE20KnowledgeE20BaseE20TechnologyE20AreasE20SoftwareE20PlatformsE20E44evelopmentE20ProcessE20E3fE3fWikiE20ChineseE20E3fE3fE3fWikiE20JapaneseE20PortugueseE2fBrazilianE20E52ussianE20WhatE20linksE20hereE20UploadE20fileE20SpecialE20pagesE20PrintableE20versionE44ownloadE20asE20PE44FE20GoE20ToE20E2eE2eE2eX qdcZidentifierQSxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2findeE78E2ephpE2fTSS000601E5fE2dE5fSerialE5fcommunicationE5foverE5fUSBE5fonE5fS60E5f3rdE5fE45ditionE5fdevicesX qdcZpublisherQUxhttpE3aE2fE2fswE2enokiaE2ecomE2fidE2fc764fd1cE2d8b06E2d499aE2d9a6aE2d17c3903d5a65E2fforumE5fnokiaE5fcrawlerE5fagentX qdcZtitleQSxTSS000601E20E2dE20SerialE20communicationE20overE20USBE20onE20S60E203rdE20E45ditionE20devicesE20E2dE20ForumE20NokiaE20WikiX qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfnTypeZCommunityContentQ qdcZtypeQUqfnTypeZKnowledgeBaseContentQ qdcZtypeQUqfnTypeZE52esourceQ qdcZtypeQUqfnTypeZTechnicalSolutionQ qdcZtypeQUqfnTypeZWebpageQ qdcZtypeQUqfnTypeZWikiContentQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qrssZdescriptionQSxEa0E20WikiE20javaE20symbianE5fosE20s60E20maemoE20cE2bE2bE20WikiE20HomeE20WikiE20HelpE20OverviewE20GlossaryE20CreateE20PageE20ProposeE20anE20ArticleE20SpotlightE20TopicE20E2dE20WE52TE20WidgetsE20ProgrammingE20E4canguageE20E2dE20SymbianE20CE2bE2bE20E2dE20OpenE20CE2fCE2bE2bE20E2dE20JavaE20E2dE20FlashE20E4citeE20E2dE20PythonE20WebE20TechnologiesE20E2dE20WE52TE20WidgetsE20E2dE20WidSetsE20ToolsE20andE20SE44KE20CodeE20E45E78amplesE20KnowledgeE20BaseE20TechnologyE20AreasE20SoftwareE20PlatformsE20E44evelopmentE20ProcessE20E3fE3fWikiE20ChineseE20E3fE3fE3fWikiE20JapaneseE20PortugueseE2fBrazilianE20E52ussianE20WhatE20linksE20hereE20UploadE20fileE20SpecialE20pagesE20PrintableE20versionE44ownloadE20asE20PE44FE20GoE20ToE20E2eE2eE2eX qfnZdistributionQUxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2fX qfnZtopicQUqfnTopicZconnectivityQRqdcZtypeQUqrdfsZE52esourceQRqmarsZrelevanceQNx100X qfnZtopicQUqfnTopicZusbQRqdcZtypeQUqrdfsZE52esourceQRqmarsZrelevanceQNx100X qfnZtypeQUqfnTypeZCommunityContentQ qfnZtypeQUqfnTypeZKnowledgeBaseContentQ qfnZtypeQUqfnTypeZE52esourceQ qfnZtypeQUqfnTypeZTechnicalSolutionQ qfnZtypeQUqfnTypeZWebpageQ qfnZtypeQUqfnTypeZWikiContentQ qfnZupdatedQDx2008E2d10E2d02X qfnZuserE5ftagQSxconnectivityX qfnZuserE5ftagQSxj2meX qfnZuserE5ftagQSxusbX qfnZuserE5ftagQSxusbX qmarsZdescriptionQSxEa0E20WikiE20javaE20symbianE5fosE20s60E20maemoE20cE2bE2bE20WikiE20HomeE20WikiE20HelpE20OverviewE20GlossaryE20CreateE20PageE20ProposeE20anE20ArticleE20SpotlightE20TopicE20E2dE20WE52TE20WidgetsE20ProgrammingE20E4canguageE20E2dE20SymbianE20CE2bE2bE20E2dE20OpenE20CE2fCE2bE2bE20E2dE20JavaE20E2dE20FlashE20E4citeE20E2dE20PythonE20WebE20TechnologiesE20E2dE20WE52TE20WidgetsE20E2dE20WidSetsE20ToolsE20andE20SE44KE20CodeE20E45E78amplesE20KnowledgeE20BaseE20TechnologyE20AreasE20SoftwareE20PlatformsE20E44evelopmentE20ProcessE20E3fE3fWikiE20ChineseE20E3fE3fE3fWikiE20JapaneseE20PortugueseE2fBrazilianE20E52ussianE20WhatE20linksE20hereE20UploadE20fileE20SpecialE20pagesE20PrintableE20versionE44ownloadE20asE20PE44FE20GoE20ToE20E2eE2eE2eX qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfnTypeZCommunityContentQ qrdfZtypeQUqfnTypeZKnowledgeBaseContentQ qrdfZtypeQUqfnTypeZE52esourceQ qrdfZtypeQUqfnTypeZTechnicalSolutionQ qrdfZtypeQUqfnTypeZWebpageQ qrdfZtypeQUqfnTypeZWikiContentQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ