1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/kerneltest/f32test/shostmassstorage/msman/src/rusbmspublisher.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,108 @@
1.4 +// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of the License "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +
1.20 +
1.21 +/**
1.22 + @file
1.23 + @internalTechnology
1.24 +*/
1.25 +
1.26 +#include <e32cmn.h>
1.27 +#include <e32std.h>
1.28 +#include <e32property.h>
1.29 +#include <e32def.h>
1.30 +#include <e32debug.h>
1.31 +#include "rusbmspublisher.h"
1.32 +#include "debug.h"
1.33 +
1.34 +//------------------------------------------------------------------------------
1.35 +/**
1.36 +Constructor
1.37 +*/
1.38 +
1.39 +const TUid KMyPropertyCat = {0x10285B2E};
1.40 +const TUid KUsbmanSvrSid = {0x101fe1db};
1.41 +
1.42 + enum TPropertyKeys
1.43 + {
1.44 + KUsbManOtgEventProperty = 1,
1.45 + KUsbManServerProperty = 2,
1.46 + KUsbManConnectionStateProperty = 3
1.47 + };
1.48 +
1.49 +
1.50 +RUsbOtgEventPublisher::RUsbOtgEventPublisher()
1.51 + {
1.52 +// TInt result = iProperty.Attach(KMyPropertyCat, KUsbManOtgEventProperty, EOwnerThread);
1.53 +// __ASSERT_DEBUG(result == KErrNone, User::Invariant());
1.54 + }
1.55 +
1.56 +
1.57 +RUsbOtgEventPublisher::~RUsbOtgEventPublisher()
1.58 + {
1.59 +// iProperty.Close();
1.60 +// RProperty::Delete(KMyPropertyCat, KUsbManOtgEventProperty);
1.61 + }
1.62 +
1.63 +/**
1.64 +Publishing method
1.65 +
1.66 +Publishes the USB event property event
1.67 +
1.68 +@param aEvent
1.69 +*/
1.70 +void RUsbOtgEventPublisher::PublishEvent(TInt aEvent)
1.71 + {
1.72 +
1.73 + TInt result = iProperty.Attach(KMyPropertyCat, KUsbManOtgEventProperty, EOwnerThread);
1.74 + __ASSERT_DEBUG(result == KErrNone, User::Invariant());
1.75 +
1.76 + __USBOTGPRINT(_L("****************** PublishEvent...."));
1.77 + result = iProperty.Set(aEvent);
1.78 + __USBOTGPRINT2(_L("****************** PublishEvent %d %d"), aEvent, result);
1.79 +
1.80 + iProperty.Close();
1.81 + RProperty::Delete(KMyPropertyCat, KUsbManOtgEventProperty);
1.82 + }
1.83 +
1.84 +
1.85 +//------------------------------------------------------------------------------
1.86 +void RUsbManServerPublisher::PublishEvent()
1.87 + {
1.88 + TInt result = iProperty.Attach(KUsbmanSvrSid, KUsbManServerProperty, EOwnerThread);
1.89 + __ASSERT_DEBUG(result == KErrNone, User::Invariant());
1.90 +
1.91 + __USBOTGPRINT(_L("****************** PublishServer...."));
1.92 + result = iProperty.Set(1);
1.93 + __USBOTGPRINT1(_L("****************** PublishServer %d"), result);
1.94 +
1.95 + iProperty.Close();
1.96 + RProperty::Delete(KMyPropertyCat, KUsbManServerProperty);
1.97 + }
1.98 +
1.99 +//------------------------------------------------------------------------------
1.100 +void RUsbManConnectionStatePublisher::PublishEvent(TBool aActive)
1.101 + {
1.102 + TInt result = iProperty.Attach(KUsbmanSvrSid, KUsbManConnectionStateProperty, EOwnerThread);
1.103 + __ASSERT_DEBUG(result == KErrNone, User::Invariant());
1.104 +
1.105 + __USBOTGPRINT1(_L("****************** PublishConnectionState Active=%d...."), aActive);
1.106 + result = iProperty.Set(aActive);
1.107 + __USBOTGPRINT1(_L("****************** PublishConnectionState %d"), result);
1.108 +
1.109 + iProperty.Close();
1.110 + RProperty::Delete(KMyPropertyCat, KUsbManConnectionStateProperty);
1.111 + }