modify switch-case (ic_ioty_parse_oic_transport()) 66/67066/1
authoryoungman <yman.jung@samsung.com>
Mon, 25 Apr 2016 04:22:20 +0000 (13:22 +0900)
committeryoungman <yman.jung@samsung.com>
Mon, 25 Apr 2016 04:22:20 +0000 (13:22 +0900)
Change-Id: I2757c995444bf7913bd12acd97a5526a8d4d8a3c
Signed-off-by: youngman <yman.jung@samsung.com>
common/ic-ioty-types.c

index 31466121a9a857c567a499ee7c4537e5c142f599..7337ac48443a7870503a8fe4452b67cf93b16505 100644 (file)
@@ -48,17 +48,22 @@ OCConnectivityType ic_ioty_convert_connectivity_type(
 iotcon_connectivity_type_e ic_ioty_parse_oic_transport(
                OCTransportAdapter adapter, OCTransportFlags flag)
 {
+       iotcon_connectivity_type_e type = IOTCON_CONNECTIVITY_ALL;
+
        /* Need to consider to allow various connectivity types */
        switch (adapter) {
        case OC_ADAPTER_IP:
                if (OC_IP_USE_V4 & flag)
-                       return IOTCON_CONNECTIVITY_IPV4;
+                       type = IOTCON_CONNECTIVITY_IPV4;
                else if (OC_IP_USE_V6 & flag)
-                       return IOTCON_CONNECTIVITY_IPV6;
+                       type = IOTCON_CONNECTIVITY_IPV6;
+               else
+                       ERR("Invalid Flag(%d)", flag);
+               break;
        default:
                ERR("Invalid Adpater(%d)", adapter);
        }
-       return IOTCON_CONNECTIVITY_ALL;
+       return type;
 }