×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Jun 2006
    Posts
    26

    Lightbulb Class for USB port

    Hi,
    I have not found any documentation or classes related on using the USB on device side. I have searched the S60 3rd Edition SDK for Symbian OS.

    Can a application running on the mobile send data to PC using the USB port ?
    I have found no documnetation regarading the same. Is it something undocumented ?

  2. #2
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: Class for USB port


  3. #3
    Registered User
    Join Date
    Jun 2006
    Posts
    26

    Re: Class for USB port

    Thanks skumar_rao, do you have any sample code for reading and writing over usb from mobile device........or any refrance code............please let know the links for the same..............

  4. #4
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: Class for USB port

    There are no Examples available that are released by Nokia till now.

  5. #5
    Registered User
    Join Date
    Jun 2006
    Posts
    26

    Re: Class for USB port

    Hi SunilKumar,
    Is there anyway we can have dialog (communication) between the program running on mobile and program running on PC, provided that mobile is connected to PC via cable only.
    Thanks for all.....

  6. #6
    Super Contributor
    Join Date
    Aug 2005
    Location
    india
    Posts
    2,078

    Re: Class for USB port

    hi,

    patil there is a detailed description AFAIK in the book PC connectivity and communication Programming by Some author of symbian press...

    Will be a good reference to program for pc to devices..

    Regards,
    Mateen Maldar
    "Whatever the mind can conceive and believe, the mind can achieve"

  7. #7
    Registered User
    Join Date
    Jun 2006
    Posts
    26

    Re: Class for USB port

    The book about which you are talking looks to be discusing only on SCOM and mRouter......it is also seen that there is no update on PC Connectivity for the Symbian OS above 7.1.............at this moment I am trying out the connectivity possibility with RCOMM with GlassTerm example code as reference but till now no luck.......I am not able to diploy the GlassTerm to device.

  8. #8
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: Class for USB port

    Quote Originally Posted by patil_ruturaj
    Hi SunilKumar,
    Is there anyway we can have dialog (communication) between the program running on mobile and program running on PC, provided that mobile is connected to PC via cable only.
    Thanks for all.....
    The Best way i see id the over TCP. but you can use Bluetooth also. The nokia Connectivity SDK may help you developing some Apps for the same.

  9. #9
    Registered User
    Join Date
    Jun 2006
    Posts
    26

    Re: Class for USB port

    Hi,
    Have modified the Glass Term example...and could get it diployed over the mobile (Nokia 3250) but I am not receiving any data on my hyperterminal which is listening to COM4 port.

    I have pasted the code below which I hope will send data over the serial port on the mobile.....if you find any thing missing in the code please let me know.....

    When I use the emulator I can see data reaching the port.........

    const TInt KBufSize (512);
    _LIT(LDD_NAME,"ECOMM"); //ECOMM

    #if defined (__WINS__)
    _LIT(PDD_NAME,"ECDRV");
    #else
    _LIT(PDD_NAME,"EUART1"); //ECUART
    #endif

    _LIT(RS232,"ECUART");
    _LIT8(KFAXMODEM,"FaxModem" );
    _LIT8(KRutu,"Ruturaj ");
    _LIT(KColons,"::");

    // Load the drivers
    //Load EUART1 as physical device driver
    TInt r = User::LoadPhysicalDevice (PDD_NAME);
    if (r != KErrNone && r != KErrAlreadyExists)
    User::Leave (r);
    //Load ECOMM as Logical device driver
    r = User::LoadLogicalDevice(LDD_NAME);
    if (r != KErrNone && r != KErrAlreadyExists)
    User::Leave (r);

    //Start the service
    r = StartC32 ();
    if (r != KErrNone && r != KErrAlreadyExists)
    User::Leave (r);

    //Kill the FaxModem which will be occuping the COMM::0 port.
    TBuf8<50> buf;
    TFullName repName;
    TFindProcess process;
    while(process.Next(repName) != KErrNotFound)
    {
    buf.Copy(repName);
    if ( (buf.Find(KFAXMODEM) != KErrNotFound) )
    {
    RProcess aProcess;
    aProcess.Open(process);
    aProcess.Kill(0);
    aProcess.Close();
    }
    }

    // Connect the server
    RCommServ server;
    User::LeaveIfError (server.Connect());

    //Load the ECUART module
    r = server.LoadCommModule(RS232);
    User::LeaveIfError (r);

    //Get the number ports avaliable
    TInt numPorts;
    r = server.NumPorts (numPorts);
    User::LeaveIfError (r);

    //Get the information related to all the ports avalible
    TSerialInfo portInfo;
    TBuf16 < 12 > moduleName;
    for (TInt index=0 ; index < numPorts ; index++)
    {
    r = server.GetPortInfo (index, moduleName, portInfo);
    User::LeaveIfError (r);
    }

    TBuf16 < KMaxPortName + 4 > portName;
    portName.Num (portInfo.iLowUnit); // put in the port number in ASCII
    portName.Insert (0, KColons); // stick in a couple of colons
    portName.Insert (0, portInfo.iName); // and lead off with the iName

    //Open the avaliable port
    RComm commPort;
    r = commPort.Open (server, portName, ECommExclusive);
    User::LeaveIfError (r);
    TCommCaps ourCapabilities;
    commPort.Caps (ourCapabilities);
    TCommConfig portSettings;
    commPort.Config (portSettings);

    if (((ourCapabilities ().iRate & KCapsBps115200) == 0) ||
    ((ourCapabilities ().iDataBits & KCapsData8) == 0) ||
    ((ourCapabilities ().iStopBits & KCapsStop1) == 0) ||
    ((ourCapabilities ().iParity & KCapsParityNone) == 0))
    {
    portSettings ().iRate = EBps115200;
    portSettings ().iParity = EParityNone;
    portSettings ().iDataBits = EData8;
    portSettings ().iStopBits = EStop1;
    }
    else
    {
    portSettings ().iRate = EBps19200;
    portSettings ().iParity = EParityNone;
    portSettings ().iDataBits = EData8;
    portSettings ().iStopBits = EStop1;
    }
    portSettings ().iFifo = EFifoEnable;
    portSettings ().iHandshake = KConfigFailDSR; // for no handshaking
    portSettings ().iTerminator[0] = 10;
    portSettings ().iTerminatorCount = 1;
    r = commPort.SetConfig (portSettings);
    User::LeaveIfError (r);
    // now turn on DTR and RTS, and set our buffer size

    commPort.SetSignals (KSignalDTR, 0);
    commPort.SetSignals (KSignalRTS, 0);

    TRequestStatus keyStat;
    TKeyCode key;
    TPtrC8 outputByte ((TUint8 *) & key, 1);
    TBuf8 < KBufSize > localInputBuffer;

    for (TInt index=0 ; index < 100; index++)
    {
    TRequestStatus stat;
    commPort.Write (stat,KRutu);
    User::WaitForRequest (stat);
    r = stat.Int ();
    }

    commPort.Close ();
    server.Close ();

Similar Threads

  1. Issue when trying to generate .sis file
    By rmulam in forum Symbian Tools & SDKs
    Replies: 9
    Last Post: 2009-08-13, 14:10
  2. Replies: 2
    Last Post: 2007-03-14, 17:15
  3. definition of class method outside class body?
    By advocatee in forum Symbian
    Replies: 2
    Last Post: 2003-07-02, 07:09
  4. Exceptions while loading application
    By avinash_rs in forum Mobile Java General
    Replies: 0
    Last Post: 2003-06-09, 10:53
  5. RS232 port in Nokia9210
    By hanusiak in forum PersonalJava
    Replies: 3
    Last Post: 2002-10-08, 06:05

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×