Serial port problem

Login to reply to this topic.
Mon, 2005-09-05 07:29
Joined: 2005-08-01
Forum posts: 44
hi,
i am trying to open a serial port for RS232 so that i can send/receive data, i tested glassterm example but it didn't work on my Nokia 6600 and 3650. The problem is that once a serial port is opened (COMM::0) the application cannot configure port settings, it returned with error code -5 (KErrNotSupported). BTW, i already set the serial port in my pc to the required configuration (19200 bps 8 bits no parity 1 stop).

Also the strange thing is that when GetPortInfo(moduleName, Info) is called, the return Info is filled with BTCOMM although moduleName is set to ECUART.CSY. In order to open serial ports for RS232 (e.g COMM) i have to use direct method GetPortInfo(index, moduleName,info).

Is there anyone who can help me with this ? Or is there anyone who can run glassterm example without errors ?

Thu, 2006-01-26 09:30
Joined: 2005-11-03
Forum posts: 3
Re: Serial port problem
Hi!
I'm trying to receive data calls with nokia 6680.
My problem is that in the mobile phone there aren't any csy modules. In symbian documentation is said that they are in the path System/libs of any driver. Have you got this modules in the mobile phone?
Can you pass me them?
Thanks
Thu, 2006-01-26 10:20
Joined: 2005-03-04
Forum posts: 176
Re: Serial port problem
@laurilla
What the matter? Documentation said:

Code:
How to open ports
There are a number of distinct steps which it is necessary to take before using a serial port. While the first three of these steps will usually have been taken before any communication software loads up, they are all listed here for completeness to avoid any appearance of complexity in the example code.

Load the physical device driver, which interacts directly with the hardware at the lowest level.

Load the logical device driver, which provides the comms server with a consistent interface to the hardware. You should note that both these drivers have automatic .PDD and .LDD file extensions added by their respective loaders, which automatically search the /System/Libs directories on all drives.

Since RComm is to be a client to the RCommServ comms server, start this service before any attempt is made to connect to it. Note that it is only after the device drivers are both in place that it makes sense to start the comms server.

Connect the RComm client to the server. This, and both the following steps, must usually be taken by all software which instantiates an RComm object.

Ask the server to use a specific comms module by name. These .CSY files are protocol modules that let the server know how it should handle the port. For instance, sample terminal code uses a standard RS232 module called ECUART, while infra-red code uses a completely different IrDA module called IrCOMM.

Finally, open the comms port by name using RComm:Open(). You must specify the name of the port, since there is no reason why a machine with suitable hardware canÂ’t have more than one serial port open at a time.

#define PDD_NAME _L("EUART1")
#define LDD_NAME _L("ECOMM")
User::LoadPhysicalDevice (PDD_NAME); // step 1
User::LoadLogicalDevice (LDD_NAME); // step 2
StartC32 (); // step 3
RCommServ server;
server.Connect (); // step 4
server.LoadCommModule (_L ("ECUART")); // step 5
RComm commPort;
commPort.Open (server, _L ("COMM::0"), ECommExclusive); // step 6

--------------------------------------------------------------------------------

Note
While the error checking is omitted from this extract as usual, even production code can safely ignore KErrAlreadyExists errors on loading any of the three driver modules.

This code will working with 6680 and 6600 (3650 i've didnt tried). But don't open the port exclusive. You should try it with shared.

@irmatan82
I don't think that you can reconfigure the portsettings, cause they are needed for the communication to the internal GSM/GPRS-modem.
I don't know about the glassterm example, but i'm interested in! Where do you got it from? Nokia, Symbian or Sony-Ericson?

regards
-CG
  • Login to reply to this topic.