Commit c2906518 authored by bg.chun's avatar bg.chun Committed by Uze Choi

[IOT-2008] Wrapping OCGetLinkLocalZoneId by ifdef IP_ADAPTER

Wrapping OCGetLinkLocalZoneId by ifdef IP_ADAPTER
because real implementation located on ca ipadapter.
It makes BLE only stack build fail.

Change-Id: Ifd2ccaa0ba3ea62967186a69c670694f2b5d5d81
Signed-off-by: default avatarbg.chun <bg.chun@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/18965Tested-by: default avatarjenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: default avatarUze Choi <uzchoi@samsung.com>
Tested-by: default avatarUze Choi <uzchoi@samsung.com>
parent 05284171
......@@ -250,6 +250,7 @@ CAResult_t CASetRAInfo(const CARAInfo_t *caraInfo);
*/
CAResult_t CASetProxyUri(const char *uri);
#ifdef IP_ADAPTER
/**
* This function return zone id related from ifindex and address.
*
......@@ -259,6 +260,7 @@ CAResult_t CASetProxyUri(const char *uri);
* @return ::CA_STATUS_OK or ::CA_STATUS_INVALID_PARAM
*/
CAResult_t CAGetLinkLocalZoneId(uint32_t ifindex, char **zoneId);
#endif
#ifdef __cplusplus
} /* extern "C" */
......
......@@ -443,7 +443,7 @@ static void OCDefaultConnectionStateChangedHandler(const CAEndpoint_t *info, boo
* @param payload Discovery payload which has Endpoint information.
* @param ifindex index which indicate network interface.
*/
#ifndef WITH_ARDUINO
#if defined (IP_ADAPTER) && !defined (WITH_ARDUINO)
static OCStackResult OCMapZoneIdToLinkLocalEndpoint(OCDiscoveryPayload *payload, uint32_t ifindex);
#endif
......@@ -1414,7 +1414,7 @@ OCStackResult HandleBatchResponse(char *requestUri, OCRepPayload **payload)
return OC_STACK_INVALID_PARAM;
}
#ifndef WITH_ARDUINO
#if defined (IP_ADAPTER) && !defined (WITH_ARDUINO)
OCStackResult OCMapZoneIdToLinkLocalEndpoint(OCDiscoveryPayload *payload, uint32_t ifindex)
{
if (!payload)
......@@ -1723,7 +1723,7 @@ void OCHandleResponse(const CAEndpoint_t* endPoint, const CAResponseInfo_t* resp
// Check endpoints has link-local ipv6 address.
// if there is, map zone-id which parsed from ifindex
#ifndef WITH_ARDUINO
#if defined (IP_ADAPTER) && !defined (WITH_ARDUINO)
if (PAYLOAD_TYPE_DISCOVERY == response->payload->type)
{
OCDiscoveryPayload *disPayload = (OCDiscoveryPayload*)(response->payload);
......@@ -5908,7 +5908,9 @@ OCStackResult OCGetDeviceOwnedState(bool *isOwned)
return ret;
}
#ifdef IP_ADAPTER
OCStackResult OCGetLinkLocalZoneId(uint32_t ifindex, char **zoneId)
{
return CAResultToOCResult(CAGetLinkLocalZoneId(ifindex, zoneId));
}
#endif
......@@ -2686,6 +2686,7 @@ TEST_F(OCDiscoverTests, DISABLED_DiscoverResourceWithInvalidQueries)
EXPECT_EQ(OC_STACK_OK, discoverUnicastRTEmptyCB.Wait(10));
}
#ifdef IP_ADAPTER
TEST(StackZoneId, getZoneId)
{
size_t tempSize = 0;
......@@ -2710,6 +2711,7 @@ TEST(StackZoneId, getZoneIdWithInvalidParams)
EXPECT_EQ(OC_STACK_ERROR, OCGetLinkLocalZoneId(9999, &zoneId));
EXPECT_EQ(OC_STACK_ERROR, OCGetLinkLocalZoneId(UINT32_MAX, &zoneId));
}
#endif
TEST(LinksPayloadValue, createLinksPayloadValue)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment