localconnectivityservice/headset/src/headset.cpp
branchRCL_3
changeset 44 7a45d2ea2f56
parent 40 52a167391590
equal deleted inserted replaced
41:fb2c519f85e0 44:7a45d2ea2f56
   160 // ---------------------------------------------------------------------------
   160 // ---------------------------------------------------------------------------
   161 //
   161 //
   162 TInt CHidHeadsetDriver::DataIn( CHidTransport::THidChannelType aChannel,
   162 TInt CHidHeadsetDriver::DataIn( CHidTransport::THidChannelType aChannel,
   163         const TDesC8& aPayload )
   163         const TDesC8& aPayload )
   164     {
   164     {
       
   165     // validate input data
       
   166     if (0 >= aPayload.Length())
       
   167         {
       
   168         return KErrArgument;
       
   169         }
       
   170 
   165     TInt retVal = KErrNone;
   171     TInt retVal = KErrNone;
       
   172     
   166     switch ( aChannel )
   173     switch ( aChannel )
   167         {
   174         {
   168         case CHidTransport::EHidChannelInt:
   175         case CHidTransport::EHidChannelInt:
   169             if ( EInitialised == iDriverState )
   176             if ( EInitialised == iDriverState )
   170                 {
   177                 {