Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modifications required to compile under Arduino 1.6.3 #8

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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
17 changes: 17 additions & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,20 @@ New features:

Known issues:
None


-------------------------------------------------------------------------------
Pin usage on WiShield v1.0
-------------------------------------------------------------------------------
1.SPI
* Slave select (SS) : Arduino pin 10
* Clock (SCK) : Arduino pin 13
* Master in, slave out (MISO) : Arduino pin 12
* Master out, slave in (MOSI) : Arduino pin 11
2. Interrupt (Uses only one of the following, depending on jumper setting)
* INT0 : Arduino pin 2
* DIG8 : Arduino pin 8
3. LED : Arduino pin 9
* To regain use of this pin, remove the LED jumper cap
4. 5V power
5. GND
2 changes: 1 addition & 1 deletion WiServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
*****************************************************************************/


#include "WProgram.h"
#include "arduino.h"
#include "WiServer.h"

extern "C" {
Expand Down
14 changes: 7 additions & 7 deletions WiServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ typedef void (*returnFunction)(char* data, int len);
/*
* Function for serving web pages
*/
typedef boolean (*pageServingFunction)(char* URL);
typedef bool (*pageServingFunction)(char* URL);

/*
* Function for providing the body of a POST request
Expand Down Expand Up @@ -103,7 +103,7 @@ class GETrequest
* or is currently connected and communicating with the server). If it is, any calls that attempt
* to change the properties of the request will be ignored.
*/
boolean isActive();
bool isActive();

/*
* Sets the URL for the request. Calls to this method will be ignored if the request
Expand All @@ -124,7 +124,7 @@ class GETrequest
// Return value callback function (may be NULL)
returnFunction returnFunc;
// Indicates if the request is currently active (i.e. has a connection)
boolean active;
bool active;
// Body data callback function (may be NULL)
bodyFunction body;
// Body preamble (may be NULL)
Expand Down Expand Up @@ -185,7 +185,7 @@ class Server: public Print
* will output log info via the Serial class. Verbose mode is disabled by
* default, but is automatically enabled if DEBUG is defined
*/
void enableVerboseMode(boolean enable);
void enableVerboseMode(bool enable);

/**
* The server task method (must be called in the main loop to run the WiServer)
Expand All @@ -195,7 +195,7 @@ class Server: public Print
/**
* Writes a single byte to the current connection buffer
*/
virtual void write(uint8_t);
virtual size_t write(uint8_t);

/**
* Prints a string that is stored in program memory
Expand Down Expand Up @@ -224,7 +224,7 @@ class Server: public Print
* in the network. Changes to the content of the page should only be made if this method
* returns false.
*/
boolean sendInProgress();
bool sendInProgress();

/**
* Checks if the client for the current server request resides on the same local network
Expand All @@ -239,7 +239,7 @@ class Server: public Print
* Note that security checks based on the client IP address are not 100% reliable,
* so this feature should not be relied upon to control access to sensitive data!
*/
boolean clientIsLocal();
bool clientIsLocal();

/**
* Sets the pins used to indicate TX and RX activity over the network.
Expand Down
2 changes: 1 addition & 1 deletion WiShield.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ extern "C" {
void stack_process(void);
}

#include "WProgram.h"
#include "arduino.h"
#include "WiShield.h"

boolean WiShield::init(U8 seconds)
Expand Down
4 changes: 2 additions & 2 deletions WiShield.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ extern "C" {

class WiShield {
public:
boolean init() {return init(60);}
boolean init(U8 seconds);
bool init() {return init(60);}
bool init(U8 seconds);
void run();
};

Expand Down
4 changes: 2 additions & 2 deletions apps-conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@
// DNS and/or DHCP then your APP_TYPE (e.g. APP_WISERVER) AND APP_UDPAPP must be defined
// (uncommented). Currently only APP_UDPAPP may be defined at the same time as any other APP_TYPE
//
//#define APP_WEBSERVER
#define APP_WEBSERVER
//#define APP_WEBCLIENT
//#define APP_SOCKAPP
//#define APP_UDPAPP
#define APP_WISERVER
//#define APP_WISERVER

//
// Add on features; uncomment to enable additional functionality
Expand Down
2 changes: 1 addition & 1 deletion clock-arch.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include <avr/sfr_defs.h>

#include "clock-arch.h"
#include "wiring.h"
#include "arduino.h"

#if 0
//Counted time
Expand Down
8 changes: 4 additions & 4 deletions config.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ extern U8 gateway_ip[];
extern U8 subnet_mask[];
extern char 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 unsigned char PROGMEM 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
12 changes: 6 additions & 6 deletions examples/WebServer/WebServer.pde
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
#include <WiShield.h>

// Wireless configuration parameters ----------------------------------------
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 local_ip[] = {10,0,9,44}; // IP address of WiShield
unsigned char gateway_ip[] = {10,0,9,1}; // router or gateway IP address
unsigned char subnet_mask[] = {255,255,255,0}; // subnet mask for the local network
char ssid[] = {"ASYNCLABS"}; // max 32 bytes
char ssid[] = {"NintendoDS"}; // 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 = {"Etc1brew!"}; // max 64 characters

// WEP 128-bit keys
prog_uchar wep_keys[] PROGMEM = {
const unsigned char PROGMEM 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
Expand All @@ -39,7 +39,7 @@ void setup()
}

// This is the webpage that is served up by the webserver
const prog_char webpage[] PROGMEM = {"HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n<center><h1>Hello World!! I am WiShield</h1><form method=\"get\" action=\"0\">Toggle LED:<input type=\"submit\" name=\"0\" value=\"LED1\"></input></form></center>"};
const char PROGMEM webpage[] PROGMEM = {"HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n<center><h1>Hello World!! I am WiShield</h1><form method=\"get\" action=\"0\">Toggle LED:<input type=\"submit\" name=\"0\" value=\"LED1\"></input></form></center>"};

void loop()
{
Expand Down
2 changes: 1 addition & 1 deletion request.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ void GETrequest::submit() {
if (!this->active) WiServer.submitRequest(this);
}

boolean GETrequest::isActive() {
bool GETrequest::isActive() {
return this->active;
}

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
5 changes: 3 additions & 2 deletions witypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,12 @@ typedef volatile unsigned long vuint32;

typedef unsigned char u8;
typedef unsigned char U8;
typedef unsigned int u16;
typedef short unsigned int u16;
typedef unsigned int U16;
typedef unsigned long u32;
typedef unsigned long U32;

typedef uint8_t boolean;
//typedef uint8_t boolean;
//typedef bool boolean;

#endif /* WITYPES_H_ */