usbengines/usbotgwatcher/inc/cusbotgwatcher.h
changeset 1 705ec7b86991
parent 0 1e05558e2206
child 5 7068aba64af5
equal deleted inserted replaced
0:1e05558e2206 1:705ec7b86991
    49 class CUsbStateHostHandle;
    49 class CUsbStateHostHandle;
    50 
    50 
    51 class CUsbNotifManager;
    51 class CUsbNotifManager;
    52 
    52 
    53 /**
    53 /**
       
    54  * Observers for usb otg watcher state nachine
       
    55  * Observers gets feedback by implementing this interface
       
    56  */
       
    57 class MUsbOtgWatcherStateObserver
       
    58     {
       
    59 
       
    60 public:
       
    61 
       
    62     /**
       
    63      * Observer must implement this interface
       
    64      * which is called back when state changes
       
    65      * @param aState new state id
       
    66      */
       
    67     virtual void OtgWatcherStateChangedL(TUsbStateIds aState) = 0;
       
    68     };
       
    69 
       
    70 /**
    54  *  UsbWatcher main class
    71  *  UsbWatcher main class
    55  *  Implements states machines and owns them
    72  *  Implements states machines and owns them
    56  *
    73  *
    57  */
    74  */
    58 class CUsbOtgWatcher : public CBase,
    75 class CUsbOtgWatcher : public CBase,
   337     /**
   354     /**
   338      * Handles problems in host functioning
   355      * Handles problems in host functioning
   339      * @param aWhatKindOf problem Id to be handled
   356      * @param aWhatKindOf problem Id to be handled
   340      */
   357      */
   341     void HandleHostProblemL(TInt aWhatKindOf);
   358     void HandleHostProblemL(TInt aWhatKindOf);
       
   359     
       
   360     /**
       
   361      * Add observer to USb Otg state machine
       
   362      * @param aObserver Observer
       
   363      */
       
   364     void SubscribeL(MUsbOtgWatcherStateObserver* aObserver);
       
   365 
       
   366     /**
       
   367      * Remove observer from UsbOtg state observer
       
   368      * @param aObserver Observer
       
   369      */
       
   370     void UnsubscribeL(MUsbOtgWatcherStateObserver* aObserver);
   342 
   371 
   343     /**
   372     /**
   344      * Used for test purposes
   373      * Used for test purposes
   345      */
   374      */
   346     void PrintStateToLog();
   375     void PrintStateToLog();
   460      * usb service control
   489      * usb service control
   461      * Starts and stops usb service, changes personalities 
   490      * Starts and stops usb service, changes personalities 
   462      * Own.  
   491      * Own.  
   463      */
   492      */
   464     CUsbServiceControl* iUsbServiceControl;
   493     CUsbServiceControl* iUsbServiceControl;
       
   494     
       
   495     /**
       
   496      * The observer reports state changes to its own observers
       
   497      * Not Own
       
   498      */
       
   499     RPointerArray<MUsbOtgWatcherStateObserver> iOtgStateObservers;
   465     };
   500     };
   466 
   501 
   467 #endif //  C_USBOTGWATCHER_H
   502 #endif //  C_USBOTGWATCHER_H