source: arduino-1-6-7/trunk/fuentes/arduino-ide-amd64/hardware/arduino/avr/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/COMPONENTS/WIFI/HD/wlap_api.h @ 46

Last change on this file since 46 was 46, checked in by jrpelegrina, 4 years ago

First release to Xenial

File size: 4.6 KB
Line 
1/*
2 *  Programming interface for wlap_api.
3 *  Copyright (C) 2011 HD Wireless AB
4 *
5 *  You should have received a copy of the license along with this library.
6 */
7
8/*! \file wlap_api.h *************************************************************
9 *
10 * \brief WiFi AP API
11 *
12 * This file provides the wlap_api interface.
13 *
14 * - Compiler:           GNU GCC for AVR32
15 * - Supported devices: 
16 *  \li SPB104 + EVK1100
17 *  \li SPB104 + EVK1101
18 *  \li SPB104 + EVK1104
19 *  \li SPB104 + EVK1105 (SPI)
20 *  \li SPB104 + EVK1105 (SPI + irq)
21 *  \li SPB105 + EVK1105 (SPI)
22 * - AppNote:
23 *
24 * \author               H&D Wireless AB: \n
25 *
26 *****************************************************************************
27 *
28 * \section intro Introduction
29 * This is the documentation for the WiFi AP Driver API \a wlap_api.
30 *
31 * \section files Main Files
32 * - wlap_api.h : WiFi driver interface.
33 * - libwlap_api_*.*.a - Driver library.
34 *
35 */
36
37#ifndef WLAP_API_H
38#define WLAP_API_H
39 
40#define WLAP_API_RELEASE_NAME "unknown"
41
42#include <wl_api.h>
43
44/** \defgroup wl_softap Access Point Mode
45 *
46 * \brief Support the WiFi Access Point mode.
47 *
48 *  @{
49 */
50/*
51 * Station representation
52 *
53 */
54struct wl_sta_t
55{
56        struct wl_mac_addr_t bssid; /**<  The BSSID of the network. */
57        uint8_t queued_pkt_cnt;     /**< Number of queueud packets for
58                                       this STA. */
59        uint8_t in_ps;              /**< Is the STA in power save mode. */
60        uint8_t aid;                /**< STA AID */
61};
62
63/* Station list representation. Array of pointers to wl_sta_t entries. */
64struct wl_sta_list_t
65{
66        struct wl_sta_t **sta; /**< The list of pointers to stations */
67        size_t cnt;            /**< Number of stations               */
68};
69
70/*! \brief Get the list of currently associated stations (SoftAP).
71 *
72 * Retrieves the list of current stations from
73 * the driver.
74 *
75 * This function is not thread safe. It must be called in the
76 * same execution context as wl_poll().
77 *
78 * @param network_list Output buffer. The API call returns
79 *        a pointer to allocated memory containing the network list.
80 * @return
81 * - WL_SUCCESS
82 * - WL_FAILURE.
83 */
84wl_err_t wlap_get_sta_list(struct wl_sta_list_t **network_list);
85
86
87/*! Callback used to read data from a TX packet.
88 * This function is supplied by the user of the API.
89 *
90 * @param dst Destination buffer. The data should be copied
91 *  to this buffer.
92 * @param src_handle Handle to the source packet from where
93 *  the data should be copied. This handle is the same one that
94 *  is passed in parameter \a pkt_handle to \a wl_process_tx().
95 * @param read_len Number of bytes to copy from \a src_handle
96 *  to \a dst.
97 * @param offset The offset in bytes, counting from the
98 *  beginning of the Ethernet header, from where to copy data.
99 * @return
100 *  - The number of bytes copied. This number may be smaller
101 *    than the length requested in \a read_len but it may not
102 *    be shorter than the length of the packet counting from
103 *    \a offset. In other words, if the caller of this function
104 *    receives a return count that is shorter than \a read_len
105 *    he will assume that all packet data has been read.
106 * - < 0 on error.
107 */
108typedef ssize_t (*wl_pkt_read_cb_t)(char *dst,
109                                    void *src_handle,
110                                    size_t read_len,
111                                    int offset);
112
113/*! \brief Register a data access function for TX packets (SoftAP).
114 *
115 * When a TX data packet has a different representation than a single
116 * contiguous buffer in memory then a packet read function must be
117 * implemented and registered with this call. Whenever the library
118 * needs to read packet data it will call this function to do it.
119 *
120 * This function can be ignored if the TX packet representation is
121 * a single contiguous buffer. This function is only needed in SoftAP
122 * mode.
123 *
124 * @param pkt_read_cb Read callback.
125 * @param ctx Context
126 */
127void wl_register_pkt_read_cb(wl_pkt_read_cb_t pkt_read_cb);
128
129/*! \brief Start a network using the SoftAP mode.
130 *
131 * This call will cause the WiFi chip to start sending beacons
132 * and accept associations from WiFi stations.
133 *
134 */
135wl_err_t wlap_start_ap(const char *ssid,
136                     const size_t ssid_len,
137                     const uint8_t channel,
138                     const enum wl_auth_mode auth_mode,
139                     const enum wl_enc_type enc_type);
140
141/*! \brief Disconnect a STA (SoftAP)
142 *
143 * @param bssid The BSSID of the station to disconnect.
144 * @return
145 *  - WL_SUCCESS
146 *  - WL_FAILURE.
147 */
148wl_err_t wlap_disconnect_sta(const struct wl_mac_addr_t bssid);
149
150
151/*! @} */ /* End wl_softap group */
152
153
154#endif
Note: See TracBrowser for help on using the repository browser.