Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions WiServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,18 @@ extern "C" {
#define LF 10

// Strings stored in program memory (defined in strings.c)
extern const prog_char httpOK[];
extern const prog_char httpNotFound[];
extern const prog_char http10[];
extern const prog_char post[];
extern const prog_char get[];
extern const prog_char authBasic[];
extern const prog_char host[];
extern const prog_char userAgent[];
extern const prog_char contentTypeForm[];
extern const prog_char contentLength[];
extern const prog_char status[];
extern const prog_char base64Chars[];
extern const char PROGMEM httpOK[];
extern const char PROGMEM httpNotFound[];
extern const char PROGMEM http10[];
extern const char PROGMEM post[];
extern const char PROGMEM get[];
extern const char PROGMEM authBasic[];
extern const char PROGMEM host[];
extern const char PROGMEM userAgent[];
extern const char PROGMEM contentTypeForm[];
extern const char PROGMEM contentLength[];
extern const char PROGMEM status[];
extern const char PROGMEM base64Chars[];



Expand Down
10 changes: 5 additions & 5 deletions config.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@
extern U8 local_ip[];
extern U8 gateway_ip[];
extern U8 subnet_mask[];
extern const prog_char ssid[];
extern const char PROGMEM ssid[];
extern U8 ssid_len;
extern const prog_char security_passphrase[];
extern const char PROGMEM security_passphrase[];
extern U8 security_passphrase_len;
extern U8 security_type;
extern U8 wireless_mode;

extern prog_uchar wep_keys[];
extern const uint8_t wep_keys[];

extern const prog_char webpage[];
extern const prog_char twitter[];
extern const char PROGMEM webpage[];
extern const char PROGMEM twitter[];
extern unsigned char mfg_id[4];

#define WIRELESS_MODE_INFRA 1
Expand Down
6 changes: 3 additions & 3 deletions examples/SimpleServer/SimpleServer.pde
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
unsigned char local_ip[] = {192,168,1,2}; // IP address of WiShield
unsigned char gateway_ip[] = {192,168,1,1}; // router or gateway IP address
unsigned char subnet_mask[] = {255,255,255,0}; // subnet mask for the local network
const prog_char ssid[] PROGMEM = {"ASYNCLABS"}; // max 32 bytes
const char PROGMEM ssid[] PROGMEM = {"ASYNCLABS"}; // max 32 bytes

unsigned char security_type = 0; // 0 - open; 1 - WEP; 2 - WPA; 3 - WPA2

// WPA/WPA2 passphrase
const prog_char security_passphrase[] PROGMEM = {"12345678"}; // max 64 characters
const char PROGMEM security_passphrase[] PROGMEM = {"12345678"}; // max 64 characters

// WEP 128-bit keys
// sample HEX keys
prog_uchar wep_keys[] PROGMEM = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, // Key 0
const uint8_t wep_keys[] PROGMEM = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, // Key 0
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Key 1
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Key 2
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // Key 3
Expand Down
24 changes: 12 additions & 12 deletions strings.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,43 +36,43 @@
// They are stored in program memory to reduce RAM usage.

// HTTP OK response
const prog_char httpOK[] = {"HTTP/1.0 200 OK"};
const char PROGMEM httpOK[] = {"HTTP/1.0 200 OK"};

// HTTP Not Found response
const prog_char httpNotFound[] = {"HTTP/1.0 404 Not Found"};
const char PROGMEM httpNotFound[] = {"HTTP/1.0 404 Not Found"};


#ifdef ENABLE_CLIENT_MODE

// Trailing HTTP/1.0 for GET and POST requests
const prog_char http10[] = {" HTTP/1.0"};
const char PROGMEM http10[] = {" HTTP/1.0"};

// Authorization: Basic field name
const prog_char authBasic[] = {"Authorization: Basic "};
const char PROGMEM authBasic[] = {"Authorization: Basic "};

// Content-Length field name
const prog_char contentLength[] = {"Content-Length: "};
const char PROGMEM contentLength[] = {"Content-Length: "};

// User agent field with value
const prog_char userAgent[] = {"User-Agent: WiServer/1.1"};
const char PROGMEM userAgent[] = {"User-Agent: WiServer/1.1"};

// Content type form data
const prog_char contentTypeForm[] = {"Content-Type: application/x-www-form-urlencoded"};
const char PROGMEM contentTypeForm[] = {"Content-Type: application/x-www-form-urlencoded"};

// POST request
const prog_char post[] = {"POST "};
const char PROGMEM post[] = {"POST "};

// GET request
const prog_char get[] = {"GET "};
const char PROGMEM get[] = {"GET "};

// Host, User-Agent, and Content-Type lines for Twitter POSTs
const prog_char host[] = {"Host: "};
const char PROGMEM host[] = {"Host: "};

// Status prefix for Twitter
const prog_char status[] = {"status="};
const char PROGMEM status[] = {"status="};

/* Base64 Encoder data */
const prog_char base64Chars[] PROGMEM = {"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"};
const char PROGMEM base64Chars[] PROGMEM = {"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"};


#endif // ENABLE_CLIENT_MODE
Expand Down