Name: libnet-client
Summary: Network Client library (Shared library)
-Version: 0.1.77_50
+Version: 0.1.77_51
Release: 1
Group: System/Network
License: Flora License
int _net_open_connection_with_wifi_info(const net_wifi_connection_info_t* wifi_info);
int _net_check_profile_name(const char* ProfileName);
int _net_get_profile_list(net_device_t device_type, net_profile_info_t** profile_info, int* profile_count);
-int _net_mutex_init(void);
-void _net_mutex_destroy(void);
void _net_client_callback(net_event_info_t *event_data);
int _net_get_service_profile(net_service_type_t service_type, net_profile_name_t *profile_name);
int _net_get_default_profile_info(net_profile_info_t *profile_info);
/*****************************************************************************
* Extern Variables
*****************************************************************************/
-extern network_request_table_t request_table[NETWORK_REQUEST_TYPE_MAX];
+extern __thread network_request_table_t request_table[NETWORK_REQUEST_TYPE_MAX];
/*****************************************************************************
* Global Variables
*****************************************************************************/
-network_info_t NetworkInfo = {0, };
+__thread network_info_t NetworkInfo = { 0, };
static int __net_get_default_profile(void *param, net_profile_info_t *active_profile_info)
{
net_err_t Error = NET_ERR_NONE;
- if (g_atomic_int_get(&NetworkInfo.ref_count) == 0) {
+ if (NetworkInfo.ref_count < 1) {
NETWORK_LOG(NETWORK_ERROR, "Application is not registered\n");
__NETWORK_FUNC_EXIT__;
return NET_ERR_APP_NOT_REGISTERED;
}
if (NetworkInfo.ClientEventCb != NULL) {
- NETWORK_LOG(NETWORK_ERROR, "Application Already registered\n");
+ NETWORK_LOG(NETWORK_ERROR, "Application already registered\n");
__NETWORK_FUNC_EXIT__;
return NET_ERR_APP_ALREADY_REGISTERED;
}
- if (g_atomic_int_get(&NetworkInfo.ref_count) == 0) {
- if (_net_mutex_init() != NET_ERR_NONE) {
- __NETWORK_FUNC_EXIT__;
- return NET_ERR_UNKNOWN;
- }
-
+ if (NetworkInfo.ref_count < 1) {
Error = _net_register_signal();
if (Error != NET_ERR_NONE && Error != NET_ERR_APP_ALREADY_REGISTERED) {
NETWORK_LOG(NETWORK_ERROR, "Failed to register DBus signal [%s]\n",
_net_print_error(Error));
- _net_mutex_destroy();
-
__NETWORK_FUNC_EXIT__;
return Error;
}
_net_init_service_state_table();
}
- g_atomic_int_inc(&NetworkInfo.ref_count);
+ __sync_fetch_and_add(&NetworkInfo.ref_count, 1);
NetworkInfo.ClientEventCb = event_cb;
NetworkInfo.user_data = user_data;
break;
}
- if (g_atomic_int_get(&NetworkInfo.ref_count) == 0) {
- if (_net_mutex_init() != NET_ERR_NONE)
- return NET_ERR_UNKNOWN;
-
+ if (NetworkInfo.ref_count < 1) {
Error = _net_register_signal();
if (Error != NET_ERR_NONE && Error != NET_ERR_APP_ALREADY_REGISTERED) {
NETWORK_LOG(NETWORK_ERROR, "Failed to register DBus signal [%s]\n",
_net_print_error(Error));
- _net_mutex_destroy();
return Error;
}
_net_init_service_state_table();
}
- g_atomic_int_inc(&NetworkInfo.ref_count);
+ __sync_fetch_and_add(&NetworkInfo.ref_count, 1);
switch (client_type) {
case NET_DEVICE_DEFAULT:
/**
* @fn EXPORT_API int net_deregister_client(void)
*
- * This function deregisters with network client
+ * This function deregisters with network client
* This is Sync API.
*
* @return int - NET_ERR_NONE on success, negative values for errors
{
__NETWORK_FUNC_ENTER__;
- if (g_atomic_int_get(&NetworkInfo.ref_count) == 0 ||
- NetworkInfo.ClientEventCb == NULL) {
- NETWORK_LOG(NETWORK_ERROR, "Application was not registered\n");
+ if (NetworkInfo.ref_count < 1 ||
+ NetworkInfo.ClientEventCb == NULL) {
+ NETWORK_LOG(NETWORK_ERROR, "Application is not registered\n");
__NETWORK_FUNC_EXIT__;
return NET_ERR_APP_NOT_REGISTERED;
}
- if (g_atomic_int_dec_and_test(&NetworkInfo.ref_count)) {
+ if (__sync_sub_and_fetch(&NetworkInfo.ref_count, 1) < 1) {
_net_deregister_signal();
- _net_mutex_destroy();
_net_clear_request_table();
}
EXPORT_API int net_deregister_client_ext(net_device_t client_type)
{
- if (g_atomic_int_get(&NetworkInfo.ref_count) == 0) {
- NETWORK_LOG(NETWORK_ERROR, "Application was not registered\n");
+ if (NetworkInfo.ref_count < 1) {
+ NETWORK_LOG(NETWORK_ERROR, "Application is not registered\n");
return NET_ERR_APP_NOT_REGISTERED;
}
return NET_ERR_INVALID_PARAM;
}
- if (g_atomic_int_dec_and_test(&NetworkInfo.ref_count)) {
+ if (__sync_sub_and_fetch(&NetworkInfo.ref_count, 1) < 1) {
_net_deregister_signal();
- _net_mutex_destroy();
_net_clear_request_table();
}
net_err_t Error = NET_ERR_NONE;
__NETWORK_FUNC_ENTER__;
-
- if (g_atomic_int_get(&NetworkInfo.ref_count) == 0) {
+
+ if (NetworkInfo.ref_count < 1) {
NETWORK_LOG(NETWORK_ERROR, "Application is not registered\n");
__NETWORK_FUNC_EXIT__;
return NET_ERR_APP_NOT_REGISTERED;
__NETWORK_FUNC_ENTER__;
- if (g_atomic_int_get(&NetworkInfo.ref_count) == 0) {
+ if (NetworkInfo.ref_count < 1) {
NETWORK_LOG(NETWORK_ERROR, "Application is not registered\n");
__NETWORK_FUNC_EXIT__;
return NET_ERR_APP_NOT_REGISTERED;
__NETWORK_FUNC_ENTER__;
- if (g_atomic_int_get(&NetworkInfo.ref_count) == 0) {
+ if (NetworkInfo.ref_count < 1) {
NETWORK_LOG(NETWORK_ERROR, "Application is not registered\n");
__NETWORK_FUNC_EXIT__;
return NET_ERR_APP_NOT_REGISTERED;
net_err_t Error = NET_ERR_NONE;
if ((Error = _net_dbus_get_statistics(device_type, statistics_type, size)) != NET_ERR_NONE )
- NETWORK_LOG(NETWORK_ERROR, "Failed to get statistics. error: [%s]\n",
+ NETWORK_LOG(NETWORK_ERROR, "Failed to get statistics. error: %s\n",
_net_print_error(Error));
return Error;
net_err_t Error = NET_ERR_NONE;
if ((Error = _net_dbus_set_statistics(device_type, statistics_type)) != NET_ERR_NONE )
- NETWORK_LOG(NETWORK_ERROR, "Failed to set statistics. error: [%s]\n",
+ NETWORK_LOG(NETWORK_ERROR, "Failed to set statistics. error: %s\n",
_net_print_error(Error));
return Error;
return NET_ERR_INVALID_PARAM;
}
- if (g_atomic_int_get(&NetworkInfo.ref_count) == 0) {
+ if (NetworkInfo.ref_count < 1) {
NETWORK_LOG(NETWORK_ERROR, "Application is not registered\n");
__NETWORK_FUNC_EXIT__;
return NET_ERR_APP_NOT_REGISTERED;
return NET_ERR_INVALID_PARAM;
}
- if (g_atomic_int_get(&NetworkInfo.ref_count) == 0) {
+ if (NetworkInfo.ref_count < 1) {
NETWORK_LOG(NETWORK_ERROR, "Application is not registered\n");
__NETWORK_FUNC_EXIT__;
return NET_ERR_APP_NOT_REGISTERED;
return NET_ERR_INVALID_PARAM;
}
- if (g_atomic_int_get(&NetworkInfo.ref_count) == 0) {
+ if (NetworkInfo.ref_count < 1) {
NETWORK_LOG(NETWORK_ERROR, "Application is not registered\n");
__NETWORK_FUNC_EXIT__;
return NET_ERR_APP_NOT_REGISTERED;
return NET_ERR_INVALID_PARAM;
}
- if (g_atomic_int_get(&NetworkInfo.ref_count) == 0) {
+ if (NetworkInfo.ref_count < 1) {
NETWORK_LOG(NETWORK_ERROR, "Application is not registered\n");
__NETWORK_FUNC_EXIT__;
return NET_ERR_APP_NOT_REGISTERED;
*
*/
-#include <vconf.h>
#include <arpa/inet.h>
#include <netinet/in.h>
/*****************************************************************************
* Extern Variables
*****************************************************************************/
-extern network_info_t NetworkInfo;
-extern network_request_table_t request_table[NETWORK_REQUEST_TYPE_MAX];
+extern __thread network_info_t NetworkInfo;
+extern __thread network_request_table_t request_table[NETWORK_REQUEST_TYPE_MAX];
static int __net_error_string_to_enum(const char* error)
{
#include "network-internal.h"
#include "network-dbus-request.h"
-struct networkinfo_mutex_data {
- pthread_mutex_t callback_mutex;
- pthread_mutex_t wifi_state_mutex;
-};
-
struct gdbus_connection_data {
GDBusConnection *connection;
int conn_ref_count;
/*****************************************************************************
* Extern Global Variables
*****************************************************************************/
-extern network_info_t NetworkInfo;
+extern __thread network_info_t NetworkInfo;
/*****************************************************************************
* Global Variables
*****************************************************************************/
-network_request_table_t request_table[NETWORK_REQUEST_TYPE_MAX] = {{0,},};
+__thread network_request_table_t request_table[NETWORK_REQUEST_TYPE_MAX] = { { 0, }, };
-static struct networkinfo_mutex_data networkinfo_mutex =
- { { { 0, }, }, { { 0, }, } };
-static struct gdbus_connection_data gdbus_conn = { NULL, };
+static __thread struct gdbus_connection_data gdbus_conn = { NULL, 0, NULL, NULL };
static char *__convert_eap_type_to_string(gchar eap_type)
{
return Error;
}
-int _net_mutex_init(void)
-{
- __NETWORK_FUNC_ENTER__;
-
- if (pthread_mutex_init(&networkinfo_mutex.callback_mutex, NULL) != 0) {
- NETWORK_LOG(NETWORK_ERROR, "Mutex for callback initialization failed!\n");
- __NETWORK_FUNC_EXIT__;
- return NET_ERR_UNKNOWN;
- }
-
- if (pthread_mutex_init(&networkinfo_mutex.wifi_state_mutex, NULL) != 0) {
- NETWORK_LOG(NETWORK_ERROR, "Mutex for wifi state initialization failed!\n");
- pthread_mutex_destroy(&networkinfo_mutex.callback_mutex);
- __NETWORK_FUNC_EXIT__;
- return NET_ERR_UNKNOWN;
- }
-
- __NETWORK_FUNC_EXIT__;
- return NET_ERR_NONE;
-}
-
-void _net_mutex_destroy(void)
-{
- __NETWORK_FUNC_ENTER__;
-
- pthread_mutex_destroy(&networkinfo_mutex.callback_mutex);
- pthread_mutex_destroy(&networkinfo_mutex.wifi_state_mutex);
-
- __NETWORK_FUNC_EXIT__;
-}
-
void _net_client_callback(net_event_info_t *event_data)
{
- pthread_mutex_lock(&networkinfo_mutex.callback_mutex);
__NETWORK_FUNC_ENTER__;
if (NetworkInfo.ClientEventCb != NULL)
NetworkInfo.ClientEventCb_wifi(event_data, NetworkInfo.user_data_wifi);
__NETWORK_FUNC_EXIT__;
- pthread_mutex_unlock(&networkinfo_mutex.callback_mutex);
}
net_wifi_state_t _net_get_wifi_state(void)
{
- pthread_mutex_lock(&networkinfo_mutex.wifi_state_mutex);
__NETWORK_FUNC_ENTER__;
net_err_t Error = NET_ERR_NONE;
state_done:
__NETWORK_FUNC_EXIT__;
- pthread_mutex_unlock(&networkinfo_mutex.wifi_state_mutex);
return wifi_state;
}
gboolean _net_dbus_is_pending_call_used(void)
{
- if (g_atomic_int_get(&gdbus_conn.conn_ref_count) > 0)
+ if (gdbus_conn.conn_ref_count > 0)
return TRUE;
return FALSE;
void _net_dbus_pending_call_ref(void)
{
g_object_ref(gdbus_conn.connection);
- g_atomic_int_inc(&gdbus_conn.conn_ref_count);
+
+ __sync_fetch_and_add(&gdbus_conn.conn_ref_count, 1);
}
void _net_dbus_pending_call_unref(void)
{
- if (g_atomic_int_get(&gdbus_conn.conn_ref_count) < 1)
+ if (gdbus_conn.conn_ref_count < 1)
return;
g_object_unref(gdbus_conn.connection);
- if (g_atomic_int_dec_and_test(&gdbus_conn.conn_ref_count) == TRUE &&
+
+ if (__sync_sub_and_fetch(&gdbus_conn.conn_ref_count, 1) < 1 &&
gdbus_conn.handle_libnetwork != NULL) {
NETWORK_LOG(NETWORK_ERROR, "A handle of libnetwork is not NULL\n");
int _net_dbus_close_gdbus_call(void)
{
- int refcount = 0;
-
g_cancellable_cancel(gdbus_conn.cancellable);
g_object_unref(gdbus_conn.cancellable);
gdbus_conn.cancellable = NULL;
return NET_ERR_UNKNOWN;
}
- refcount = g_atomic_int_get(&gdbus_conn.conn_ref_count);
- if (refcount < 1) {
+ if (gdbus_conn.conn_ref_count < 1) {
NETWORK_LOG(NETWORK_ERROR, "There is no pending call\n");
g_object_unref(gdbus_conn.connection);
gdbus_conn.connection = NULL;
} else {
NETWORK_LOG(NETWORK_ERROR,
- "There are %d pending calls, waiting to be cleared\n", refcount);
+ "There are %d pending calls, waiting to be cleared\n",
+ gdbus_conn.conn_ref_count);
if (gdbus_conn.handle_libnetwork != NULL)
NETWORK_LOG(NETWORK_ERROR, "A handle of libnetwork is not NULL\n");
#include "network-internal.h"
#include "network-dbus-request.h"
-/*****************************************************************************
- * Macros and Typedefs
- *****************************************************************************/
-
/*****************************************************************************
* Local Functions Declaration
*****************************************************************************/
static int __net_set_default_cellular_service_profile_async(const char* ProfileName);
/*****************************************************************************
- * Global Functions
- *****************************************************************************/
-
-/*****************************************************************************
- * Extern Variables
- *****************************************************************************/
-extern network_info_t NetworkInfo;
-extern network_request_table_t request_table[NETWORK_REQUEST_TYPE_MAX];
-
-/*****************************************************************************
- * Global Variables
+ * Extern Variables
*****************************************************************************/
+extern __thread network_info_t NetworkInfo;
+extern __thread network_request_table_t request_table[NETWORK_REQUEST_TYPE_MAX];
/*****************************************************************************
* Local Functions Definition
EXPORT_API int net_add_profile(net_service_type_t network_type, net_profile_info_t *prof_info)
{
net_err_t Error = NET_ERR_NONE;
-
+
__NETWORK_FUNC_ENTER__;
-
- if (g_atomic_int_get(&NetworkInfo.ref_count) == 0) {
+
+ if (NetworkInfo.ref_count < 1) {
NETWORK_LOG(NETWORK_ERROR, "Application is not registered\n");
__NETWORK_FUNC_EXIT__;
return NET_ERR_APP_NOT_REGISTERED;
return Error;
}
- __NETWORK_FUNC_EXIT__;
+ __NETWORK_FUNC_EXIT__;
return Error;
}
net_profile_name_t pdp_prof_name;
net_profile_name_t wifi_prof_name;
net_profile_info_t prof_info;
-
- if (g_atomic_int_get(&NetworkInfo.ref_count) == 0) {
+
+ if (NetworkInfo.ref_count < 1) {
NETWORK_LOG(NETWORK_ERROR, "Application is not registered\n");
__NETWORK_FUNC_EXIT__;
return NET_ERR_APP_NOT_REGISTERED;
EXPORT_API int net_get_profile_info(const char *profile_name, net_profile_info_t *prof_info)
{
__NETWORK_FUNC_ENTER__;
-
+
net_err_t Error = NET_ERR_NONE;
-
- if (g_atomic_int_get(&NetworkInfo.ref_count) == 0) {
+
+ if (NetworkInfo.ref_count < 1) {
NETWORK_LOG(NETWORK_ERROR, "Application is not registered\n");
__NETWORK_FUNC_EXIT__;
return NET_ERR_APP_NOT_REGISTERED;
net_err_t Error = NET_ERR_NONE;
net_profile_info_t exProfInfo;
- if (g_atomic_int_get(&NetworkInfo.ref_count) == 0) {
+ if (NetworkInfo.ref_count < 1) {
NETWORK_LOG(NETWORK_ERROR, "Application is not registered\n");
__NETWORK_FUNC_EXIT__;
return NET_ERR_APP_NOT_REGISTERED;
__NETWORK_FUNC_EXIT__;
return NET_ERR_INVALID_PARAM;
}
-
- if (g_atomic_int_get(&NetworkInfo.ref_count) == 0) {
+
+ if (NetworkInfo.ref_count < 1) {
NETWORK_LOG(NETWORK_ERROR, "Application is not registered\n");
__NETWORK_FUNC_EXIT__;
return NET_ERR_APP_NOT_REGISTERED;
- }
+ }
if (device_type != NET_DEVICE_CELLULAR &&
device_type != NET_DEVICE_WIFI &&
__NETWORK_FUNC_EXIT__;
return NET_ERR_NOT_SUPPORTED;
}
-
+
Error = _net_get_profile_list(device_type, &profile_info, &profile_count);
if (Error != NET_ERR_NONE) {
NETWORK_LOG(NETWORK_ERROR,
"Failed to get service(profile) list. Error [%s]\n",
_net_print_error(Error));
-
+
NET_MEMFREE(profile_info);
-
+
__NETWORK_FUNC_EXIT__;
return Error;
} else {
*count = profile_count;
*profile_list = profile_info;
}
-
- __NETWORK_FUNC_EXIT__;
- return NET_ERR_NONE;
+
+ __NETWORK_FUNC_EXIT__;
+ return NET_ERR_NONE;
}
EXPORT_API int net_set_default_cellular_service_profile(const char *profile_name)
{
net_err_t Error = NET_ERR_NONE;
- if (g_atomic_int_get(&NetworkInfo.ref_count) == 0) {
+ if (NetworkInfo.ref_count < 1) {
NETWORK_LOG(NETWORK_ERROR, "Application is not registered\n");
__NETWORK_FUNC_EXIT__;
return NET_ERR_APP_NOT_REGISTERED;
{
net_err_t Error = NET_ERR_NONE;
- if (g_atomic_int_get(&NetworkInfo.ref_count) == 0) {
- NETWORK_LOG(NETWORK_ERROR, "Error!!! Application was not registered\n");
+ if (NetworkInfo.ref_count < 1) {
+ NETWORK_LOG(NETWORK_ERROR, "Error!!! Application is not registered\n");
__NETWORK_FUNC_EXIT__;
return NET_ERR_APP_NOT_REGISTERED;
}
return NET_ERR_INVALID_PARAM;
}
- if(request_table[NETWORK_REQUEST_TYPE_SET_DEFAULT].flag == TRUE) {
+ if (request_table[NETWORK_REQUEST_TYPE_SET_DEFAULT].flag == TRUE) {
NETWORK_LOG(NETWORK_ERROR, "Error!! Request already in progress\n");
__NETWORK_FUNC_EXIT__;
return NET_ERR_IN_PROGRESS;
*
*/
-#include <vconf.h>
-
#include "network-internal.h"
#include "network-dbus-request.h"
#include "network-signal-handler.h"
-extern network_info_t NetworkInfo;
-extern network_request_table_t request_table[NETWORK_REQUEST_TYPE_MAX];
+extern __thread network_info_t NetworkInfo;
+extern __thread network_request_table_t request_table[NETWORK_REQUEST_TYPE_MAX];
-static net_state_type_t service_state_table[NET_DEVICE_MAX] = {NET_STATE_TYPE_UNKNOWN,};
-static int net_service_error = NET_ERR_NONE;
-static guint gdbus_conn_subscribe_id_connman_svc = 0;
-static guint gdbus_conn_subscribe_id_supplicant = 0;
-static guint gdbus_conn_subscribe_id_netconfig = 0;
+static __thread net_state_type_t service_state_table[NET_DEVICE_MAX] =
+ { NET_STATE_TYPE_UNKNOWN, };
+static __thread int net_service_error = NET_ERR_NONE;
+static __thread guint gdbus_conn_subscribe_id_connman_svc = 0;
+static __thread guint gdbus_conn_subscribe_id_supplicant = 0;
+static __thread guint gdbus_conn_subscribe_id_netconfig = 0;
static int __net_handle_wifi_power_rsp(gboolean value)
{
#include "network-dbus-request.h"
#include "network-signal-handler.h"
-/*****************************************************************************
- * Macros and Typedefs
- *****************************************************************************/
-
-/*****************************************************************************
- * Local Functions Declaration
- *****************************************************************************/
-static net_wifi_state_t __net_get_wifi_service_state();
-
-/*****************************************************************************
- * Global Functions
- *****************************************************************************/
-
/*****************************************************************************
* Extern Variables
*****************************************************************************/
-extern network_info_t NetworkInfo;
-extern network_request_table_t request_table[NETWORK_REQUEST_TYPE_MAX];
-
-/*****************************************************************************
- * Global Variables
- *****************************************************************************/
+extern __thread network_info_t NetworkInfo;
+extern __thread network_request_table_t request_table[NETWORK_REQUEST_TYPE_MAX];
/*****************************************************************************
* Local Functions Definition
return NET_ERR_INVALID_PARAM;
}
- if (g_atomic_int_get(&NetworkInfo.ref_count) == 0) {
+ if (NetworkInfo.ref_count < 1) {
NETWORK_LOG(NETWORK_ERROR, "Application is not registered\n");
__NETWORK_FUNC_EXIT__;
return NET_ERR_APP_NOT_REGISTERED;
return NET_ERR_INVALID_PARAM;
}
- if (g_atomic_int_get(&NetworkInfo.ref_count) == 0) {
+ if (NetworkInfo.ref_count < 1) {
NETWORK_LOG(NETWORK_ERROR, "Application is not registered\n");
__NETWORK_FUNC_EXIT__;
return NET_ERR_APP_NOT_REGISTERED;
net_err_t Error = NET_ERR_NONE;
int hotspot_state = 0;
- if (g_atomic_int_get(&NetworkInfo.ref_count) == 0) {
+ if (NetworkInfo.ref_count < 1) {
NETWORK_LOG(NETWORK_ERROR, "Application is not registered\n");
__NETWORK_FUNC_EXIT__;
return NET_ERR_APP_NOT_REGISTERED;
net_err_t Error = NET_ERR_NONE;
- if(g_atomic_int_get(&NetworkInfo.ref_count) == 0) {
+ if (NetworkInfo.ref_count < 1) {
NETWORK_LOG(NETWORK_ERROR, "Application is not registered\n");
__NETWORK_FUNC_EXIT__;
return NET_ERR_APP_NOT_REGISTERED;
net_err_t Error = NET_ERR_NONE;
- if (g_atomic_int_get(&NetworkInfo.ref_count) == 0) {
+ if (NetworkInfo.ref_count < 1) {
NETWORK_LOG(NETWORK_ERROR, "Application is not registered\n");
__NETWORK_FUNC_EXIT__;
return NET_ERR_APP_NOT_REGISTERED;
return NET_ERR_INVALID_PARAM;
}
- if (g_atomic_int_get(&NetworkInfo.ref_count) == 0) {
+ if (NetworkInfo.ref_count < 1) {
NETWORK_LOG(NETWORK_ERROR, "Application is not registered\n");
__NETWORK_FUNC_EXIT__;
return NET_ERR_APP_NOT_REGISTERED;
net_wifi_state_t wifi_state;
- if (g_atomic_int_get(&NetworkInfo.ref_count) == 0) {
+ if (NetworkInfo.ref_count < 1) {
NETWORK_LOG(NETWORK_ERROR, "Application is not registered\n");
__NETWORK_FUNC_EXIT__;
return NET_ERR_APP_NOT_REGISTERED;
net_err_t Error = NET_ERR_NONE;
- if (g_atomic_int_get(&NetworkInfo.ref_count) == 0) {
+ if (NetworkInfo.ref_count < 1) {
NETWORK_LOG(NETWORK_ERROR, "Application is not registered\n");
-
__NETWORK_FUNC_EXIT__;
return NET_ERR_APP_NOT_REGISTERED;
}