TEndpointBuffer Class Reference
This class forms part of the Buffer Interface Layer (BIL), which forms the user side component of the USB Shared Chunk Client. Objects of this type represent the shared chunk buffer, for a given endpoint. The method RDevUsbcScClient::OpenEndpoint() should be used to initialise objects of this type.
Public Member Functions |
---|
| TEndpointBuffer() |
IMPORT_C TInt | Close() |
IMPORT_C void | Dump() |
IMPORT_C TInt | Expire() |
IMPORT_C TInt | Expire(TAny *) |
IMPORT_C TInt | GetBuffer(TAny *&, TUint &, TBool &, TRequestStatus &, TUint) |
TInt
| GetBuffer(TUint &, TUint &, TBool &, TRequestStatus &, TUint) |
TInt
| GetEndpointNumber() |
IMPORT_C TInt | GetInBufferRange(TAny *&, TUint &) |
IMPORT_C TInt | GetInBufferRange(TUint &, TUint &) |
IMPORT_C TInt | TakeBuffer(TAny *&, TUint &, TBool &, TRequestStatus &, TUint) |
IMPORT_C TInt | WriteBuffer(TAny *, TUint, TBool, TRequestStatus &) |
IMPORT_C TInt | WriteBuffer(TUint, TUint, TBool, TRequestStatus &) |
Constructor & Destructor Documentation
TEndpointBuffer()
IMPORT_C | TEndpointBuffer | ( | ) | |
Member Functions Documentation
Construct(RDevUsbcScClient *, TUint8 *, const TUsbcScHdrEndpointRecord *, TInt, SUsbcScBufferHeader *)
Expire()
Used in conjunction with TakeBuffer method. This will make the 'oldest' block of data previously read out using the TakeBuffer method, but not already expired, to be released back to the system. This block can then be overwritten with new data, when it becomes available.
Expire(TAny *)
Used in conjunction with TakeBuffer method. This function allows blocks to be expired in a different order from which the user read the data out of the buffer. Note that the system will only reuse blocks up to the point of the oldest non-expired block read. This means that the user must ensure to expire all blocks in a timely manner to prevent the system from running out of usable memory.
Parameters
TAny * aAddress | aAddress is the start address of the block of data previously read by the user which can be overwritten. |
GetBuffer(TAny *&, TUint &, TBool &, TRequestStatus &, TUint)
Read the next block of data from the Shared chunk buffer. This method should be used if the user wishes to process one block of data at a time. This method also expires the previously read block, meaning that the memory used by the block of data may be re-used by the system, overwriting it with new data.
Parameters
TAny *& aBuffer | aBuffer will point to data location in shared chunk |
TUint & aSize | aSize will hold the number of valid bytes that can be read |
TBool & aZLP | aZLP will indicate whether its a short packet or not |
TRequestStatus & aStatus | In case of no data available to be read, aStatus will be passed on to LDD, and user side should wait for asynchronous call ReadDataNotify to return |
TUint aLength = 0 | Not used at the moment |
GetBuffer(TUint &, TUint &, TBool &, TRequestStatus &, TUint)
Read the next block of data from the Shared chunk buffer. This method should be used if the user wishes to process one block of data at a time. This method also expires the previously read block, meaning that the memory used by the block of data may be re-used by the system, overwriting it with new data.
Parameters
TUint & aOffset | aOffset will point to data offset in shared chunk |
TUint & aSize | aSize will hold the number of valid bytes that can be read |
TBool & aZLP | aZLP will indicate whether its a short packet or not |
TRequestStatus & aStatus | In case of no data available to be read, aStatus will be passed on to LDD, and user side should wait for asynchronous call ReadDataNotify to return |
TUint aLength = 0 | Not used at the moment |
GetEndpointNumber()
TInt
| GetEndpointNumber | ( | ) | [inline] |
Used to retrieve the endpoint number for which this object was open on.
GetInBufferRange(TAny *&, TUint &)
For IN endpoints, this method retrieves the geometry for the buffer, for which the caller should stay within, when using the WriteBuffer method.
Parameters
TAny *& aStart | A pointer, which is set to point to the start of the buffer. |
TUint & aSize | An TUint for which the size (in bytes) of buffer, is written into. |
GetInBufferRange(TUint &, TUint &)
For IN endpoints, this method retrieves the geometry for the buffer, for which the caller should stay within, when using the WriteBuffer method.
Parameters
TUint & aStart | A TUint for which the buffer's start offset from the start of the chunk, in written into. |
TUint & aSize | An TUint for which the size (in bytes) of buffer, is written into. |
TakeBuffer(TAny *&, TUint &, TBool &, TRequestStatus &, TUint)
Read the next block of data from the Shared chunk buffer. This method should be used if the user wishes to process more than one block of data simultaneously. The user must call one of the Expire() methods to free the memory used by the block of data, and make it available for new data.
Parameters
TAny *& aBuffer | aBuffer will point to data location in shared chunk |
TUint & aSize | aSize will hold the number of valid bytes that can be read |
TBool & aZLP | aZLP will indicate whether its a short packet or not |
TRequestStatus & aStatus | In case of no data available to be read, aStatus will be passed on to LDD, and user side should wait for asynchronous call ReadDataNotify to return |
TUint aLength = 0 | Not used at the moment |
WriteBuffer(TAny *, TUint, TBool, TRequestStatus &)
Initiates write operation.
Parameters
TAny * aBuffer | aBuffer will point to data in shared chunk to be written out. aBuffer should be aligned |
TUint aSize | aSize will hold the number of valid bytes to be written out |
TBool aZLP | aZLP will indicate whether a ZLP should be transmitted after writing the data out |
TRequestStatus & aStatus | This is an asynchronous function and user side should wait on status to know the end of write operation |
WriteBuffer(TUint, TUint, TBool, TRequestStatus &)
Initiates write operation.
Parameters
TUint aOffset | aOffset will point to offset of data in shared chunk to be written out. |
TUint aSize | aSize will hold the number of valid bytes to be written out |
TBool aZLP | aZLP will indicate whether a ZLP should be transmitted after writing the data out |
TRequestStatus & aStatus | This is an asynchronous function and user side should wait on status to know the end of write operation |
Member Enumerations Documentation
Enum TDir
Enumerators
EValid = KErrNone | |
ENotValid = KErrNotSupported | |
EEOF = KErrEof | |
Member Data Documentation
const TInt KStateChange
const TInt | KStateChange | [static] |
This return value used by GetBuffer indicates that the item pointed to by aBuffer/aOffset represents a state change, instead of endpoint data.
TInt
iBufferNum
associated endpoint number
TUint8 * iBufferStartAddr
TUint8 * | iBufferStartAddr | [private] |
Pointer to the buffer Header for OUT/BI endpoints
RDevUsbcScClient * iClient
buffer number within shared chunk
SUsbcScBufferHeader * iEndpointHdr
The address of the beginning of the Ldd's chunk
TInt
iEndpointNumber
TInt
| iEndpointNumber | [private] |
describes state of endpoint, KErrNone if OUT endpoint and ready to use, KErrNotSupportd if not an OUT endpoint, KErrEoF on alternate setting change
TDir
iOutState
describes state of endpoint, KErrNone if IN endpoint and ready to use, KErrNotSupportd if not an IN endpoint, KErrEof on alternate setting change
TUint
iSize
IN/BI endpoint buffer start address within shared chunk
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.