The MTP Client controls the startup and termination of MTP services and MTP transports.
The DLL that provides the functionality and the library to which your code must link is identified below.
MTP Client is a standard IPC client derived from RSessionBase. It is implemented as a standard Symbian client interface. The server side is the MTP daemon process (mtpserver.exe). For more information about the MTP architecture, refer to MTP Framework Overview.
To start or stop an MTP transport transport, pass the transport plug-in UID to the StartTransport() or StopTransport() function.
// iMTPSession is an instance of RMTPClient RMTPClient iMTPSession; iMTPSession.Connect(); // Start the USB transport err = iMTPSession.StartTransport(TUid::Uid(KMTPUsbTransportImplementation)); if (err != KErrNone) { ... User::Leave(err); } ... // Stop the USB transport err = iMTPSession.StopTransport(TUid::Uid(KMTPUsbTransportImplementation)); if(err != KErrServerTerminated) { if (err != KErrNone) { ... User::Leave(err); } iMTPSession.Close();
For the host to communicate with the daemon through MTP, any one transport plug-in must be loaded. Only one transport plug-in may be loaded at a given time.
At least one client must be connected for the MTP Daemon to be running. When the last client closes the daemon starts a timer. When the timer expires the daemon shuts itself down.
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.