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

Dependency list and easier debug access #30

Merged
merged 3 commits into from
Jan 24, 2025
Merged
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
3 changes: 2 additions & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name=deploii
version=0.1.0
version=0.1.1
author=Company of Things
maintainer=Company of Things <[email protected]>
sentence=Library for enabling communication between a MCU and Deploii
paragraph=
depends=WebSockets, MsgPack, WiFi
category=Communication
url=https://github.com/Company-of-Things/deploii-library
architectures=esp32
Expand Down
7 changes: 6 additions & 1 deletion src/deploii.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ DeploiiHandler* Deploii::selectHandler() {
return new DeploiiHandler(_debug);
}

void Deploii::setDebug(bool debug){
_debug = debug;
_handler->_debug = debug;
}

void Deploii::interval(int intervalLength, void (*cb)(void)) {
_intervals = (struct Interval*)realloc(_intervals, sizeof(struct Interval) * (_intervalCount + 1));
_intervals[_intervalCount].intervalLength = intervalLength;
Expand All @@ -55,4 +60,4 @@ void Deploii::checkIntervals() {
_intervals[i].previousTime = currentTime;
}
}
}
}
1 change: 1 addition & 0 deletions src/deploii.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class Deploii {
bool ssl = true);

void interval(int intervalLength, void (*cb)(void));
void setDebug(bool debug);

private:
Medium _medium;
Expand Down
10 changes: 4 additions & 6 deletions src/handler/deploii_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@ class DeploiiHandler {
const int port = DEPLOII_PORT,
const char* url = DEPLOII_WS_URL,
bool ssl = true);

private:
bool _debug;
private:
};

class DeploiiHandlerWiFiWS : public DeploiiHandler {
Expand All @@ -56,9 +55,9 @@ class DeploiiHandlerWiFiWS : public DeploiiHandler {
const int port,
const char* url,
bool ssl);

private:
bool _debug;
private:


void connectWiFi(char* ssid, const char* pwd);
void connectWS(char* boardID, const char* host, const int port, const char* url, bool ssl);
Expand Down Expand Up @@ -89,9 +88,8 @@ class DeploiiHandlerWiFiHTTP : public DeploiiHandler {
const int port,
const char* url,
bool ssl);

private:
bool _debug;
private:
void connectWiFi(char* ssid, const char* pwd);

#if defined(ESP32)
Expand Down
Loading