From 102d9124a6981de495cb23e8bd98c2de322960fb Mon Sep 17 00:00:00 2001 From: Hyunbin Lee Date: Tue, 5 Nov 2013 20:51:00 +0900 Subject: [PATCH] Add IPC sync result for SerialPort::Write() Change-Id: I06ba20a68e3fc8242c0eeba82c29158c7b958e62 Signed-off-by: Hyunbin Lee --- src/io/FIo_DataRouter.cpp | 5 ++++- src/io/FIo_SerialPortImpl.cpp | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/io/FIo_DataRouter.cpp b/src/io/FIo_DataRouter.cpp index bb3c0b6..778a917 100644 --- a/src/io/FIo_DataRouter.cpp +++ b/src/io/FIo_DataRouter.cpp @@ -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); diff --git a/src/io/FIo_SerialPortImpl.cpp b/src/io/FIo_SerialPortImpl.cpp index 44b3d73..0e9d2eb 100644 --- a/src/io/FIo_SerialPortImpl.cpp +++ b/src/io/FIo_SerialPortImpl.cpp @@ -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; } -- 2.7.4