Add IPC sync result for SerialPort::Write() 74/14074/1
authorHyunbin Lee <hyunbin.lee@samsung.com>
Tue, 5 Nov 2013 11:51:00 +0000 (20:51 +0900)
committerHyunbin Lee <hyunbin.lee@samsung.com>
Mon, 23 Dec 2013 06:31:19 +0000 (15:31 +0900)
Change-Id: I06ba20a68e3fc8242c0eeba82c29158c7b958e62
Signed-off-by: Hyunbin Lee <hyunbin.lee@samsung.com>
src/io/FIo_DataRouter.cpp
src/io/FIo_SerialPortImpl.cpp

index bb3c0b6..778a917 100644 (file)
@@ -40,6 +40,7 @@ static int __refCount = 0;
 void
 SerialStateChangedCallback(serial_error_e result, serial_state_e state, void* userData)
 {
+       SysLog(NID_IO, "Enter");
        int ret = 0;
        if (gp_DataRouter != null)
        {
@@ -64,7 +65,7 @@ SerialStateChangedCallback(serial_error_e result, serial_state_e state, void* us
 bool
 SerialDataReceivedCallback(const char* data, int length, void* userData)
 {
-
+       SysLog(NID_IO, "Enter");
        if (gp_DataRouter != null)
        {
                gp_DataRouter->DataReceived(data, length);
@@ -76,6 +77,7 @@ SerialDataReceivedCallback(const char* data, int length, void* userData)
 void
 SerialStateReadyCallback(keynode_t* node, void* userData)
 {
+       SysLog(NID_IO, "Enter");
        result r = E_SUCCESS;
        int ret = 0;
 
@@ -87,6 +89,7 @@ SerialStateReadyCallback(keynode_t* node, void* userData)
 
                if(dataRouterStatus == 1)
                {
+                       SysLog(NID_IO, "Try to initialize serial port");
                        ret = serial_create(&gSerialHandle);
                        SysTryCatch(NID_IO, ret == SERIAL_ERROR_NONE, r = E_SYSTEM, r, "[%s] Failed to initialize data router module. Error:%d", ret);
 
index 44b3d73..0e9d2eb 100644 (file)
@@ -237,6 +237,13 @@ _SerialPortImpl::Write(const Tizen::Base::ByteBuffer &byteBuffer)
        r = __pIpcClient->SendRequest(pMsg.get());
        SysTryReturn(NID_IO, r == E_SUCCESS, r, r, "[%s] Propagated.", GetErrorMessage(r));
 
+       String* pResult = dynamic_cast< String* >(response.GetAt(0));
+       if (pResult != null && pResult->Equals(String(L"E_SUCCESS")) == false)
+       {
+               SysLog(NID_IO, "server result: %ls", pResult->GetPointer());
+               return E_SYSTEM;
+       }
+
        return E_SUCCESS;
 }