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
12 changes: 6 additions & 6 deletions 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 Expand Up @@ -209,7 +209,7 @@ void Server::printTime(long t) {
/*
* Writes a byte to the virtual buffer for the current connection
*/
void Server::write(uint8_t b) {
size_t Server::write(uint8_t b) {

// Make sure there's a current connection
if (uip_conn) {
Expand Down Expand Up @@ -639,22 +639,22 @@ char getChar(int nibble) {
}

void storeBlock(char* src, char* dest, int len) {

dest[0] = getChar(src[0] >> 2);
dest[1] = getChar(((src[0] & 0x03) << 4) | ((src[1] & 0xf0) >> 4));
dest[2] = len > 1 ? getChar(((src[1] & 0x0f) << 2) | ((src[2] & 0xc0) >> 6)) : '=';
dest[3] = len > 2 ? getChar(src[2] & 0x3f ) : '=';
}

char* Server::base64encode(char* data) {

int len = strlen(data);
int outLenPadded = ((len + 2) / 3) << 2;
char* out = (char*)malloc(outLenPadded + 1);

char* outP = out;
while (len > 0) {

storeBlock(data, outP, min(len,3));
outP += 4;
data += 3;
Expand Down
8 changes: 4 additions & 4 deletions WiServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 @@ -248,17 +248,17 @@ class Server: public Print
* A value of -1 disables activity indication.
*/
void setIndicatorPins(int tx, int rx);

#ifdef ENABLE_CLIENT_MODE

/*
* Called by request classes to submit themselves to the queue
*/
void submitRequest(GETrequest *req);

char* base64encode(char* data);



#endif // ENABLE_CLIENT_MODE

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"

void WiShield::init()
Expand Down
6 changes: 3 additions & 3 deletions apps-conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
******************************************************************************

TCP/IP stack and driver for the WiShield 1.0 wireless devices

/
Copyright(c) 2009 Async Labs Inc. All rights reserved.

This program is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -36,11 +36,11 @@
#define __APPS_CONF_H__

//Here we include the header file for the application(s) we use in our project.
#define APP_WEBSERVER
//#define APP_WEBSERVER
//#define APP_WEBCLIENT
//#define APP_SOCKAPP
//#define APP_UDPAPP
//#define APP_WISERVER
#define APP_WISERVER

#ifdef APP_WEBSERVER
#include "webserver.h"
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 "wiring_private.h"

#if 0
//Counted time
Expand Down