os/kernelhwsrv/kerneltest/f32test/shostmassstorage/msman/src/rusbmspublisher.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of the License "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
//
sl@0
    15
sl@0
    16
sl@0
    17
sl@0
    18
/**
sl@0
    19
 @file
sl@0
    20
 @internalTechnology
sl@0
    21
*/
sl@0
    22
sl@0
    23
#include <e32cmn.h>
sl@0
    24
#include <e32std.h>
sl@0
    25
#include <e32property.h>
sl@0
    26
#include <e32def.h>
sl@0
    27
#include <e32debug.h>
sl@0
    28
#include "rusbmspublisher.h"
sl@0
    29
#include "debug.h"
sl@0
    30
sl@0
    31
//------------------------------------------------------------------------------
sl@0
    32
/**
sl@0
    33
Constructor
sl@0
    34
*/
sl@0
    35
sl@0
    36
const TUid KMyPropertyCat = {0x10285B2E};
sl@0
    37
const TUid KUsbmanSvrSid = {0x101fe1db};
sl@0
    38
sl@0
    39
    enum TPropertyKeys
sl@0
    40
        {
sl@0
    41
        KUsbManOtgEventProperty = 1,
sl@0
    42
        KUsbManServerProperty = 2,
sl@0
    43
        KUsbManConnectionStateProperty = 3
sl@0
    44
        };
sl@0
    45
sl@0
    46
sl@0
    47
RUsbOtgEventPublisher::RUsbOtgEventPublisher()
sl@0
    48
	{
sl@0
    49
//	TInt result = iProperty.Attach(KMyPropertyCat, KUsbManOtgEventProperty, EOwnerThread);
sl@0
    50
//	__ASSERT_DEBUG(result == KErrNone, User::Invariant());
sl@0
    51
	}
sl@0
    52
sl@0
    53
sl@0
    54
RUsbOtgEventPublisher::~RUsbOtgEventPublisher()
sl@0
    55
	{
sl@0
    56
//	iProperty.Close();
sl@0
    57
//	RProperty::Delete(KMyPropertyCat, KUsbManOtgEventProperty);
sl@0
    58
	}
sl@0
    59
sl@0
    60
/**
sl@0
    61
Publishing method
sl@0
    62
sl@0
    63
Publishes the USB event property event
sl@0
    64
sl@0
    65
@param aEvent
sl@0
    66
*/
sl@0
    67
void RUsbOtgEventPublisher::PublishEvent(TInt aEvent)
sl@0
    68
	{
sl@0
    69
sl@0
    70
	TInt result = iProperty.Attach(KMyPropertyCat, KUsbManOtgEventProperty, EOwnerThread);
sl@0
    71
	__ASSERT_DEBUG(result == KErrNone, User::Invariant());
sl@0
    72
sl@0
    73
    __USBOTGPRINT(_L("****************** PublishEvent...."));
sl@0
    74
    result = iProperty.Set(aEvent);
sl@0
    75
    __USBOTGPRINT2(_L("****************** PublishEvent %d %d"), aEvent, result);
sl@0
    76
sl@0
    77
	iProperty.Close();
sl@0
    78
	RProperty::Delete(KMyPropertyCat, KUsbManOtgEventProperty);
sl@0
    79
	}
sl@0
    80
sl@0
    81
sl@0
    82
//------------------------------------------------------------------------------
sl@0
    83
void RUsbManServerPublisher::PublishEvent()
sl@0
    84
	{
sl@0
    85
	TInt result = iProperty.Attach(KUsbmanSvrSid, KUsbManServerProperty, EOwnerThread);
sl@0
    86
	__ASSERT_DEBUG(result == KErrNone, User::Invariant());
sl@0
    87
sl@0
    88
    __USBOTGPRINT(_L("****************** PublishServer...."));
sl@0
    89
    result = iProperty.Set(1);
sl@0
    90
    __USBOTGPRINT1(_L("****************** PublishServer %d"), result);
sl@0
    91
sl@0
    92
	iProperty.Close();
sl@0
    93
	RProperty::Delete(KMyPropertyCat, KUsbManServerProperty);
sl@0
    94
	}
sl@0
    95
sl@0
    96
//------------------------------------------------------------------------------
sl@0
    97
void RUsbManConnectionStatePublisher::PublishEvent(TBool aActive)
sl@0
    98
	{
sl@0
    99
	TInt result = iProperty.Attach(KUsbmanSvrSid, KUsbManConnectionStateProperty, EOwnerThread);
sl@0
   100
	__ASSERT_DEBUG(result == KErrNone, User::Invariant());
sl@0
   101
sl@0
   102
    __USBOTGPRINT1(_L("****************** PublishConnectionState Active=%d...."), aActive);
sl@0
   103
    result = iProperty.Set(aActive);
sl@0
   104
    __USBOTGPRINT1(_L("****************** PublishConnectionState %d"), result);
sl@0
   105
sl@0
   106
	iProperty.Close();
sl@0
   107
	RProperty::Delete(KMyPropertyCat, KUsbManConnectionStateProperty);
sl@0
   108
	}