Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers zg_if.h Source File

zg_if.h

Go to the documentation of this file.
00001 
00002 /*
00003 Copyright (c) 2010 Donatien Garnier (donatiengar [at] gmail [dot] com)
00004  
00005 Permission is hereby granted, free of charge, to any person obtaining a copy
00006 of this software and associated documentation files (the "Software"), to deal
00007 in the Software without restriction, including without limitation the rights
00008 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
00009 copies of the Software, and to permit persons to whom the Software is
00010 furnished to do so, subject to the following conditions:
00011  
00012 The above copyright notice and this permission notice shall be included in
00013 all copies or substantial portions of the Software.
00014  
00015 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00016 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00017 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
00018 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00019 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
00020 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
00021 THE SOFTWARE.
00022 */
00023 
00024 /**
00025 @file
00026 ZG2100 NetServices high-level interface : configuration & setup
00027 */
00028 //Donatien Garnier 2010
00029 
00030 #ifndef ZG_IF_H
00031 #define ZG_IF_H
00032 
00033 #include "zg_defs.h"
00034 
00035 ///Scans for available networks on given \a channel.
00036 void zg_scan(byte channel);
00037 
00038 ///Will be called on scan completion, for now it is just a debug dump.
00039 void zg_on_scan_results(byte* buf, int len);
00040 
00041 ///Sets the SSID of the network to be joined.
00042 void zg_set_ssid(const char* ssid);
00043 
00044 ///Sets WEP key.
00045 void zg_set_wep_key(const byte* key, int len);
00046 
00047 ///Sets WPA passphrase (will compute PSK key and set it).
00048 void zg_set_wpa_pass(const char* pass);
00049 
00050 ///On completion of the passphrase computation.
00051 void zg_on_psk_key(byte* buf, int len);
00052 
00053 ///Sets PSK key (preferred to be called directly than recomputing it every time using \a zg_set_wpa_pass).
00054 void zg_set_psk_key(const byte* key, int len);
00055 
00056 ///Connects to network.
00057 void zg_connect(ZG_BSS_TYPE type, ZG_SECURITY security);
00058 
00059 ///On connection result.
00060 void zg_on_connect(zg_err result);
00061 
00062 ///Gets connection result.
00063 zg_err zg_get_connection_result();
00064 
00065 ///Disconnects from network.
00066 void zg_disconnect();
00067 
00068 void hexdump(byte* buffer, int size);
00069 
00070 #endif