Changed around everything to make use of sdk 0.9.4. CODE IS STILL BROKEN!
This commit is contained in:
+1
-1
@@ -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,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
@@ -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;
|
||||
|
||||
@@ -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
@@ -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"
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user