Tizen RT Public API  v1.1 D4
dm_connectivity.h
Go to the documentation of this file.
1 /****************************************************************************
2  *
3  * Copyright 2016 Samsung Electronics All Rights Reserved.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing,
12  * software distributed under the License is distributed on an
13  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
14  * either express or implied. See the License for the specific
15  * language governing permissions and limitations under the License.
16  *
17  ****************************************************************************/
18 
31 #ifndef DM_CONNECTIVITY_H_
32 #define DM_CONNECTIVITY_H_
33 
34 #ifdef __cplusplus
35 extern "C"
36 {
37 #endif
38 
44  char ssid[33]; // 802.11 spec defined unspecified or uint8
45  char bssid[18]; // char string e.g. xx:xx:xx:xx:xx:xx
46  int8_t rssi; // rssi level of scanned device
47  struct dm_scan_info_s *next;
48 };
49 typedef struct dm_scan_info_s dm_scan_info_t;
50 
51 typedef void (*conn_cb)(void);
52 
61 int dm_conn_get_rssi(int *rssi);
62 
71 int dm_conn_get_address(char *ipAddr);
72 
81 int dm_conn_get_interface(char *interface);
82 
91 int dm_conn_get_channel(int *channel);
92 
101 int dm_conn_get_tx_power(int *dbm);
102 
111 int dm_conn_set_tx_power(const int *dbm);
112 
121 int dm_conn_register_linkup_cb(conn_cb cb);
122 
131 int dm_conn_register_linkdown_cb(conn_cb cb);
132 
141 int dm_conn_unregister_linkup_cb(conn_cb cb);
142 
151 int dm_conn_unregister_linkdown_cb(conn_cb cb);
152 
153 // @cond
161 int dm_conn_wifi_scan(void);
162 
171 int dm_conn_get_scan_result(dm_scan_info_t **result);
172 
181 int dm_conn_free_scan_result(dm_scan_info_t **result);
182 
192 int dm_conn_wifi_connect(conn_cb linkUpEvent, conn_cb linkDownEvent);
193 
201 int dm_conn_dhcp_init(void);
202 
210 int dm_conn_wifi_disconnect(void);
211 // @endcond
212 #ifdef __cplusplus
213 }
214 #endif
215 
216 #endif /* DM_CONNECTIVITY_H_ */
217  // end of Connectivity group
int dm_conn_get_channel(int *channel)
get the channel of network
int dm_conn_get_tx_power(int *dbm)
get the tx power of network
int dm_conn_get_interface(char *interface)
get the current interface of network
Specify the data structure to hold WiFi scanning information.
int dm_conn_set_tx_power(const int *dbm)
set the tx power of network
int dm_conn_get_rssi(int *rssi)
get the rssi of network
int dm_conn_unregister_linkdown_cb(conn_cb cb)
unregister link down callback function for connectivity event.
int dm_conn_unregister_linkup_cb(conn_cb cb)
unregister link up callback function for connectivity event.
int dm_conn_register_linkup_cb(conn_cb cb)
register link up callback function for connectivity event.
int dm_conn_get_address(char *ipAddr)
get the ip address of network
int dm_conn_register_linkdown_cb(conn_cb cb)
register link down callback function for connectivity event.