Fix initialize issue on SerialPort
authorJoohyun Kim <joohyune.kim@samsung.com>
Mon, 27 May 2013 07:24:44 +0000 (16:24 +0900)
committerJoohyun Kim <joohyune.kim@samsung.com>
Mon, 27 May 2013 07:24:44 +0000 (16:24 +0900)
Change-Id: I82faa31e2e3433eaccbfe90885801e976bd99c2f
Signed-off-by: Joohyun Kim <joohyune.kim@samsung.com>
src/io/FIo_SerialPortImpl.cpp

index a51f730..cedd85e 100644 (file)
@@ -260,6 +260,7 @@ _SerialPortImpl::OnDataReceived(const ArrayList& data)
                pBuffer = (ByteBuffer*)data.GetAt(SERIAL_DATA_BODY);
                if (pBuffer != null)
                {
+                       pBuffer->Flip();
                        ArrayList* pData = const_cast<ArrayList*>(&data);
                        pData->Remove(*pBuffer);
                        _SerialPortEventArg* pEventArg= new (std::nothrow) _SerialPortEventArg(pBuffer);
@@ -272,7 +273,7 @@ _SerialPortImpl::OnDataReceived(const ArrayList& data)
        }
        else if (pCommand->Equals(SERIAL_COMMAND_ERROR, true))
        {
-               _SerialPortEventArg* pEventArg= new (std::nothrow) _SerialPortEventArg(pBuffer);
+               _SerialPortEventArg* pEventArg= new (std::nothrow) _SerialPortEventArg(null);
                  if(pEventArg != null)
                  {
                        SysLog(NID_IO, "_SerialPortImpl::OnDataReceived Event Fire");