OIC_LOG(DEBUG, TAG, "OUT");
}
+void CATCPSetConnectionChangedCallback(CATCPConnectionHandleCallback connHandler)
+{
+ return;
+}
+
void CATCPSetErrorHandler(CATCPErrorHandleCallback errorHandleCallback)
{
return;
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",
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;
* 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)
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);
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;
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");
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
{