replace : iotivity -> iotivity-sec
[platform/upstream/iotivity.git] / resource / csdk / connectivity / src / nfc_adapter / canfcadapter.c
index 4f8e57e..7f77e69 100644 (file)
@@ -19,7 +19,7 @@
 #include "canfcinterface.h"
 #include "caqueueingthread.h"
 #include "caadapterutils.h"
-#include "camutex.h"
+#include "octhread.h"
 #include "uarraylist.h"
 #include "caremotehandler.h"
 #include "logger.h"
@@ -67,8 +67,8 @@ static CAAdapterChangeCallback g_adapterStateCallback = NULL;
  */
 static CAErrorHandleCallback g_errorCallback = NULL;
 
-static void CANFCPacketReceivedCB(const CASecureEndpoint_t *endpoint, const void *data,
-                                  uint32_t dataLength);
+static CAResult_t CANFCPacketReceivedCB(const CASecureEndpoint_t *endpoint,
+                                        const void *data, uint32_t dataLength);
 #ifndef SINGLE_THREAD
 
 static CAResult_t CANFCInitializeQueueHandles();
@@ -137,17 +137,18 @@ void CANFCConnectionStateCB(const char *nfcAddress, CANetworkStatus_t status)
     (void)status;
 }
 
-void CANFCPacketReceivedCB(const CASecureEndpoint_t *sep, const void *data, uint32_t dataLength)
+CAResult_t CANFCPacketReceivedCB(const CASecureEndpoint_t *sep, const void *data,
+                                 uint32_t dataLength)
 {
     OIC_LOG(DEBUG, TAG, "IN");
 
-    VERIFY_NON_NULL_VOID(sep, TAG, "endpoint is NULL");
-    VERIFY_NON_NULL_VOID(data, TAG, "data is NULL");
+    VERIFY_NON_NULL(sep, TAG, "endpoint is NULL");
+    VERIFY_NON_NULL(data, TAG, "data is NULL");
 
     if (0 == dataLength)
     {
         OIC_LOG(ERROR, TAG, "Invalid call, data length is 0");
-        return;
+        return CA_STATUS_FAILED;
     }
 
     OIC_LOG_V(DEBUG, TAG, "Address: %s, port:%d", sep->endpoint.addr, sep->endpoint.port);
@@ -158,6 +159,8 @@ void CANFCPacketReceivedCB(const CASecureEndpoint_t *sep, const void *data, uint
     }
 
     OIC_LOG(DEBUG, TAG, "OUT");
+
+    return CA_STATUS_OK;
 }
 
 void CANFCErrorHandler(const CAEndpoint_t *endpoint, const void *data, uint32_t dataLength,