class CSerial : public CObject |
Factory for a single CPort object.
CSerial is the base class for implementations of serial port factories. It is intended to be overridden by the CSY so that C32 can call in and ask the CSY to create serial ports. In this way the factory is responsible for creating instances of CPort-derived classes for the protocol of the CSY. It also provides query functions, which return general information about the capabilities of the serial protocol implemented by the CSY.
Owned by the CPort object it creates.
Writing derived classes:
The pure virtual NewPortL() and Info() functions must be implemented in derived classes. Serial protocol modules which can take differing action based on the version of the comms server should also override QueryVersionSupported() .
Public Member Functions | |
---|---|
CSerial () | |
~CSerial () | |
void | ConstructL ( RLibrary &) |
void | Info ( TSerialInfo &) |
void | ModuleName ( TDes &) |
CPort * | NewPortL (const TUint ) |
IMPORT_C TSecurityPolicy | PortPlatSecCapability ( TUint ) |
IMPORT_C TBool | QueryVersionSupported (const TVersion &) |
Private Member Functions | |
---|---|
IMPORT_C void | CSerial_Reserved1 () |
Protected Attributes | |
---|---|
TVersion | iVersion |
Private Attributes | |
---|---|
TAny * | iCSerial_Reserved |
CLibUnloader * | iLibUnloader |
IMPORT_C | CSerial | ( | ) |
Default constructor.
Derived classes can implement a NewL() function if they require two-phase construction.
IMPORT_C void | CSerial_Reserved1 | ( | ) | [private, virtual] |
Reserved virtual function.
void | ConstructL | ( | RLibrary & | aLib | ) |
Allocate a CLibrary unloader
RLibrary & aLib | reference to the library to be unloaded in the future |
void | Info | ( | TSerialInfo & | aSerialInfo | ) | [pure virtual] |
Specifies the protocol for getting the information about the serial protocol.
Implementations should fill in the TSerialInfo structure to reflect the protocol's capabilities.
TSerialInfo & aSerialInfo | On return, set to indicate the capabilities of the serial protocol. |
void | ModuleName | ( | TDes & | aName | ) |
Get the module name from the libary reference
TDes & aName | Module name will be written to this descriptor. |
CPort * | NewPortL | ( | const TUint | aUnit | ) | [pure virtual] |
Specifies the protocol for creating a new serial port for the protocol. The comms server calls this function in response to a RComm : Open() call.
Typically, the implementation would call NewL() on the protocol's CPort-based class. Any resources required by the new port object should be done at this stage. If the serial port object cannot be created for any reason, NewPortL() should leave with an appropriate error code.
The interpretation of unit numbers is specific to the particular serial protocol module. However, unit numbers on Symbian OS should be zero-based. For the default built-in serial ports implemented by the serial protocol module ecuart.csy, the unit numbers refer to the hardware ports, with 0 being the first port on the machine. If a second request is made to create a port with a unit number that has already been created and not destroyed, NewPortL() should leave with KErrAlreadyExists.
const TUint aUnit | The unit number to be created. |
IMPORT_C TSecurityPolicy | PortPlatSecCapability | ( | TUint | aPort | ) | const [virtual] |
Retrieve the security policy for a requested port. This base implementation sets the default policy to be an 'AlwaysFail' policy.
TUint aPort | Port number. |
IMPORT_C TBool | QueryVersionSupported | ( | const TVersion & | aVersion | ) | const [virtual] |
Specifies the protocol for checking the supplied TVersion against the protocol's module version.
The default implementation calls User::QueryVersionSupported() to perform the check against the object's iVersion member.
const TVersion & aVersion | The version to be checked. |
TVersion | iVersion | [protected] |
Module version number. The class should initialise this member with its version number from its constructor.
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.