UsbDescriptorParser Class Reference

class UsbDescriptorParser

The Symbian USB Descriptor Parsing Framework class.

This class is to aid users of USBDI by providing the facilities to parse the raw descriptor data into wrapper classes that allow access to the fields in the descriptor bodies, and pointers to map the serial data blob into the tree structure that descriptors logically have.

Intended to be available to 3rd parties later

Member Functions Documentation

BuildTreeL(TUsbGenericDescriptor &, TUsbGenericDescriptor &)

void BuildTreeL ( TUsbGenericDescriptor & aNewDesc,
TUsbGenericDescriptor & aPreviousDesc
) [private, static]

Parameters

TUsbGenericDescriptor & aNewDesc
TUsbGenericDescriptor & aPreviousDesc

FindParserAndParseAndCheckL(TPtrC8 &, TUsbGenericDescriptor *)

TUsbGenericDescriptor * FindParserAndParseAndCheckL ( TPtrC8 & aUsbDes,
TUsbGenericDescriptor * aPreviousDesc
) [private, static]

Parameters

TPtrC8 & aUsbDes
TUsbGenericDescriptor * aPreviousDesc

FindParserAndParseL(TPtrC8 &, TUsbGenericDescriptor *)

TUsbGenericDescriptor * FindParserAndParseL ( TPtrC8 & aUsbDes,
TUsbGenericDescriptor * aPreviousDesc
) [private, static]

Parameters

TPtrC8 & aUsbDes
TUsbGenericDescriptor * aPreviousDesc

FindSuitableParentL(TUsbGenericDescriptor &, TUsbGenericDescriptor &)

TUsbGenericDescriptor & FindSuitableParentL ( TUsbGenericDescriptor & aNewDesc,
TUsbGenericDescriptor & aTopParent
) [private, static]

Parameters

TUsbGenericDescriptor & aNewDesc
TUsbGenericDescriptor & aTopParent

Parse(const TDesC8 &, TUsbGenericDescriptor *&)

IMPORT_C TInt Parse ( const TDesC8 & aUsbDes,
TUsbGenericDescriptor *& aDesc
) [static]

The main parsing function of the USB descriptor parsing framework.

This will perform a best effort parse of a USB descriptor tree. It is best effort in the fact that upon encountering a form of syntatic corruption in the source data it will error the parse attempt, but also return the incomplete descriptor tree up to the parsing error.

Parameters

const TDesC8 & aUsbDes The source data that will be parsed.
TUsbGenericDescriptor *& aDesc The pointer that will be updated to the top-level descriptor.

ParseDescriptorTreeL(TPtrC8 &, TUsbGenericDescriptor &)

void ParseDescriptorTreeL ( TPtrC8 & aUsbDes,
TUsbGenericDescriptor & aPreviousDesc
) [private, static]

Parameters

TPtrC8 & aUsbDes
TUsbGenericDescriptor & aPreviousDesc

RegisterCustomParserL(TUsbDescriptorParserL)

IMPORT_C void RegisterCustomParserL ( TUsbDescriptorParserL aParserFunc ) [static]

The function to register a custom parsing routine in the USB descriptor parser framework.

The routine is registered locally to the current thread, and so if an application wishes to perform the same custom parsing in multiple threads, it must call this function with the appropriate routine in each thread context.

If the custom routine becomes unapplicable after being registered, the application may unregister it using the UsbDescriptorParser::UnregisterCustomParser function. UsbDescriptorParser::UnregisterCustomParser

Parameters

TUsbDescriptorParserL aParserFunc The routine which will be added to the USB descriptor parsing framework.

UnknownUsbDescriptorParserL(TPtrC8 &, TUsbGenericDescriptor *)

TUsbGenericDescriptor * UnknownUsbDescriptorParserL ( TPtrC8 & aUsbDes,
TUsbGenericDescriptor * aPreviousDesc
) [private, static]

Parameters

TPtrC8 & aUsbDes
TUsbGenericDescriptor * aPreviousDesc

UnregisterCustomParser(TUsbDescriptorParserL)

IMPORT_C void UnregisterCustomParser ( TUsbDescriptorParserL aParserFunc ) [static]

The function to unregister a custom parsing routine in the USB descriptor parser framework.

This routine will only unregister the routine from the current thread context. If the routine is registered in multiple threads and it is no longer wanted in any thread, an application must call this function in each thread context that the routine is registered.

It is safe to call this function even if RegisterCustomParserL has never been called successfully.

UsbDescriptorParser::RegisterCustomParserL

Parameters

TUsbDescriptorParserL aParserFunc The routine which will be removed from the USB descriptor parsing framework.

Member Type Definitions Documentation

Typedef TUsbDescriptorParserL

typedef TUsbGenericDescriptor *(* TUsbDescriptorParserL