Skip to content

Commit

Permalink
re-added the arduinotrace library. too useful for debug.
Browse files Browse the repository at this point in the history
  • Loading branch information
hoeken committed Aug 11, 2024
1 parent 9ae5c98 commit 53fd2db
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 18 deletions.
8 changes: 7 additions & 1 deletion examples/platformio/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,10 @@ lib_deps = ${env.lib_deps}
https://github.com/esp-arduino-libs/ESP32_IO_Expander
build_flags =
-D PSY_ENABLE_SDCARD
-D WAVESHARE_43_TOUCH
-D WAVESHARE_43_TOUCH

[env:dev]
lib_deps = ${env.lib_deps}
bblanchon/ArduinoTrace@^1.2.0
build_flags =
-D PSY_DEVMODE
4 changes: 4 additions & 0 deletions examples/platformio/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@
#include <PsychicHttpsServer.h>
#endif

#ifdef PSY_DEVMODE
#include <ArduinoTrace.h>
#endif

#ifndef WIFI_SSID
#error "You need to enter your wifi credentials. Rename secret.h to _secret.h and enter your credentials there."
#endif
Expand Down
19 changes: 11 additions & 8 deletions library.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,18 @@
"version": "1.2.0",
"description": "Arduino style wrapper around ESP-IDF HTTP library. HTTP server with SSL + websockets. Works on esp32 and probably esp8266",
"keywords": "network,http,https,tcp,ssl,tls,websocket,espasyncwebserver",
"repository":
{
"repository": {
"type": "git",
"url": "https://github.com/hoeken/PsychicHttp"
},
"authors":
[
"authors": [
{
"name": "Zach Hoeken",
"email": "[email protected]",
"maintainer": true
}
],
"license" : "LGPL-3.0-or-later",
"license": "LGPL-3.0-or-later",
"examples": [
{
"name": "platformio",
Expand All @@ -34,10 +32,15 @@
"name": "ArduinoJson",
"version": "^7.0.4"
},
{
"owner": "bblanchon",
"name": "ArduinoTrace",
"version": "^1.2.0"
},
{
"owner": "plageoj",
"name" : "UrlEncode",
"version" : "^1.0.1"
"name": "UrlEncode",
"version": "^1.0.1"
}
],
"export": {
Expand All @@ -50,4 +53,4 @@
"README.md"
]
}
}
}
15 changes: 6 additions & 9 deletions src/PsychicCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@

#define PH_TAG "psychic"

// version numbers
#define PSYCHIC_HTTP_VERSION_MAJOR 1
#define PSYCHIC_HTTP_VERSION_MINOR 1
#define PSYCHIC_HTTP_VERSION_PATCH 0

#ifndef FILE_CHUNK_SIZE
#define FILE_CHUNK_SIZE 8 * 1024
#endif
Expand Down Expand Up @@ -38,8 +33,11 @@
#include <list>
#include <map>

enum HTTPAuthMethod
{
#ifdef PSY_DEVMODE
#include "ArduinoTrace.h"
#endif

enum HTTPAuthMethod {
BASIC_AUTH,
DIGEST_AUTH
};
Expand All @@ -62,8 +60,7 @@ typedef std::function<esp_err_t(PsychicRequest* request)> PsychicHttpRequestCall
typedef std::function<esp_err_t(PsychicRequest* request, JsonVariant& json)> PsychicJsonRequestCallback;
typedef std::function<esp_err_t(PsychicRequest* request, const String& filename, uint64_t index, uint8_t* data, size_t len, bool final)> PsychicUploadCallback;

struct HTTPHeader
{
struct HTTPHeader {
String field;
String value;
};
Expand Down

0 comments on commit 53fd2db

Please sign in to comment.