<manifest>
- <assign>
- <filesystem path="/usr/bin/connection_test" exec_label="connman"/>
- </assign>
<request>
<domain name="_"/>
</request>
Name: capi-network-connection
Summary: Network Connection library in TIZEN C API
-Version: 1.0.75
+Version: 1.0.76
Release: 1
Group: System/Network
License: Apache-2.0
if (rv == NET_ERR_ACCESS_DENIED) {
CONNECTION_LOG(CONNECTION_ERROR, "Access denied");
return CONNECTION_ERROR_PERMISSION_DENIED;
- }
- else if (rv != NET_ERR_NONE) {
+ } else if (rv != NET_ERR_NONE) {
CONNECTION_LOG(CONNECTION_ERROR, "Failed to create connection[%d]", rv);
return CONNECTION_ERROR_OPERATION_FAILED;
}
CHECK_FEATURE_SUPPORTED(WIFI_FEATURE, ETHERNET_FEATURE);
- if(type == CONNECTION_TYPE_WIFI)
+ if (type == CONNECTION_TYPE_WIFI)
CHECK_FEATURE_SUPPORTED(WIFI_FEATURE);
- else if(type == CONNECTION_TYPE_ETHERNET)
+ else if (type == CONNECTION_TYPE_ETHERNET)
CHECK_FEATURE_SUPPORTED(ETHERNET_FEATURE);
if (mac_addr == NULL || !(__connection_check_handle_validity(connection))) {
return CONNECTION_ERROR_OUT_OF_MEMORY;
}
- g_strlcpy(*mac_addr, buf,CONNECTION_MAC_INFO_LENGTH + 1);
+ g_strlcpy(*mac_addr, buf, CONNECTION_MAC_INFO_LENGTH + 1);
fclose(fp);
break;
}
/* Checking Invalid MAC Address */
- if((strcmp(*mac_addr, "00:00:00:00:00:00") == 0) ||
+ if ((strcmp(*mac_addr, "00:00:00:00:00:00") == 0) ||
(strcmp(*mac_addr, "ff:ff:ff:ff:ff:ff") == 0)) {
CONNECTION_LOG(CONNECTION_ERROR, "MAC Address(%s) is invalid", *mac_addr);
return CONNECTION_ERROR_INVALID_OPERATION;
{
CHECK_FEATURE_SUPPORTED(ETHERNET_FEATURE);
- if ( !(__connection_check_handle_validity(connection)) ) {
+ if (!(__connection_check_handle_validity(connection))) {
CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
return CONNECTION_ERROR_INVALID_PARAMETER;
}
return CONNECTION_ERROR_INVALID_PARAMETER;
}
- if(id < 0 || id > 1) {
+ if (id < 0 || id > 1) {
CONNECTION_LOG(CONNECTION_ERROR, "Wrong Parameter Passed");
return CONNECTION_ERROR_INVALID_PARAMETER;
}
}
*llsize = (long long)(last_size * 1000) + (long long)(size * 1000);
- CONNECTION_LOG(CONNECTION_INFO,"%lld bytes", *llsize);
+ CONNECTION_LOG(CONNECTION_INFO, "%lld bytes", *llsize);
return CONNECTION_ERROR_NONE;
}
return CONNECTION_ERROR_OPERATION_FAILED;
}
- CONNECTION_LOG(CONNECTION_INFO,"%lld bytes", ull_size);
+ CONNECTION_LOG(CONNECTION_INFO, "%lld bytes", ull_size);
*llsize = (long long)ull_size;
} else
return CONNECTION_ERROR_INVALID_PARAMETER;
if (rv != CONNECTION_ERROR_NONE)
return rv;
- CONNECTION_LOG(CONNECTION_INFO,"connection_reset_statistics success");
+ CONNECTION_LOG(CONNECTION_INFO, "connection_reset_statistics success");
return CONNECTION_ERROR_NONE;
}
{
CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE, WIFI_FEATURE);
- if(connection_type == CONNECTION_TYPE_CELLULAR )
+ if (connection_type == CONNECTION_TYPE_CELLULAR)
CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE);
- else if(connection_type == CONNECTION_TYPE_WIFI)
+ else if (connection_type == CONNECTION_TYPE_WIFI)
CHECK_FEATURE_SUPPORTED(WIFI_FEATURE);
if (!(__connection_check_handle_validity(connection)) || size == NULL) {
{
CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE, WIFI_FEATURE);
- if(connection_type == CONNECTION_TYPE_CELLULAR )
+ if (connection_type == CONNECTION_TYPE_CELLULAR)
CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE);
- else if(connection_type == CONNECTION_TYPE_WIFI)
+ else if (connection_type == CONNECTION_TYPE_WIFI)
CHECK_FEATURE_SUPPORTED(WIFI_FEATURE);
if (!__connection_check_handle_validity(connection)) {
{
CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE, WIFI_FEATURE);
- if(type == CONNECTION_PROFILE_TYPE_CELLULAR)
+ if (type == CONNECTION_PROFILE_TYPE_CELLULAR)
CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE);
- else if(type == CONNECTION_PROFILE_TYPE_WIFI)
+ else if (type == CONNECTION_PROFILE_TYPE_WIFI)
CHECK_FEATURE_SUPPORTED(WIFI_FEATURE);
if (type != CONNECTION_PROFILE_TYPE_CELLULAR &&
if (net_info == NULL)
return CONNECTION_ERROR_OPERATION_FAILED;
- if(address_family == CONNECTION_ADDRESS_FAMILY_IPV6)
+ if (address_family == CONNECTION_ADDRESS_FAMILY_IPV6)
*gateway_address = __profile_convert_ip_to_string(
&net_info->GatewayAddr6, address_family);
else
if (net_info == NULL)
return CONNECTION_ERROR_OPERATION_FAILED;
- if(address_family == CONNECTION_ADDRESS_FAMILY_IPV4)
+ if (address_family == CONNECTION_ADDRESS_FAMILY_IPV4)
*dns_address = __profile_convert_ip_to_string(&net_info->DnsAddr[order-1],
address_family);
- else if(address_family == CONNECTION_ADDRESS_FAMILY_IPV6)
+ else if (address_family == CONNECTION_ADDRESS_FAMILY_IPV6)
*dns_address = __profile_convert_ip_to_string(&net_info->DnsAddr6[order-1],
address_family);
else
if (net_info == NULL)
return CONNECTION_ERROR_OPERATION_FAILED;
- if(address_family == CONNECTION_ADDRESS_FAMILY_IPV4)
+ if (address_family == CONNECTION_ADDRESS_FAMILY_IPV4)
profile_type = &net_info->IpConfigType ;
else
profile_type = &net_info->IpConfigType6 ;
- if(address_family == CONNECTION_ADDRESS_FAMILY_IPV4) {
+ if (address_family == CONNECTION_ADDRESS_FAMILY_IPV4) {
switch (type) {
case CONNECTION_IP_CONFIG_TYPE_STATIC:
*profile_type = NET_IP_CONFIG_TYPE_STATIC;
if (net_info == NULL)
return CONNECTION_ERROR_OPERATION_FAILED;
- if(address_family == CONNECTION_ADDRESS_FAMILY_IPV6) {
+ if (address_family == CONNECTION_ADDRESS_FAMILY_IPV6) {
if (ip_address == NULL)
inet_pton(AF_INET6, "::", &net_info->IpAddr6.Data.Ipv6);
else if (inet_pton(AF_INET6, ip_address,
if (net_info == NULL)
return CONNECTION_ERROR_OPERATION_FAILED;
- if(address_family == CONNECTION_ADDRESS_FAMILY_IPV6) {
+ if (address_family == CONNECTION_ADDRESS_FAMILY_IPV6) {
if (subnet_mask == NULL)
net_info->PrefixLen6 = 0 ;
else
} else {
if (subnet_mask == NULL)
net_info->SubnetMask.Data.Ipv4.s_addr = 0;
- else if (inet_pton(AF_INET, subnet_mask , &net_info->SubnetMask.Data.Ipv4) < 1 )
+ else if (inet_pton(AF_INET, subnet_mask , &net_info->SubnetMask.Data.Ipv4) < 1)
return CONNECTION_ERROR_INVALID_PARAMETER;
}
if (net_info == NULL)
return CONNECTION_ERROR_OPERATION_FAILED;
- if(address_family == CONNECTION_ADDRESS_FAMILY_IPV6) {
+ if (address_family == CONNECTION_ADDRESS_FAMILY_IPV6) {
if (gateway_address == NULL)
inet_pton(AF_INET6, "::", &net_info->GatewayAddr6.Data.Ipv6);
else if (inet_pton(AF_INET6, gateway_address, &net_info->GatewayAddr6.Data.Ipv6) < 1)
if (net_info == NULL)
return CONNECTION_ERROR_OPERATION_FAILED;
- if(address_family == CONNECTION_ADDRESS_FAMILY_IPV6) {
+ if (address_family == CONNECTION_ADDRESS_FAMILY_IPV6) {
net_info->DnsAddr6[order-1].Type = NET_ADDR_IPV6;
if (dns_address == NULL)
inet_pton(AF_INET6, "::", &net_info->DnsAddr6[order-1].Data.Ipv6);
case NET_EVENT_OPEN_IND:
result = __libnet_convert_to_cp_error_type(event_cb->Error);
CONNECTION_LOG(CONNECTION_INFO, "Connection opened %s[%s]",
- (is_requested) ? "RSP":"IND",
+ (is_requested) ? "RSP" : "IND",
__libnet_convert_cp_error_type_to_string(result));
if (is_requested)
case NET_EVENT_CLOSE_IND:
result = __libnet_convert_to_cp_error_type(event_cb->Error);
CONNECTION_LOG(CONNECTION_INFO, "Connection closed %s[%s]",
- (is_requested) ? "RSP":"IND",
+ (is_requested) ? "RSP" : "IND",
__libnet_convert_cp_error_type_to_string(result));
if (is_requested)
__libnet_ethernet_cable_state_changed_cb(CONNECTION_ETHERNET_CABLE_DETACHED);
break;
- default :
+ default:
break;
}
}
int err = 0;
err = inet_pton(address_family, address, &buf);
- if(err > 0)
+ if (err > 0)
return 1;
return 0;
int count = 0;
int i = 0;
- for (;i < profile_list->count;i++) {
+ for (; i < profile_list->count; i++) {
if (profile_list->profiles[i].ProfileState == NET_STATE_TYPE_ONLINE ||
profile_list->profiles[i].ProfileState == NET_STATE_TYPE_READY)
count++;
{
int i = 0;
- for (;i < source->count;i++) {
+ for (; i < source->count; i++) {
if (source->profiles[i].ProfileState == NET_STATE_TYPE_ONLINE ||
source->profiles[i].ProfileState == NET_STATE_TYPE_READY) {
memcpy(*dest, &source->profiles[i], sizeof(net_profile_info_t));
int count = 0;
int i = 0;
- for (;i < profile_list->count;i++) {
+ for (; i < profile_list->count; i++) {
if (profile_list->profiles[i].ProfileInfo.Pdp.DefaultConn == TRUE)
count++;
}
{
int i = 0;
- for (;i < source->count;i++) {
+ for (; i < source->count; i++) {
if (source->profiles[i].ProfileInfo.Pdp.DefaultConn == TRUE) {
memcpy(*dest, &source->profiles[i], sizeof(net_profile_info_t));
(*dest)++;
for (list = prof_handle_list; list; list = list->next)
if (profile == list->data) return true;
- for (;i < profile_iterator.count;i++)
+ for (; i < profile_iterator.count; i++)
if (profile == &profile_iterator.profiles[i]) return true;
return false;
case WIFI_DISCONNECTING:
*state = CONNECTION_WIFI_STATE_CONNECTED;
break;
- default :
+ default:
CONNECTION_LOG(CONNECTION_ERROR, "Unknown Wi-Fi state");
return CONNECTION_ERROR_INVALID_OPERATION;
}
return CONNECTION_ERROR_OPERATION_FAILED;
}
- if(status == 1)
+ if (status == 1)
*state = CONNECTION_ETHERNET_CABLE_ATTACHED;
else
*state = CONNECTION_ETHERNET_CABLE_DETACHED;
char *endstr = NULL;
int address_family = 0;
- if(__libnet_check_address_type(AF_INET, host_address))
+ if (__libnet_check_address_type(AF_INET, host_address))
address_family = AF_INET;
else
return CONNECTION_ERROR_INVALID_PARAMETER;
- switch(address_family) {
- case AF_INET:
- endstr = strrchr(host_address, '.');
- if (endstr == NULL ||
- strcmp(endstr, ".0") == 0 ||
- strncmp(host_address, "0.", 2) == 0 ||
- strstr(host_address, "255") != NULL) {
- CONNECTION_LOG(CONNECTION_ERROR, "Invalid IP address Passed\n");
- return CONNECTION_ERROR_INVALID_PARAMETER;
- }
- break;
- default:
- return CONNECTION_ERROR_OPERATION_FAILED;
+ switch (address_family) {
+ case AF_INET:
+ endstr = strrchr(host_address, '.');
+ if (endstr == NULL ||
+ strcmp(endstr, ".0") == 0 ||
+ strncmp(host_address, "0.", 2) == 0 ||
+ strstr(host_address, "255") != NULL) {
+ CONNECTION_LOG(CONNECTION_ERROR, "Invalid IP address Passed\n");
+ return CONNECTION_ERROR_INVALID_PARAMETER;
+ }
+ break;
+ default:
+ return CONNECTION_ERROR_OPERATION_FAILED;
}
rv = net_add_route(host_address, interface_name, address_family);
else
return CONNECTION_ERROR_INVALID_PARAMETER;
- switch(address_family) {
- case AF_INET:
- endstr = strrchr(host_address, '.');
- if (endstr == NULL ||
- strcmp(endstr, ".0") == 0 ||
- strncmp(host_address, "0.", 2) == 0 ||
- strstr(host_address, ".0.") != NULL ||strstr(host_address, "255") != NULL) {
- CONNECTION_LOG(CONNECTION_ERROR, "Invalid IP address Passed");
- return CONNECTION_ERROR_INVALID_PARAMETER;
- }
- break;
- default:
- return CONNECTION_ERROR_OPERATION_FAILED;
+ switch (address_family) {
+ case AF_INET:
+ endstr = strrchr(host_address, '.');
+ if (endstr == NULL ||
+ strcmp(endstr, ".0") == 0 ||
+ strncmp(host_address, "0.", 2) == 0 ||
+ strstr(host_address, ".0.") != NULL || strstr(host_address, "255") != NULL) {
+ CONNECTION_LOG(CONNECTION_ERROR, "Invalid IP address Passed");
+ return CONNECTION_ERROR_INVALID_PARAMETER;
+ }
+ break;
+ default:
+ return CONNECTION_ERROR_OPERATION_FAILED;
}
rv = net_remove_route(host_address, interface_name, address_family);
else
return CONNECTION_ERROR_INVALID_PARAMETER;*/
- switch(address_family) {
- case AF_INET6:
- if (strncmp(host_address, "fe80:", 5) == 0 ||
- strncmp(host_address, "ff00:", 5) == 0 ||
- strncmp(host_address, "::", 2) == 0) {
- CONNECTION_LOG(CONNECTION_ERROR, "Invalid IP address Passed\n");
- return CONNECTION_ERROR_INVALID_PARAMETER;
- }
- break;
- default:
- return CONNECTION_ERROR_OPERATION_FAILED;
+ switch (address_family) {
+ case AF_INET6:
+ if (strncmp(host_address, "fe80:", 5) == 0 ||
+ strncmp(host_address, "ff00:", 5) == 0 ||
+ strncmp(host_address, "::", 2) == 0) {
+ CONNECTION_LOG(CONNECTION_ERROR, "Invalid IP address Passed\n");
+ return CONNECTION_ERROR_INVALID_PARAMETER;
+ }
+ break;
+ default:
+ return CONNECTION_ERROR_OPERATION_FAILED;
}
rv = net_add_route_ipv6(host_address, interface_name, address_family, gateway);
else
return CONNECTION_ERROR_INVALID_PARAMETER;*/
- switch(address_family) {
- case AF_INET6:
- if (strncmp(host_address, "fe80:", 5) == 0 ||
- strncmp(host_address, "ff00:", 5) == 0 ||
- strncmp(host_address, "::", 2) == 0) {
- CONNECTION_LOG(CONNECTION_ERROR, "Invalid IP address Passed\n");
- return CONNECTION_ERROR_INVALID_PARAMETER;
- }
- break;
- default:
- return CONNECTION_ERROR_OPERATION_FAILED;
+ switch (address_family) {
+ case AF_INET6:
+ if (strncmp(host_address, "fe80:", 5) == 0 ||
+ strncmp(host_address, "ff00:", 5) == 0 ||
+ strncmp(host_address, "::", 2) == 0) {
+ CONNECTION_LOG(CONNECTION_ERROR, "Invalid IP address Passed\n");
+ return CONNECTION_ERROR_INVALID_PARAMETER;
+ }
+ break;
+ default:
+ return CONNECTION_ERROR_OPERATION_FAILED;
}
rv = net_remove_route_ipv6(host_address, interface_name, address_family, gateway);
if (rv == NET_ERR_ACCESS_DENIED) {
CONNECTION_LOG(CONNECTION_ERROR, "Access denied");
return CONNECTION_ERROR_PERMISSION_DENIED;
- }else if (rv != NET_ERR_NONE)
+ } else if (rv != NET_ERR_NONE)
return CONNECTION_ERROR_OPERATION_FAILED;
return CONNECTION_ERROR_NONE;
bool __libnet_check_feature_supported(const char *key, connection_supported_feature_e feature)
{
- if(!connection_is_feature_checked[feature]) {
- if(system_info_get_platform_bool(key, &connection_feature_supported[feature]) < 0) {
+ if (!connection_is_feature_checked[feature]) {
+ if (system_info_get_platform_bool(key, &connection_feature_supported[feature]) < 0) {
CONNECTION_LOG(CONNECTION_ERROR, "Error - Feature getting from System Info");
set_last_result(CONNECTION_ERROR_OPERATION_FAILED);
return CONNECTION_ERROR_OPERATION_FAILED;
va_start(list, feature_name);
key = feature_name;
- while(1) {
- if((strcmp(key, TELEPHONY_FEATURE) == 0)){
+ while (1) {
+ if (strcmp(key, TELEPHONY_FEATURE) == 0)
value = __libnet_check_feature_supported(key, CONNECTION_SUPPORTED_FEATURE_TELEPHONY);
- }
- if((strcmp(key, WIFI_FEATURE) == 0)){
+ if (strcmp(key, WIFI_FEATURE) == 0)
value = __libnet_check_feature_supported(key, CONNECTION_SUPPORTED_FEATURE_WIFI);
- }
- if((strcmp(key, TETHERING_BLUETOOTH_FEATURE) == 0)){
+ if (strcmp(key, TETHERING_BLUETOOTH_FEATURE) == 0)
value = __libnet_check_feature_supported(key, CONNECTION_SUPPORTED_FEATURE_TETHERING_BLUETOOTH);
- }
- if((strcmp(key, ETHERNET_FEATURE) == 0)){
+ if (strcmp(key, ETHERNET_FEATURE) == 0)
value = __libnet_check_feature_supported(key, CONNECTION_SUPPORTED_FEATURE_ETHERNET);
- }
- SECURE_CONNECTION_LOG(CONNECTION_INFO, "%s feature is %s", key, (value?"true":"false"));
+ SECURE_CONNECTION_LOG(CONNECTION_INFO, "%s feature is %s", key, (value ? "true" : "false"));
feature_supported |= value;
key = va_arg(list, const char *);
if (!key) break;
#include <tizen_error.h>
-#define RETURN_FAIL_DESTROY(x) {connection_profile_destroy(x); return -1;}
+#define RETURN_FAIL_DESTROY(x) {connection_profile_destroy(x); return -1; }
gboolean test_thread(GIOChannel *source, GIOCondition condition, gpointer data);
return false;
}
- buf[rv-1]='\0';
+ buf[rv-1] = '\0';
return true;
}
void test_get_ethernet_cable_state_callback(connection_ethernet_cable_state_e state,
void* user_data)
{
- if(state == CONNECTION_ETHERNET_CABLE_ATTACHED)
+ if (state == CONNECTION_ETHERNET_CABLE_ATTACHED)
printf("Ethernet Cable Connected\n");
- else if(state == CONNECTION_ETHERNET_CABLE_DETACHED)
+ else if (state == CONNECTION_ETHERNET_CABLE_DETACHED)
printf("Ethernet Cable Disconnected\n");
}
connection_profile_get_wifi_essid(profile_h, &essid);
printf("%d. state:[%s], profile name:%s, essid:%s\n",
profile_count, test_print_state(profile_state),
- profile_name, (essid)? essid : "");
+ profile_name, (essid) ? essid : "");
g_free(essid);
profile_list[profile_count] = profile_h;
profile_count++;
} else {
connection_cellular_service_type_e service_type;
- if (connection_profile_get_cellular_service_type(profile_h, &service_type) != CONNECTION_ERROR_NONE) {
+ if (connection_profile_get_cellular_service_type(profile_h, &service_type) != CONNECTION_ERROR_NONE)
printf("Fail to get cellular service type!\n");
- }
printf("%d. state:[%s], profile name:%s[%d]\n",
profile_count, test_print_state(profile_state), profile_name, service_type);
int test_get_current_ip(void)
{
char *ip_addr = NULL;
- int input;
- bool rv;
+ int input;
+ bool rv;
- rv = test_get_user_int("Input Address type to get"
- "(1:IPV4, 2:IPV6):", &input);
+ rv = test_get_user_int("Input Address type to get"
+ "(1:IPV4, 2:IPV6):", &input);
- if (rv == false) {
- printf("Invalid input!!\n");
- return -1;
- }
+ if (rv == false) {
+ printf("Invalid input!!\n");
+ return -1;
+ }
switch (input) {
case 1:
connection_get_statistics(connection, CONNECTION_TYPE_CELLULAR, CONNECTION_STATISTICS_TYPE_LAST_RECEIVED_DATA, &rv);
printf("last recv data size [%lld]\n", rv);
connection_get_statistics(connection, CONNECTION_TYPE_CELLULAR, CONNECTION_STATISTICS_TYPE_LAST_SENT_DATA, &rv);
- printf("last sent data size [%lld]\n",rv );
+ printf("last sent data size [%lld]\n", rv);
connection_get_statistics(connection, CONNECTION_TYPE_CELLULAR, CONNECTION_STATISTICS_TYPE_TOTAL_RECEIVED_DATA, &rv);
- printf("total received data size [%lld]\n",rv );
+ printf("total received data size [%lld]\n", rv);
connection_get_statistics(connection, CONNECTION_TYPE_CELLULAR, CONNECTION_STATISTICS_TYPE_TOTAL_SENT_DATA, &rv);
printf("total sent data size [%lld]\n", rv);
connection_get_statistics(connection, CONNECTION_TYPE_WIFI, CONNECTION_STATISTICS_TYPE_LAST_RECEIVED_DATA, &rv);
printf("WiFi last recv data size [%lld]\n", rv);
connection_get_statistics(connection, CONNECTION_TYPE_WIFI, CONNECTION_STATISTICS_TYPE_LAST_SENT_DATA, &rv);
- printf("WiFi last sent data size [%lld]\n",rv );
+ printf("WiFi last sent data size [%lld]\n", rv);
connection_get_statistics(connection, CONNECTION_TYPE_WIFI, CONNECTION_STATISTICS_TYPE_TOTAL_RECEIVED_DATA, &rv);
- printf("WiFi total received data size [%lld]\n",rv );
+ printf("WiFi total received data size [%lld]\n", rv);
connection_get_statistics(connection, CONNECTION_TYPE_WIFI, CONNECTION_STATISTICS_TYPE_TOTAL_SENT_DATA, &rv);
printf("WiFi total sent data size [%lld]\n", rv);
return -1;
}
- if (connection_reset_profile(connection, type, sim_id, test_connection_reset_profile_callback, NULL) != CONNECTION_ERROR_NONE) {
+ if (connection_reset_profile(connection, type, sim_id, test_connection_reset_profile_callback, NULL) != CONNECTION_ERROR_NONE)
return -1;
- }
return 1;
}
int main(int argc, char **argv)
{
GMainLoop *mainloop;
- mainloop = g_main_loop_new (NULL, FALSE);
+ mainloop = g_main_loop_new(NULL, FALSE);
GIOChannel *channel = g_io_channel_unix_new(0);
- g_io_add_watch(channel, (G_IO_IN|G_IO_ERR|G_IO_HUP|G_IO_NVAL), test_thread,NULL );
+ g_io_add_watch(channel, (G_IO_IN|G_IO_ERR|G_IO_HUP|G_IO_NVAL), test_thread, NULL);
printf("Test Thread created...\n");
- g_main_loop_run (mainloop);
+ g_main_loop_run(mainloop);
return 0;
}
if (*a == '\n' || *a == '\r') {
printf("\n\n Network Connection API Test App\n\n");
printf("Options..\n");
- printf("1 - Create Handle and set callbacks\n");
- printf("2 - Destroy Handle(unset callbacks automatically)\n");
- printf("3 - Get network state\n");
- printf("4 - Get cellular state (please insert SIM Card)\n");
- printf("5 - Get wifi state (please turn on WiFi)\n");
- printf("6 - Get current proxy address \n");
- printf("7 - Get current Ip address\n");
- printf("8 - Get cellular data call statistics\n");
- printf("9 - Get WiFi data call statistics\n");
- printf("a - Get Profile list\n");
- printf("b - Get Connected Profile list\n");
- printf("c - Get Current profile\n");
- printf("d - Open connection with profile\n");
- printf("e - Get default cellular service by type\n");
- printf("f - Set default cellular service by type\n");
- printf("g - Close connection with profile\n");
- printf("h - Add profile(Cellular and Wifi only)\n");
- printf("i - Remove profile(Cellular:delete, WiFi:forgot)\n");
- printf("j - Update profile\n");
- printf("k - Get profile info\n");
- printf("l - Refresh profile info\n");
- printf("m - Set state changed callback\n");
- printf("n - Unset state changed callback\n");
- printf("o - Reset cellular data call statistics\n");
- printf("p - Reset WiFi data call statistics\n");
- printf("q - Add new route\n");
- printf("r - Remove a route\n");
- printf("s - Get Bluetooth state\n");
- printf("t - Get profile id\n");
- printf("u - Reset profile\n");
- printf("v - Get all cellular default profiles\n");
- printf("w - Get mac address\n");
- printf("x - Get ethernet cable state\n");
- printf("B - Add IPv6 new route\n");
- printf("C - Remove IPv6 route\n");
- printf("0 - Exit \n");
+ printf("1 - Create Handle and set callbacks\n");
+ printf("2 - Destroy Handle(unset callbacks automatically)\n");
+ printf("3 - Get network state\n");
+ printf("4 - Get cellular state (please insert SIM Card)\n");
+ printf("5 - Get wifi state (please turn on WiFi)\n");
+ printf("6 - Get current proxy address \n");
+ printf("7 - Get current Ip address\n");
+ printf("8 - Get cellular data call statistics\n");
+ printf("9 - Get WiFi data call statistics\n");
+ printf("a - Get Profile list\n");
+ printf("b - Get Connected Profile list\n");
+ printf("c - Get Current profile\n");
+ printf("d - Open connection with profile\n");
+ printf("e - Get default cellular service by type\n");
+ printf("f - Set default cellular service by type\n");
+ printf("g - Close connection with profile\n");
+ printf("h - Add profile(Cellular and Wifi only)\n");
+ printf("i - Remove profile(Cellular:delete, WiFi:forgot)\n");
+ printf("j - Update profile\n");
+ printf("k - Get profile info\n");
+ printf("l - Refresh profile info\n");
+ printf("m - Set state changed callback\n");
+ printf("n - Unset state changed callback\n");
+ printf("o - Reset cellular data call statistics\n");
+ printf("p - Reset WiFi data call statistics\n");
+ printf("q - Add new route\n");
+ printf("r - Remove a route\n");
+ printf("s - Get Bluetooth state\n");
+ printf("t - Get profile id\n");
+ printf("u - Reset profile\n");
+ printf("v - Get all cellular default profiles\n");
+ printf("w - Get mac address\n");
+ printf("x - Get ethernet cable state\n");
+ printf("B - Add IPv6 new route\n");
+ printf("C - Remove IPv6 route\n");
+ printf("0 - Exit \n");
printf("ENTER - Show options menu.......\n");
}