61 void ReadMessage(TRequestStatus& aStatus, TDes8& aDes);
63 void WriteMessage(TRequestStatus& aStatus,
const TDesC8& aDes, TBool aHasHeader=EFalse);
94 _LIT(KUsbOstServerName,
"!UsbOstRouter");
95 _LIT(KUsbOstServerImageName,
"usbostrouter");
96 const TUid KUsbOstServerUid = { 0x200170BE };
97 TInt startupAttempts = 2;
99 TInt ret = CreateSession(KUsbOstServerName, TVersion(1,0,0));
100 if (ret != KErrNotFound && ret != KErrServerTerminated) {
104 if (startupAttempts-- == 0) {
109 ret = server.Create(KUsbOstServerImageName, KNullDesC, KUsbOstServerUid);
113 TRequestStatus serverDiedRequestStatus;
114 server.Rendezvous(serverDiedRequestStatus);
116 if (serverDiedRequestStatus != KRequestPending) {
118 server.Kill(KErrNone);
123 User::WaitForRequest(serverDiedRequestStatus);
124 ret = (server.ExitType() == EExitPanic) ? KErrGeneral : serverDiedRequestStatus.Int();
127 if (ret != KErrNone && ret != KErrAlreadyExists) {
146 RHandleBase::Close();
152 TIpcArgs args(aId, aNeedHeader);
158 TIpcArgs args(aDes.MaxLength(), &aDes);
169 TIpcArgs args(aHasHeader, aDes.Length(), &aDes);
181 TInt err = lib.Load(_L(
"usbostcomm"));
182 if (err)
return result;
191 #endif //USBHOSTCOMM_H
const TInt KVersionOrdinal
TInt RegisterProtocolID(TOstProtIds aId, TBool aNeedHeader)
static QAuServer & server()
void ReadMessage(TRequestStatus &aStatus, TDes8 &aDes)
TVersion(* TVersionFunction)(const RUsbOstComm *)
void WriteMessage(TRequestStatus &aStatus, const TDesC8 &aDes, TBool aHasHeader=EFalse)