__bt_ipsp_get_network_interface_name(&network_if_name);
__bt_ipsp_get_network_ipv6_address(ifname, MOBILE_AP_IPV6_SCOPE_LINK, &link_addr);
- __bt_ipsp_get_network_ipv6_address(network_if_name, MOBILE_AP_IPV6_SCOPE_GLOBAL, &network_addr);
- g_free(network_if_name);
+
+ if (network_if_name) {
+ __bt_ipsp_get_network_ipv6_address(network_if_name, MOBILE_AP_IPV6_SCOPE_GLOBAL, &network_addr);
+ g_free(network_if_name);
+ }
+
if (link_addr == NULL || network_addr == NULL) {
BT_DBG("address is NULL");
g_free(link_addr);
BT_DBG("failed to create remote device ipv6 address");
__bt_ipsp_get_network_interface_name(&network_interface);
- __bt_ipsp_get_network_ipv6_address(network_interface, MOBILE_AP_IPV6_SCOPE_GLOBAL, &network_ipv6_address);
+
+ if (network_interface)
+ __bt_ipsp_get_network_ipv6_address(network_interface, MOBILE_AP_IPV6_SCOPE_GLOBAL, &network_ipv6_address);
/* Add the Routing Rule */
__bt_ipsp_add_ipv6_neigh_proxy(network_interface, remote_ipv6_address);
dev_addr += 4;
g_strlcpy(address, dev_addr, sizeof(address));
- while ((pos = strchr(address, '_')) != NULL) {
+ while ((pos = strchr(address, '_')) != NULL)
*pos = ':';
- }
g_strlcpy(device_address, address, BT_ADDRESS_STRING_SIZE);
}
return;
}
- if (!__bt_hid_agent_get_adapter_path(conn, NULL)) {
+ if (!__bt_hid_agent_get_adapter_path(conn, NULL))
__bt_hid_agent_register();
- }
interface_added_sig_id = g_dbus_connection_signal_subscribe(conn,
NULL, BT_MANAGER_INTERFACE, BT_INTERFACES_ADDED, NULL, NULL, 0,
static inline tizen_profile_t get_tizen_profile()
{
- char *profileName = NULL;
-
- if (__builtin_expect(profile != _PROFILE_UNKNOWN, 1))
- return profile;
-
- system_info_get_platform_string("http://tizen.org/feature/profile", &profileName);
-
- /* To pass the checking of g_ir */
- if (!profileName)
- return _PROFILE_UNKNOWN;
-
- switch (*profileName) {
- case 'm':
- case 'M':
- profile = _PROFILE_MOBILE;
- break;
- case 'w':
- case 'W':
- profile = _PROFILE_WEARABLE;
- break;
- case 't':
- case 'T':
- profile = _PROFILE_TV;
- break;
- case 'i':
- case 'I':
- profile = _PROFILE_IVI;
- break;
- default: // common or unknown ==> ALL ARE COMMON.
- profile = _PROFILE_COMMON;
- }
- free(profileName);
-
- return profile;
+ char *profileName = NULL;
+
+ if (__builtin_expect(profile != _PROFILE_UNKNOWN, 1))
+ return profile;
+
+ system_info_get_platform_string("http://tizen.org/feature/profile", &profileName);
+
+ /* To pass the checking of g_ir */
+ if (!profileName)
+ return _PROFILE_UNKNOWN;
+
+ switch (*profileName) {
+ case 'm':
+ case 'M':
+ profile = _PROFILE_MOBILE;
+ break;
+ case 'w':
+ case 'W':
+ profile = _PROFILE_WEARABLE;
+ break;
+ case 't':
+ case 'T':
+ profile = _PROFILE_TV;
+ break;
+ case 'i':
+ case 'I':
+ profile = _PROFILE_IVI;
+ break;
+ default: // common or unknown ==> ALL ARE COMMON.
+ profile = _PROFILE_COMMON;
+ }
+ free(profileName);
+
+ return profile;
}
typedef enum {
static inline tizen_model_name_t get_tizen_model_name()
{
- char *modelName = NULL;
+ char *modelName = NULL;
- if (__builtin_expect(model_name != _MODEL_UNKNOWN, 1))
- return profile;
+ if (__builtin_expect(model_name != _MODEL_UNKNOWN, 1))
+ return profile;
- system_info_get_platform_string("http://tizen.org/system/model_name", &modelName);
+ system_info_get_platform_string("http://tizen.org/system/model_name", &modelName);
- /* To pass the checking of g_ir */
- if (!modelName)
- return _MODEL_UNKNOWN;
+ /* To pass the checking of g_ir */
+ if (!modelName)
+ return _MODEL_UNKNOWN;
- if (g_strcmp0(modelName, "TM1") == 0) {
- model_name = _MODEL_TM1;
- } else if (g_strcmp0(modelName, "TM2") == 0) {
- model_name = _MODEL_TM2;
- } else if (g_strcmp0(modelName, "TW1") == 0) {
- model_name = _MODEL_TW1;
- } else if (g_strcmp0(modelName, "TW2") == 0) {
- model_name = _MODEL_TW2;
- } else {
- model_name = _MODEL_UNKNOWN;
- }
+ if (g_strcmp0(modelName, "TM1") == 0)
+ model_name = _MODEL_TM1;
+ else if (g_strcmp0(modelName, "TM2") == 0)
+ model_name = _MODEL_TM2;
+ else if (g_strcmp0(modelName, "TW1") == 0)
+ model_name = _MODEL_TW1;
+ else if (g_strcmp0(modelName, "TW2") == 0)
+ model_name = _MODEL_TW2;
+ else
+ model_name = _MODEL_UNKNOWN;
- free(modelName);
+ free(modelName);
- return model_name;
+ return model_name;
}
#define TIZEN_PROFILE_WEARABLE (get_tizen_profile() == _PROFILE_WEARABLE)