diff options
Diffstat (limited to 'include/net_connection_private.h')
-rwxr-xr-x | include/net_connection_private.h | 41 |
1 files changed, 37 insertions, 4 deletions
diff --git a/include/net_connection_private.h b/include/net_connection_private.h index 831ee54..0a389c4 100755 --- a/include/net_connection_private.h +++ b/include/net_connection_private.h @@ -11,7 +11,7 @@ * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and - * limitations under the License. + * limitations under the License. */ #ifndef __NET_CONNECTION_PRIVATE_H__ @@ -34,10 +34,14 @@ extern "C" { #define CONNECTION_ERROR 2 #define CONNECTION_WARN 3 +#define CONNECTION_MAC_INFO_LENGTH 17 +#define ETHERNET_MAC_INFO_FILE "/sys/class/net/eth0/address" +#define WIFI_MAC_INFO_FILE "/sys/class/net/wlan0/address" + #define TELEPHONY_FEATURE "http://tizen.org/feature/network.telephony" #define WIFI_FEATURE "http://tizen.org/feature/network.wifi" -#define TETHERING_BLUETOOTH_FEATURE "http://tizen.org/feature/network.tethering.bluetooth" -#define ETHERNET_FEATURE "http://tizen.org/feature/network.ethernet" +#define TETHERING_BLUETOOTH_FEATURE "http://tizen.org/feature/network.tethering.bluetooth" +#define ETHERNET_FEATURE "http://tizen.org/feature/network.ethernet" typedef enum { @@ -45,13 +49,25 @@ typedef enum CONNECTION_CELLULAR_SUBSCRIBER_2 = 0x01, } connection_cellular_subscriber_id_e; - +typedef enum +{ + CONNECTION_SUPPORTED_FEATURE_TELEPHONY, + CONNECTION_SUPPORTED_FEATURE_WIFI, + CONNECTION_SUPPORTED_FEATURE_TETHERING_BLUETOOTH, + CONNECTION_SUPPORTED_FEATURE_ETHERNET, + CONNECTION_SUPPORTED_FEATURE_MAX, +} connection_supported_feature_e; + +#if !defined TIZEN_TV #define CHECK_FEATURE_SUPPORTED(...) \ do { \ int rv = _connection_check_feature_supported(__VA_ARGS__, NULL); \ if( rv != CONNECTION_ERROR_NONE ) \ return rv; \ } while(0) +#else +#define CHECK_FEATURE_SUPPORTED(...) +#endif #define CONNECTION_LOG(log_level, format, args...) \ do { \ @@ -84,12 +100,29 @@ typedef enum #define VCONF_TELEPHONY_DEFAULT_DATA_SERVICE \ "db/telephony/dualsim/default_data_service" +typedef struct _connection_handle_s { + connection_type_changed_cb type_changed_callback; + connection_address_changed_cb ip_changed_callback; + connection_address_changed_cb proxy_changed_callback; + connection_ethernet_cable_state_chaged_cb ethernet_cable_state_changed_callback; + void *type_changed_user_data; + void *ip_changed_user_data; + void *proxy_changed_user_data; + void *ethernet_cable_state_changed_user_data; +} connection_handle_s; + +typedef void(*libnet_ethernet_cable_state_changed_cb) + (connection_ethernet_cable_state_e state); + bool _connection_is_created(void); int _connection_libnet_init(void); bool _connection_libnet_deinit(void); int _connection_libnet_get_wifi_state(connection_wifi_state_e *state); int _connection_libnet_get_ethernet_state(connection_ethernet_state_e *state); +int _connection_libnet_get_ethernet_cable_state(connection_ethernet_cable_state_e* state); +int _connection_libnet_set_ethernet_cable_state_changed_cb( + libnet_ethernet_cable_state_changed_cb callback); int _connection_libnet_get_bluetooth_state(connection_bt_state_e* state); bool _connection_libnet_check_profile_validity(connection_profile_h profile); bool _connection_libnet_check_profile_cb_validity(connection_profile_h profile); |