Join Now
Quality Rating:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)
Expertise Level:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)

This page was last modified 12:38, 24 August 2007.

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

From Forum Nokia Wiki


Subject:

Serial communication over USB on S60 3rd Edition devices

TSS000601

 

Platform(s): Device(s), SW version(s):
S60 3rd Edition
S60 3rd Edition, FP1
 

Category:

Symbian C++

Subcategory:

Local connectivity, USB

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).

Creation date:

March 8, 2007

Last modified:

-
Related Discussions
Thread Thread Starter Forum Replies Last Post
The best nokia mobiles for testing ahmadi2c Mobile Java General 5 2007-04-20 16:04
J2ME Video Streaming bangus Mobile Java Media (Graphics & Sounds) 31 2008-08-14 23:37
create a file 3rd edition; urgent! asmobease Symbian Tools & SDKs 10 2006-09-29 11:13
Connect Series 60 devices through USB prabhubalajishankar Symbian Networking & Messaging 5 2007-02-19 13:20
How To Make The S60 Emulator See My USB Bluetooth Dongle ? Mo7ammed_01 Bluetooth Technology 8 2008-07-16 13:15
 
Powered by MediaWiki
     
     RDF Facets:
     
     
     qfnZtopicQUqfnTopicZconnectivityQ
     qfnZtopicQUqfnTopicZusbQ
     qfnZtypeQUqfnTypeZCommunityContentQ
     qfnZtypeQUqfnTypeZKnowledgeBaseContentQ
     qfnZtypeQUqfnTypeZTechnicalSolutionQ
     qfnZtypeQUqfnTypeZWebpageQ
     qfnZtypeQUqfnTypeZWikiContentQ
     qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX
     
    
            
            RDF Facets:
            
            
                        qfnZuserE5ftagQSxj2meX
                        qfnZuserE5ftagQSxusbX