From: Joseph Morrow Date: Tue, 23 Jun 2015 00:05:12 +0000 (-0400) Subject: Realigned usage of IP Adapter modules' APIs on Arduino. X-Git-Tag: 1.2.0+RC1~1562 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a477b1d0cd30ba94855b7fe8eb96521fe79f1793;p=platform%2Fupstream%2Fiotivity.git Realigned usage of IP Adapter modules' APIs on Arduino. This fixes an issue where an Arduino using an Ethernet shield did not respond to incoming requests nor notified the application of incoming requests. Change-Id: I035120e7bbe4a5950d2ed36a357f06c85c1ef8db Signed-off-by: Joseph Morrow Reviewed-on: https://gerrit.iotivity.org/gerrit/1388 Tested-by: jenkins-iotivity Reviewed-by: John Light Reviewed-by: Erich Keane --- diff --git a/resource/csdk/connectivity/src/ip_adapter/caipadapter_singlethread.c b/resource/csdk/connectivity/src/ip_adapter/caipadapter_singlethread.c index e087234..e7b2d16 100644 --- a/resource/csdk/connectivity/src/ip_adapter/caipadapter_singlethread.c +++ b/resource/csdk/connectivity/src/ip_adapter/caipadapter_singlethread.c @@ -111,7 +111,8 @@ static CAResult_t CAIPStopServers(); void CAIPNotifyNetworkChange(const char *address, uint16_t port, CANetworkStatus_t status) { - CAEndpoint_t *localEndpoint = CAAdapterCreateLocalEndpoint(CA_IPV4, address); + CAEndpoint_t *localEndpoint = CAAdapterCreateLocalEndpoint(CA_IPV4, CA_ADAPTER_IP, address, + port); if (!localEndpoint) { OIC_LOG(ERROR, TAG, "Out of memory!"); @@ -211,7 +212,8 @@ void CAIPPacketReceivedCB(const char *ipAddress, uint16_t port, OIC_LOG_V(DEBUG, TAG, "data:%s", data); /* CA is freeing this memory */ - CAEndpoint_t *endPoint = CAAdapterCreateEndpoint(CA_DEFAULT_FLAGS, CA_IPV4, ipAddress, port); + CAEndpoint_t *endPoint = CAAdapterCreateEndpoint(CA_DEFAULT_FLAGS, CA_ADAPTER_IP, ipAddress, + port); if (NULL == endPoint) { OIC_LOG(ERROR, TAG, "Out of memory!"); @@ -265,7 +267,7 @@ CAResult_t CAInitializeIP(CARegisterConnectivityCallback registerCallback, IPHandler.readData = CAReadIPData; IPHandler.stopAdapter = CAStopIP; IPHandler.terminate = CATerminateIP; - registerCallback(IPHandler, CA_IPV4); + registerCallback(IPHandler, CA_ADAPTER_IP); OIC_LOG(INFO, TAG, "success"); OIC_LOG(DEBUG, TAG, "OUT"); @@ -405,7 +407,7 @@ CAResult_t CAGetIPInterfaceInformation(CAEndpoint_t **info, uint32_t *size) } // Create local endpoint using util function - (*info) = CAAdapterCreateLocalEndpoint(CA_IPV4, ipAddress); + (*info) = CAAdapterCreateLocalEndpoint(CA_IPV4, CA_ADAPTER_IP, ipAddress); if (NULL == (*info)) { OIC_LOG(ERROR, TAG, "malloc fail");