Skip to content

Commit

Permalink
v2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
yanavery committed Jan 9, 2015
1 parent fc28869 commit 94d16ba
Show file tree
Hide file tree
Showing 7 changed files with 436 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
*v2.4* (December 14, 2014)
* Reduced memory footprint by getting rid of "WebDuino" and "Time" libraries
* Reduced memory footprint by getting rid of "WebDuino" library

*v2.3* (November 16, 2014)
* Certified compatibility with DFRobot Xboard Relay (which is now the new standard/default)
Expand Down
6 changes: 3 additions & 3 deletions MyDoorOpener/MyDoorOpener.ino
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@
// v2.3 [11/16/2014] - Certified compatibility with DFRobot Xboard Relay (which is now the new standard/default)
// - Certified compatibility with Arduino v1.0.6 IDE
//
// v2.4 [12/14/2014] - Reduced memory footprint by getting rid of "WebDuino" and "Time" libraries
// v2.4 [12/14/2014] - Reduced memory footprint by getting rid of "WebDuino" library
//----------------------------------------------------------------------------------------------------

// Uncomment to turn ON serial debugging

//#define MYDOOROPENER_SERIAL_DEBUGGING 1
//#define WEBDUINO_SERIAL_DEBUGGING 1
//#define NOTIFICATIONS_SERIAL_DEBUGGING 1
//#define SMTP_SERIAL_DEBUGGING 1
//#define PUSH_SERIAL_DEBUGGING 1

#include <Ethernet.h>
#include <SPI.h>
#include <aes256.h>
#include <Time.h>

#include "MyDoorOpenerServer.h"

Expand Down Expand Up @@ -615,7 +615,7 @@ void setup()

// start web server

myDoorOpenerServer.setup();
myDoorOpenerServer.setup(statusPins, sizeof(statusPins));

#if defined(MYDOOROPENER_SERIAL_DEBUGGING)
Serial.println(F("*** MyDoorOpener setup completed ***"));
Expand Down
13 changes: 10 additions & 3 deletions MyDoorOpener/MyDoorOpenerServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
#include "MyDoorOpenerServer.h"
#include <aes256.h>

//#define MYDOOROPENER_SERIAL_DEBUGGING 1

extern EthernetServer server;
extern uint8_t *statusPins;
extern boolean isOpen(int pinNumber);
extern int RELAY_DELAY;

Expand Down Expand Up @@ -40,8 +41,14 @@ MyDoorOpenerServer::MyDoorOpenerServer(char* pPassword, uint8_t pMac[6], uint8_t
}

//---------------------------------------------------------------------------------------------------------------------
void MyDoorOpenerServer::setup()
void MyDoorOpenerServer::setup(uint8_t pStatusPins[], int pStatusPinsCount)
{
statusPinsCount = pStatusPinsCount;
for (int i = 0; i < sizeof(statusPins); ++i)
statusPins[i] = NULL;
for (int i = 0; i < statusPinsCount; ++i)
statusPins[i] = pStatusPins[i];

#if defined(MYDOOROPENER_SERIAL_DEBUGGING)
Serial.begin(9600);
while (!Serial)
Expand Down Expand Up @@ -357,7 +364,7 @@ void MyDoorOpenerServer::writeResponse()

// write current door status

for (int i = 0; i < sizeof(statusPins); ++i)
for (int i = 0; i < statusPinsCount; ++i)
{
output("<status statusPin=\"", false);
output(statusPins[i], false);
Expand Down
5 changes: 4 additions & 1 deletion MyDoorOpener/MyDoorOpenerServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class MyDoorOpenerServer
public:
MyDoorOpenerServer(char* pPassword, uint8_t pMac[6], uint8_t pIp[4], uint8_t pDns[4] = NULL, uint8_t pGateway[4] = NULL);

void setup();
void setup(uint8_t pStatusPins[], int pStatusPinsCount);
void loop();

protected:
Expand Down Expand Up @@ -40,6 +40,9 @@ class MyDoorOpenerServer
uint8_t dns[4];
uint8_t gateway[4];

int statusPinsCount;
uint8_t statusPins[16];

EthernetClient client;
};

Expand Down
1 change: 1 addition & 0 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ For more information, see http://mydooropener.com/
This software relies on the following 3rd party libraries:

- AES-256 API, Copyright (c) 2007-2009, Ilya O. Levin
- Time API, Copyright (c) 2009, Michael Margolis


== What's new in this release?
Expand Down
Loading

0 comments on commit 94d16ba

Please sign in to comment.