#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/stat.h>
#include <arpa/inet.h>
#include <fcntl.h>
#include <netdb.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <sys/un.h>
#include <errno.h>
#include <bytecodes.h>
#include "wpa_ctrl.h"
#include "common.h"
#include "lms2012.h"
Go to the source code of this file.
|
enum | {
WIFI_NOT_INITIATED,
WIFI_INIT,
WIFI_INITIATED,
READY_FOR_AP_SEARCH,
SEARCH_APS,
SEARCH_PENDING,
AP_LIST_UPDATED,
AP_CONNECTING,
WIFI_CONNECTED_TO_AP,
UDP_NOT_INITIATED,
INIT_UDP_CONNECTION,
UDP_FIRST_TX,
UDP_VISIBLE,
UDP_CONNECTED,
TCP_NOT_CONNECTED,
TCP_CONNECTED,
CLOSED
} |
|
enum | { NOT_INIT = 0x00,
LOAD_SUPPLICANT = 0x01,
WAIT_ON_INTERFACE = 0x02,
DONE = 0x80
} |
|
enum | {
TCP_IDLE = 0x00,
TCP_WAIT_ON_START = 0x01,
TCP_WAIT_ON_LENGTH = 0x02,
TCP_WAIT_ON_FIRST_CHUNK = 0x04,
TCP_WAIT_ON_ONLY_CHUNK = 0x08,
TCP_WAIT_COLLECT_BYTES = 0x10
} |
|
enum | BEACON_MODE { NO_TX,
TX_BEACON
} |
|
enum | KNOWN_HW { HW_NOT_KNOWN,
HW_KNOWN
} |
|
enum | TCP_STATES { TCP_DOWN,
TCP_UP
} |
|
enum | {
VISIBLE = 0x1,
CONNECTED = 0x02,
WPA2 = 0x04,
KNOWN = 0x08,
UNKNOWN = 0x80
} |
|
enum | { NO_CONNECTION = 0x0,
CONNECTION_MADE = 0x01,
SEARCHING = 0x02
} |
|
|
RESULT | cWiFiGetIpAddr (char *IpAddress) |
|
RESULT | cWiFiGetMyMacAddr (char *MacAddress) |
|
RESULT | cWiFiKnownDongleAttached (void) |
|
RESULT | cWiFiTxingBeacons (void) |
|
void | cWiFiUdpClientClose (void) |
|
RESULT | cWiFiTcpConnected (void) |
|
UWORD | cWiFiWriteTcp (UBYTE *Buffer, UWORD Length) |
|
UWORD | cWiFiReadTcp (UBYTE *Buffer, UWORD Length) |
|
void | cWiFiMoveUpInList (int Index) |
|
void | cWiFiMoveDownInList (int Index) |
|
void | cWiFiDeleteInList (int Index) |
|
RESULT | cWiFiGetApMacAddr (char *MacAddr, int Index) |
|
RESULT | cWiFiGetHiddenMacAddr (char *MacAddr, int Index) |
|
RESULT | cWiFiGetName (char *ApName, int Index, char Length) |
|
RESULT | cWiFiSetName (char *ApName, int Index) |
|
RESULT | cWiFiSetSsid (char *Ssid) |
|
RESULT | cWiFiSetKeyManagToWpa2 (void) |
|
RESULT | cWiFiSetKeyManagToNone (void) |
|
RESULT | cWiFiGetIndexFromName (char *Name, UBYTE *Index) |
|
void | cWiFiSetEncryptToWpa2 (int Index) |
|
void | cWiFiSetEncryptToNone (int Index) |
|
void | cWiFiSetKnown (int Index) |
|
void | cWiFiDeleteAsKnown (int LocalIndex) |
|
unsigned char | cWiFiGetFlags (int Index) |
|
RESULT | cWiFiConnectToAp (int Index) |
|
RESULT | cWiFiMakePsk (char *ApSsid, char *PassPhrase, int Index) |
|
int | cWiFiGetApListSize (void) |
|
void | cWiFiIncApListSize (void) |
|
RESULT | cWiFiAddHidden (char *HiddenApName, char *Security, char *PassWord) |
|
RESULT | cWiFiScanForAPs (void) |
|
RESULT | cWiFiGetOnStatus (void) |
|
RESULT | cWiFiGetStatus (void) |
|
void | cWiFiSetBtSerialNo (void) |
|
void | cWiFiSetBrickName (void) |
|
void | cWiFiControl (void) |
|
RESULT | cWiFiTurnOn (void) |
|
RESULT | cWiFiTurnOff (void) |
|
RESULT | cWiFiExit (void) |
|
RESULT | cWiFiInit (void) |
|
#define BLUETOOTH_SER_LENGTH 13 |
#define BRICK_HOSTNAME_LENGTH (NAME_LENGTH + 1) |
#define BROADCAST_IP_LOW "255" |
#define BROADCAST_PORT 3015 |
#define FREQUENCY_LENGTH 5 |
#define FRIENDLY_NAME_LENGTH 33 |
#define KEY_MGMT_LENGTH 33 |
#define MAC_ADDRESS_LENGTH 18 |
#define PAIRWISE_LENGTH 33 |
#define SECURITY_LENGTH 129 |
#define SIGNAL_LEVEL_LENGTH 4 |
#define TIME_FOR_WIFI_DONGLE_CHECK 10 |
#define WIFI_INIT_DELAY 10 |
#define WIFI_INIT_TIMEOUT 10 |
#define WIFI_PERSISTENT_FILENAME "WiFiConnections.dat" |
#define WIFI_PERSISTENT_PATH vmSETTINGS_DIR |
Enumerator |
---|
WIFI_NOT_INITIATED |
|
WIFI_INIT |
|
WIFI_INITIATED |
|
READY_FOR_AP_SEARCH |
|
SEARCH_APS |
|
SEARCH_PENDING |
|
AP_LIST_UPDATED |
|
AP_CONNECTING |
|
WIFI_CONNECTED_TO_AP |
|
UDP_NOT_INITIATED |
|
INIT_UDP_CONNECTION |
|
UDP_FIRST_TX |
|
UDP_VISIBLE |
|
UDP_CONNECTED |
|
TCP_NOT_CONNECTED |
|
TCP_CONNECTED |
|
CLOSED |
|
Definition at line 74 of file c_wifi.h.
Enumerator |
---|
NOT_INIT |
|
LOAD_SUPPLICANT |
|
WAIT_ON_INTERFACE |
|
DONE |
|
Definition at line 96 of file c_wifi.h.
Enumerator |
---|
TCP_IDLE |
|
TCP_WAIT_ON_START |
|
TCP_WAIT_ON_LENGTH |
|
TCP_WAIT_ON_FIRST_CHUNK |
|
TCP_WAIT_ON_ONLY_CHUNK |
|
TCP_WAIT_COLLECT_BYTES |
|
Definition at line 104 of file c_wifi.h.
Enumerator |
---|
VISIBLE |
|
CONNECTED |
|
WPA2 |
|
KNOWN |
|
UNKNOWN |
|
Definition at line 135 of file c_wifi.h.
Enumerator |
---|
NO_CONNECTION |
|
CONNECTION_MADE |
|
SEARCHING |
|
Definition at line 146 of file c_wifi.h.
Enumerator |
---|
NO_TX |
|
TX_BEACON |
|
Definition at line 114 of file c_wifi.h.
Enumerator |
---|
HW_NOT_KNOWN |
|
HW_KNOWN |
|
Definition at line 121 of file c_wifi.h.
Enumerator |
---|
TCP_DOWN |
|
TCP_UP |
|
Definition at line 128 of file c_wifi.h.
RESULT cWiFiAddHidden |
( |
char * |
HiddenApName, |
|
|
char * |
Security, |
|
|
char * |
PassWord |
|
) |
| |
RESULT cWiFiConnectToAp |
( |
int |
Index | ) |
|
void cWiFiControl |
( |
void |
| ) |
|
void cWiFiDeleteAsKnown |
( |
int |
LocalIndex | ) |
|
void cWiFiDeleteInList |
( |
int |
Index | ) |
|
RESULT cWiFiExit |
( |
void |
| ) |
|
int cWiFiGetApListSize |
( |
void |
| ) |
|
RESULT cWiFiGetApMacAddr |
( |
char * |
MacAddr, |
|
|
int |
Index |
|
) |
| |
unsigned char cWiFiGetFlags |
( |
int |
Index | ) |
|
RESULT cWiFiGetHiddenMacAddr |
( |
char * |
MacAddr, |
|
|
int |
Index |
|
) |
| |
RESULT cWiFiGetIndexFromName |
( |
char * |
Name, |
|
|
UBYTE * |
Index |
|
) |
| |
RESULT cWiFiGetIpAddr |
( |
char * |
IpAddress | ) |
|
RESULT cWiFiGetMyMacAddr |
( |
char * |
MacAddress | ) |
|
RESULT cWiFiGetName |
( |
char * |
ApName, |
|
|
int |
Index, |
|
|
char |
Length |
|
) |
| |
RESULT cWiFiGetOnStatus |
( |
void |
| ) |
|
RESULT cWiFiGetStatus |
( |
void |
| ) |
|
void cWiFiIncApListSize |
( |
void |
| ) |
|
RESULT cWiFiInit |
( |
void |
| ) |
|
RESULT cWiFiKnownDongleAttached |
( |
void |
| ) |
|
RESULT cWiFiMakePsk |
( |
char * |
ApSsid, |
|
|
char * |
PassPhrase, |
|
|
int |
Index |
|
) |
| |
void cWiFiMoveDownInList |
( |
int |
Index | ) |
|
void cWiFiMoveUpInList |
( |
int |
Index | ) |
|
RESULT cWiFiScanForAPs |
( |
void |
| ) |
|
void cWiFiSetBrickName |
( |
void |
| ) |
|
void cWiFiSetBtSerialNo |
( |
void |
| ) |
|
void cWiFiSetEncryptToNone |
( |
int |
Index | ) |
|
void cWiFiSetEncryptToWpa2 |
( |
int |
Index | ) |
|
RESULT cWiFiSetKeyManagToNone |
( |
void |
| ) |
|
RESULT cWiFiSetKeyManagToWpa2 |
( |
void |
| ) |
|
void cWiFiSetKnown |
( |
int |
Index | ) |
|
RESULT cWiFiSetName |
( |
char * |
ApName, |
|
|
int |
Index |
|
) |
| |
RESULT cWiFiSetSsid |
( |
char * |
Ssid | ) |
|
RESULT cWiFiTcpConnected |
( |
void |
| ) |
|
RESULT cWiFiTurnOff |
( |
void |
| ) |
|
RESULT cWiFiTurnOn |
( |
void |
| ) |
|
RESULT cWiFiTxingBeacons |
( |
void |
| ) |
|
void cWiFiUdpClientClose |
( |
void |
| ) |
|