Change-Id: Id3bfec99db93090039daa4fab85f2c1c0e734c76
Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
#define TETHERING_BT_IF "bnep0"
#define TETHERING_BT_GATEWAY "192.168.130.1"
#define TETHERING_BT_IF "bnep0"
#define TETHERING_BT_GATEWAY "192.168.130.1"
+#define TETHERING_P2P_IF "p2p0"
+#define TETHERING_P2P_GATEWAY "192.168.49.1"
+
#define TETHERING_WIFI_SSID_MAX_LEN 32 /**< Maximum length of ssid */
#define TETHERING_WIFI_KEY_MIN_LEN 8 /**< Minimum length of wifi key */
#define TETHERING_WIFI_KEY_MAX_LEN 64 /**< Maximum length of wifi key */
#define TETHERING_WIFI_SSID_MAX_LEN 32 /**< Maximum length of ssid */
#define TETHERING_WIFI_KEY_MIN_LEN 8 /**< Minimum length of wifi key */
#define TETHERING_WIFI_KEY_MAX_LEN 64 /**< Maximum length of wifi key */
Name: capi-network-tethering
Summary: Tethering Framework
Name: capi-network-tethering
Summary: Tethering Framework
Release: 1
Group: System/Network
License: Apache-2.0
Release: 1
Group: System/Network
License: Apache-2.0
case TETHERING_TYPE_BT:
g_strlcpy(buf, TETHERING_BT_IF, len);
break;
case TETHERING_TYPE_BT:
g_strlcpy(buf, TETHERING_BT_IF, len);
break;
+ case TETHERING_TYPE_P2P:
+ g_strlcpy(buf, TETHERING_P2P_IF, len);
+ break;
default:
ERR("Not supported type : %d\n", type);
return false;
default:
ERR("Not supported type : %d\n", type);
return false;
case TETHERING_TYPE_BT:
g_strlcpy(buf, TETHERING_BT_GATEWAY, len);
break;
case TETHERING_TYPE_BT:
g_strlcpy(buf, TETHERING_BT_GATEWAY, len);
break;
+ case TETHERING_TYPE_P2P:
+ g_strlcpy(buf, TETHERING_P2P_GATEWAY, len);
+ break;
default:
ERR("Not supported type : %d\n", type);
return false;
default:
ERR("Not supported type : %d\n", type);
return false;
EXPECT_EQ(TETHERING_ERROR_NONE,
tethering_get_network_interface_name(handle, TETHERING_TYPE_BT, &interface_name));
free(interface_name);
EXPECT_EQ(TETHERING_ERROR_NONE,
tethering_get_network_interface_name(handle, TETHERING_TYPE_BT, &interface_name));
free(interface_name);
+
+ EXPECT_EQ(TETHERING_ERROR_NONE,
+ tethering_get_network_interface_name(handle, TETHERING_TYPE_P2P, &interface_name));
+ free(interface_name);
}
TEST_F(TetheringTest, GetIpAddressN)
}
TEST_F(TetheringTest, GetIpAddressN)
tethering_get_ip_address(handle, TETHERING_TYPE_BT,
TETHERING_ADDRESS_FAMILY_IPV4, &ip));
free(ip);
tethering_get_ip_address(handle, TETHERING_TYPE_BT,
TETHERING_ADDRESS_FAMILY_IPV4, &ip));
free(ip);
+
+ EXPECT_EQ(TETHERING_ERROR_NONE,
+ tethering_get_ip_address(handle, TETHERING_TYPE_P2P,
+ TETHERING_ADDRESS_FAMILY_IPV4, &ip));
+ free(ip);
}
TEST_F(TetheringTest, GetGatewayAddressN)
}
TEST_F(TetheringTest, GetGatewayAddressN)
tethering_get_gateway_address(handle, TETHERING_TYPE_BT,
TETHERING_ADDRESS_FAMILY_IPV4, &gateway));
free(gateway);
tethering_get_gateway_address(handle, TETHERING_TYPE_BT,
TETHERING_ADDRESS_FAMILY_IPV4, &gateway));
free(gateway);
+
+ EXPECT_EQ(TETHERING_ERROR_NONE,
+ tethering_get_gateway_address(handle, TETHERING_TYPE_P2P,
+ TETHERING_ADDRESS_FAMILY_IPV4, &gateway));
+ free(gateway);
}
TEST_F(TetheringTest, GetSubnetMaskN)
}
TEST_F(TetheringTest, GetSubnetMaskN)
tethering_get_subnet_mask(handle, TETHERING_TYPE_BT,
TETHERING_ADDRESS_FAMILY_IPV4, &subnetmask));
free(subnetmask);
tethering_get_subnet_mask(handle, TETHERING_TYPE_BT,
TETHERING_ADDRESS_FAMILY_IPV4, &subnetmask));
free(subnetmask);
+
+ EXPECT_EQ(TETHERING_ERROR_NONE,
+ tethering_get_subnet_mask(handle, TETHERING_TYPE_P2P,
+ TETHERING_ADDRESS_FAMILY_IPV4, &subnetmask));
+ free(subnetmask);
}
TEST_F(TetheringTest, ForeachConnectedClientsN)
}
TEST_F(TetheringTest, ForeachConnectedClientsN)