User | Revision | Line number | New contents of line |
donatien |
0:0f5a52711275
|
1
|
|
donatien |
0:0f5a52711275
|
2
|
/*
|
donatien |
0:0f5a52711275
|
3
|
Copyright (c) 2010 Donatien Garnier (donatiengar [at] gmail [dot] com)
|
donatien |
0:0f5a52711275
|
4
|
|
donatien |
0:0f5a52711275
|
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
donatien |
0:0f5a52711275
|
6
|
of this software and associated documentation files (the "Software"), to deal
|
donatien |
0:0f5a52711275
|
7
|
in the Software without restriction, including without limitation the rights
|
donatien |
0:0f5a52711275
|
8
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
donatien |
0:0f5a52711275
|
9
|
copies of the Software, and to permit persons to whom the Software is
|
donatien |
0:0f5a52711275
|
10
|
furnished to do so, subject to the following conditions:
|
donatien |
0:0f5a52711275
|
11
|
|
donatien |
0:0f5a52711275
|
12
|
The above copyright notice and this permission notice shall be included in
|
donatien |
0:0f5a52711275
|
13
|
all copies or substantial portions of the Software.
|
donatien |
0:0f5a52711275
|
14
|
|
donatien |
0:0f5a52711275
|
15
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
donatien |
0:0f5a52711275
|
16
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
donatien |
0:0f5a52711275
|
17
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
donatien |
0:0f5a52711275
|
18
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
donatien |
0:0f5a52711275
|
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
donatien |
0:0f5a52711275
|
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
donatien |
0:0f5a52711275
|
21
|
THE SOFTWARE.
|
donatien |
0:0f5a52711275
|
22
|
*/
|
donatien |
0:0f5a52711275
|
23
|
|
donatien |
3:e02ec42cf9c8
|
24
|
/**
|
donatien |
3:e02ec42cf9c8
|
25
|
@file
|
donatien |
3:e02ec42cf9c8
|
26
|
ZG2100 NetServices high-level interface : configuration & setup
|
donatien |
3:e02ec42cf9c8
|
27
|
*/
|
donatien |
0:0f5a52711275
|
28
|
//Donatien Garnier 2010
|
donatien |
0:0f5a52711275
|
29
|
|
donatien |
0:0f5a52711275
|
30
|
#ifndef ZG_IF_H
|
donatien |
0:0f5a52711275
|
31
|
#define ZG_IF_H
|
donatien |
0:0f5a52711275
|
32
|
|
donatien |
0:0f5a52711275
|
33
|
#include "zg_defs.h"
|
donatien |
0:0f5a52711275
|
34
|
|
donatien |
3:e02ec42cf9c8
|
35
|
///Scans for available networks on given \a channel.
|
donatien |
0:0f5a52711275
|
36
|
void zg_scan(byte channel);
|
donatien |
0:0f5a52711275
|
37
|
|
donatien |
3:e02ec42cf9c8
|
38
|
///Will be called on scan completion, for now it is just a debug dump.
|
donatien |
0:0f5a52711275
|
39
|
void zg_on_scan_results(byte* buf, int len);
|
donatien |
0:0f5a52711275
|
40
|
|
donatien |
3:e02ec42cf9c8
|
41
|
///Sets the SSID of the network to be joined.
|
donatien |
0:0f5a52711275
|
42
|
void zg_set_ssid(const char* ssid);
|
donatien |
0:0f5a52711275
|
43
|
|
donatien |
3:e02ec42cf9c8
|
44
|
///Sets WEP key.
|
donatien |
0:0f5a52711275
|
45
|
void zg_set_wep_key(const byte* key, int len);
|
donatien |
0:0f5a52711275
|
46
|
|
donatien |
3:e02ec42cf9c8
|
47
|
///Sets WPA passphrase (will compute PSK key and set it).
|
donatien |
0:0f5a52711275
|
48
|
void zg_set_wpa_pass(const char* pass);
|
donatien |
0:0f5a52711275
|
49
|
|
donatien |
3:e02ec42cf9c8
|
50
|
///On completion of the passphrase computation.
|
donatien |
0:0f5a52711275
|
51
|
void zg_on_psk_key(byte* buf, int len);
|
donatien |
0:0f5a52711275
|
52
|
|
donatien |
3:e02ec42cf9c8
|
53
|
///Sets PSK key (preferred to be called directly than recomputing it every time using \a zg_set_wpa_pass).
|
donatien |
0:0f5a52711275
|
54
|
void zg_set_psk_key(const byte* key, int len);
|
donatien |
0:0f5a52711275
|
55
|
|
donatien |
3:e02ec42cf9c8
|
56
|
///Connects to network.
|
donatien |
0:0f5a52711275
|
57
|
void zg_connect(ZG_BSS_TYPE type, ZG_SECURITY security);
|
donatien |
0:0f5a52711275
|
58
|
|
donatien |
3:e02ec42cf9c8
|
59
|
///On connection result.
|
donatien |
0:0f5a52711275
|
60
|
void zg_on_connect(zg_err result);
|
donatien |
0:0f5a52711275
|
61
|
|
donatien |
3:e02ec42cf9c8
|
62
|
///Gets connection result.
|
donatien |
0:0f5a52711275
|
63
|
zg_err zg_get_connection_result();
|
donatien |
0:0f5a52711275
|
64
|
|
donatien |
3:e02ec42cf9c8
|
65
|
///Disconnects from network.
|
donatien |
0:0f5a52711275
|
66
|
void zg_disconnect();
|
donatien |
0:0f5a52711275
|
67
|
|
donatien |
0:0f5a52711275
|
68
|
void hexdump(byte* buffer, int size);
|
donatien |
0:0f5a52711275
|
69
|
|
donatien |
0:0f5a52711275
|
70
|
#endif
|