Changed around everything to make use of sdk 0.9.4. CODE IS STILL BROKEN!

This commit is contained in:
Jeroen Domburg
2014-12-22 17:50:02 +01:00
parent 7df9b2bcdb
commit e56fdc4d6a
62 changed files with 10 additions and 11021 deletions
+1 -1
View File
@@ -21,8 +21,8 @@ HTTP auth implementation. Only does basic authentication for now.
#include "auth.h"
#include "io.h"
#include "base64.h"
#include "espmissingincludes.h"
#include <ip_addr.h>
#include "espmissingincludes.h"
int ICACHE_FLASH_ATTR authBasic(HttpdConnData *connData) {
const char *forbidden="401 Forbidden.";
-1
View File
@@ -1,6 +1,5 @@
/* base64.c : base-64 / MIME encode/decode */
/* PUBLIC DOMAIN - Jon Mayo - November 13, 2003 */
#include "espmissingincludes.h"
#include "c_types.h"
#include <stdio.h>
#include <stdint.h>
+2 -1
View File
@@ -20,8 +20,9 @@ flash as a binary. Also handles the hit counter on the main page.
#include "httpd.h"
#include "cgi.h"
#include "io.h"
#include "espmissingincludes.h"
#include <ip_addr.h>
#include "espmissingincludes.h"
//cause I can't be bothered to write an ioGetLed()
static char currLedState=0;
+3
View File
@@ -194,6 +194,8 @@ int ICACHE_FLASH_ATTR httpdGetHeader(HttpdConnData *conn, char *header, char *re
void ICACHE_FLASH_ATTR httpdStartResponse(HttpdConnData *conn, int code) {
char buff[128];
int l;
espconn_sent(conn->conn, (uint8 *)"Hello", 5);
espconn_sent(conn->conn, (uint8 *)"World", 5);
l=os_sprintf(buff, "HTTP/1.0 %d OK\r\nServer: esp8266-httpd/"HTTPDVER"\r\n", code);
espconn_sent(conn->conn, (uint8 *)buff, l);
}
@@ -202,6 +204,7 @@ void ICACHE_FLASH_ATTR httpdStartResponse(HttpdConnData *conn, int code) {
void ICACHE_FLASH_ATTR httpdHeader(HttpdConnData *conn, const char *field, const char *val) {
char buff[256];
int l;
l=os_sprintf(buff, "%s: %s\r\n", field, val);
espconn_sent(conn->conn, (uint8 *)buff, l);
}
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef HTTPD_H
#define HTTPD_H
#include <c_types.h>
#include "lwip/ip_addr.h"
#include <ip_addr.h>
#include <espconn.h>
#define HTTPDVER "0.2"
+2 -2
View File
@@ -9,14 +9,13 @@
*/
#include "espmissingincludes.h"
#include "c_types.h"
#include "user_interface.h"
#include "espconn.h"
#include "mem.h"
#include "osapi.h"
#include "gpio.h"
#include "espmissingincludes.h"
#define LEDGPIO 2
#define BTNGPIO 0
@@ -55,3 +54,4 @@ void ioInit() {
os_timer_setfn(&resetBtntimer, resetBtnTimerCb, NULL);
os_timer_arm(&resetBtntimer, 500, 1);
}