Update contrib.
1 // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
25 #include <e32property.h>
28 #include "rusbmspublisher.h"
31 //------------------------------------------------------------------------------
36 const TUid KMyPropertyCat = {0x10285B2E};
37 const TUid KUsbmanSvrSid = {0x101fe1db};
41 KUsbManOtgEventProperty = 1,
42 KUsbManServerProperty = 2,
43 KUsbManConnectionStateProperty = 3
47 RUsbOtgEventPublisher::RUsbOtgEventPublisher()
49 // TInt result = iProperty.Attach(KMyPropertyCat, KUsbManOtgEventProperty, EOwnerThread);
50 // __ASSERT_DEBUG(result == KErrNone, User::Invariant());
54 RUsbOtgEventPublisher::~RUsbOtgEventPublisher()
57 // RProperty::Delete(KMyPropertyCat, KUsbManOtgEventProperty);
63 Publishes the USB event property event
67 void RUsbOtgEventPublisher::PublishEvent(TInt aEvent)
70 TInt result = iProperty.Attach(KMyPropertyCat, KUsbManOtgEventProperty, EOwnerThread);
71 __ASSERT_DEBUG(result == KErrNone, User::Invariant());
73 __USBOTGPRINT(_L("****************** PublishEvent...."));
74 result = iProperty.Set(aEvent);
75 __USBOTGPRINT2(_L("****************** PublishEvent %d %d"), aEvent, result);
78 RProperty::Delete(KMyPropertyCat, KUsbManOtgEventProperty);
82 //------------------------------------------------------------------------------
83 void RUsbManServerPublisher::PublishEvent()
85 TInt result = iProperty.Attach(KUsbmanSvrSid, KUsbManServerProperty, EOwnerThread);
86 __ASSERT_DEBUG(result == KErrNone, User::Invariant());
88 __USBOTGPRINT(_L("****************** PublishServer...."));
89 result = iProperty.Set(1);
90 __USBOTGPRINT1(_L("****************** PublishServer %d"), result);
93 RProperty::Delete(KMyPropertyCat, KUsbManServerProperty);
96 //------------------------------------------------------------------------------
97 void RUsbManConnectionStatePublisher::PublishEvent(TBool aActive)
99 TInt result = iProperty.Attach(KUsbmanSvrSid, KUsbManConnectionStateProperty, EOwnerThread);
100 __ASSERT_DEBUG(result == KErrNone, User::Invariant());
102 __USBOTGPRINT1(_L("****************** PublishConnectionState Active=%d...."), aActive);
103 result = iProperty.Set(aActive);
104 __USBOTGPRINT1(_L("****************** PublishConnectionState %d"), result);
107 RProperty::Delete(KMyPropertyCat, KUsbManConnectionStateProperty);