userlibandfileserver/fileserver/shostmassstorage/server/controller/include/cusbhostmsdevice.h
changeset 4 56f325a607ea
parent 0 a41df078684a
child 24 41f0cfe18c80
equal deleted inserted replaced
2:4122176ea935 4:56f325a607ea
    28 class TLogicalUnitList;
    28 class TLogicalUnitList;
    29 
    29 
    30 class CUsbHostMsDevice : public CBase
    30 class CUsbHostMsDevice : public CBase
    31 	{
    31 	{
    32 public:
    32 public:
    33     enum TDeviceState
       
    34         {
       
    35 		EActive,
       
    36 		ESuspended,
       
    37         };
       
    38 
    33 
    39 	static CUsbHostMsDevice* NewL(THostMassStorageConfig& aConfig);
    34 	static CUsbHostMsDevice* NewL(THostMassStorageConfig& aConfig);
    40 	~CUsbHostMsDevice();
    35 	~CUsbHostMsDevice();
    41 	void InitialiseL(const RMessage2& aMessage);
    36 	void InitialiseL(const RMessage2& aMessage);
    42     void UnInitialiseL();
    37     void UnInitialiseL();
    48 
    43 
    49 	void SetLunL(TLun aLun);
    44 	void SetLunL(TLun aLun);
    50 	void SetMaxLun(TLun aMaxLun);
    45 	void SetMaxLun(TLun aMaxLun);
    51 	TLun GetMaxLun() const;
    46 	TLun GetMaxLun() const;
    52 
    47 
    53 	TBool IsActive();
    48 	TBool IsReady() const;
    54 	TBool IsSuspended();
    49 	TBool IsSuspended() const;
       
    50 
    55 	void InitLunL(TLun aLun);
    51 	void InitLunL(TLun aLun);
    56 
    52 
    57 	void SuspendLunL(TLun aLun);
    53 	void SuspendLunL(TLun aLun);
    58 	void ResumeL(TRequestStatus &aStatus);
    54 	void Resume(TRequestStatus& aStatus);
    59 	void ResumeLogicalUnitsL();
    55 	void ResumeLogicalUnitsL();
    60 	void ResumeCompletedL();
    56 	void ResumeCompletedL();
    61 
    57 
    62 	void DoHandleRemoteWakeupL();
    58 	void DoHandleRemoteWakeupL();
    63 	void DoLunReadyCheckEventL();
    59 	void DoLunReadyCheckEventL();
    70 	void StartTimer();
    66 	void StartTimer();
    71 	void StopTimer();
    67 	void StopTimer();
    72 	static TInt TimerCallback(TAny* obj);
    68 	static TInt TimerCallback(TAny* obj);
    73 
    69 
    74 private:
    70 private:
       
    71     enum TDeviceState
       
    72         {
       
    73         EReady,
       
    74         ESuspended
       
    75         };
       
    76 
    75 	MTransport* iTransport;
    77 	MTransport* iTransport;
    76 	TLun iMaxLun;
    78 	TLun iMaxLun;
    77     TLogicalUnitList iLuList;
    79     TLogicalUnitList iLuList;
    78 	THostMassStorageConfig iConfig;
    80 	THostMassStorageConfig iConfig;
    79 	CUsbMsIfaceSuspendResume* iDeviceSuspendResume;
    81 	CUsbMsIfaceSuspendResume* iDeviceSuspendResume;
    90 inline TLun CUsbHostMsDevice::GetMaxLun() const
    92 inline TLun CUsbHostMsDevice::GetMaxLun() const
    91     {
    93     {
    92     return iMaxLun;
    94     return iMaxLun;
    93     }
    95     }
    94 
    96 
       
    97 
       
    98 inline TBool CUsbHostMsDevice::IsReady() const
       
    99 	{
       
   100 	return (iState == EReady)? ETrue : EFalse;
       
   101 	}
       
   102 
       
   103 
       
   104 inline TBool CUsbHostMsDevice::IsSuspended() const
       
   105 	{
       
   106 	return (iState == ESuspended)? ETrue : EFalse;
       
   107 	}
       
   108 
    95 #endif // CUSBHOSTMSDEVICE_H
   109 #endif // CUSBHOSTMSDEVICE_H
    96 
   110