new fremantle branch
[libicd-wpa] / networks.h
1 /**
2   @file networks.h
3
4   Copyright (C) 2009 Javier S. Pedro
5
6   @author Javier S. Pedro <javispedro@javispedro.com>
7
8   This file is part of libicd-network-wpa.
9
10   This program is free software; you can redistribute it and/or modify it
11   under the terms of the GNU General Public License as published by the
12   Free Software Foundation; either version 2 of the License, or (at your
13   option) any later version.
14
15   This program is distributed in the hope that it will be useful, but
16   WITHOUT ANY WARRANTY; without even the implied warranty of
17   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18   General Public License for more details.
19
20   You should have received a copy of the GNU General Public License along
21   with this program; if not, write to the Free Software Foundation, Inc.,
22   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
23
24 */
25
26 #ifndef _NETWORKS_H_
27 #define _NETWORKS_H_
28
29 int networks_initialize();
30 void networks_free();
31
32 // NULL, NULL, 0 if search ended
33 typedef void (*networks_search_found) 
34         (int status, const char * id,
35         const char * ssid, const char * ap, int dB, gpointer user_data);
36
37 void networks_search_start(networks_search_found found_cb, gpointer user_data);
38 void networks_search_stop();
39
40 typedef void (*networks_connect_result)
41         (int status, const char * error, gpointer user_data);
42 void networks_connect(const char * id,
43         networks_connect_result result_cb, gpointer user_data);
44 void networks_disconnect(const char * id);
45
46 typedef void (*networks_status_result)
47         (int status, const char * data, int rssi, gpointer user_data);
48 void networks_status(networks_status_result result_cb, gpointer user_data);
49
50 #endif