[ARDUINO] Resolved build error for WITH_TCP=TRUE
authorvimala.v <vimala.v@samsung.com>
Tue, 28 Jun 2016 11:23:49 +0000 (16:53 +0530)
committerJon A. Cruz <jon@joncruz.org>
Wed, 13 Jul 2016 19:46:13 +0000 (19:46 +0000)
Change-Id: I46e116467d30b48c54d4ff51303edad95c9748a7
Signed-off-by: vimala.v <vimala.v@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/8995
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Jon A. Cruz <jon@joncruz.org>
resource/csdk/connectivity/inc/catcpinterface.h
resource/csdk/connectivity/src/tcp_adapter/arduino/catcpserver_eth.cpp
resource/csdk/stack/src/oickeepalive.c

index 05e7601..1ce03a7 100644 (file)
@@ -143,7 +143,7 @@ void CATCPSetPacketReceiveCallback(CATCPPacketReceivedCallback callback);
 /**
  * Set this callback for receiving the changed connection information from peer devices.
  *
- * @param[in]  callback    Callback to be notified when connection state changes.
+ * @param[in]  connHandler    Callback to be notified when connection state changes.
  */
 void CATCPSetConnectionChangedCallback(CATCPConnectionHandleCallback connHandler);
 
index 3cc0e7d..b290eb3 100644 (file)
@@ -159,6 +159,11 @@ void CATCPSetPacketReceiveCallback(CATCPPacketReceivedCallback callback)
     OIC_LOG(DEBUG, TAG, "OUT");
 }
 
+void CATCPSetConnectionChangedCallback(CATCPConnectionHandleCallback connHandler)
+{
+    return;
+}
+
 void CATCPSetErrorHandler(CATCPErrorHandleCallback errorHandleCallback)
 {
     return;
@@ -232,7 +237,9 @@ void CATCPReadDataInternal()
             if (totalLen == totalReceivedLen)
             {
                 CASecureEndpoint_t ep =
-                    {.endpoint = {.adapter = CA_ADAPTER_TCP, .port = tcpClientPort}};
+                    {.endpoint = {.adapter = CA_ADAPTER_TCP,
+                                  .flags = CA_DEFAULT_FLAGS,
+                                  .port = tcpClientPort}};
 
                 IPAddress clientIP = tcpClientIP;
                 int ret = snprintf(ep.endpoint.addr, sizeof(ep.endpoint.addr), "%d.%d.%d.%d",
index 5f428b9..2dd2b2f 100644 (file)
@@ -468,7 +468,8 @@ void ProcessKeepAlive()
 
     for (uint32_t i = 0; i < len; i++)
     {
-        KeepAliveEntry_t *entry = u_arraylist_get(g_keepAliveConnectionTable, i);
+        KeepAliveEntry_t *entry = (KeepAliveEntry_t *)u_arraylist_get(g_keepAliveConnectionTable,
+                                                                      i);
         if (NULL == entry)
         {
             continue;
@@ -548,7 +549,8 @@ OCStackResult SendDisconnectMessage(const KeepAliveEntry_t *entry)
      * If CA get the empty message from RI, CA will disconnect a connection.
      */
     CARequestInfo_t requestInfo = { .method = CA_PUT };
-    return CASendRequest(&entry->remoteAddr, &requestInfo);
+    CAResult_t result = CASendRequest(&entry->remoteAddr, &requestInfo);
+    return CAResultToOCResult(result);
 }
 
 OCStackResult SendPingMessage(KeepAliveEntry_t *entry)
@@ -556,7 +558,7 @@ OCStackResult SendPingMessage(KeepAliveEntry_t *entry)
     VERIFY_NON_NULL(entry, FATAL, OC_STACK_INVALID_PARAM);
 
     // Send ping message.
-    OCCallbackData pingData = { .cb = PingRequestCallback };
+    OCCallbackData pingData = { .context = NULL, .cb = PingRequestCallback };
     OCDevAddr devAddr = { .adapter = OC_ADAPTER_TCP };
     CopyEndpointToDevAddr(&(entry->remoteAddr), &devAddr);
 
@@ -615,7 +617,8 @@ KeepAliveEntry_t *GetEntryFromEndpoint(const CAEndpoint_t *endpoint, uint32_t *i
 
     for (uint32_t i = 0; i < len; i++)
     {
-        KeepAliveEntry_t *entry = u_arraylist_get(g_keepAliveConnectionTable, i);
+        KeepAliveEntry_t *entry = (KeepAliveEntry_t *)u_arraylist_get(g_keepAliveConnectionTable,
+                                                                      i);
         if (NULL == entry)
         {
             continue;
@@ -699,7 +702,8 @@ OCStackResult RemoveKeepAliveEntry(const CAEndpoint_t *endpoint)
         return OC_STACK_ERROR;
     }
 
-    KeepAliveEntry_t *removedEntry = u_arraylist_remove(g_keepAliveConnectionTable, index);
+    KeepAliveEntry_t *removedEntry = (KeepAliveEntry_t *)
+                                        u_arraylist_remove(g_keepAliveConnectionTable, index);
     if (NULL == removedEntry)
     {
         OIC_LOG(ERROR, TAG, "Removed Entry is NULL");
@@ -725,12 +729,12 @@ void HandleKeepAliveConnCB(const CAEndpoint_t *endpoint, bool isConnected)
         OIC_LOG(DEBUG, TAG, "Received the connected device information from CA");
 
         // Send discover message to find ping resource
-        OCCallbackData pingData = { .cb = PingRequestCallback };
+        OCCallbackData pingData = {.context = NULL, .cb = PingRequestCallback };
         OCDevAddr devAddr = { .adapter = OC_ADAPTER_TCP };
         CopyEndpointToDevAddr(endpoint, &devAddr);
 
         OCDoResource(NULL, OC_REST_DISCOVER, KEEPALIVE_RESOURCE_URI, &devAddr, NULL,
-                     OC_ADAPTER_TCP, OC_HIGH_QOS, &pingData, NULL, 0);
+                     CT_ADAPTER_TCP, OC_HIGH_QOS, &pingData, NULL, 0);
     }
     else
     {