Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Commit

Permalink
Fixed bug where peripheral type was not checked following API command.
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Lindros committed Feb 21, 2014
1 parent 8461071 commit 50fbc5c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions PACSDoor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ bool PACSDoor::enterPIN(char* readerId, char* code) {
bool PACSDoor::openDoor(char* doorMonitorId) {

PACSPeripheral* p = findPeripheralById(doorMonitorId);
if (p != NULL) {
if ((p != NULL) && (p->type == DOORMONITOR)) {
setPinActive(p->pin, p->activeLevel);
return true;
}
Expand All @@ -142,7 +142,7 @@ bool PACSDoor::openDoor(char* doorMonitorId) {
bool PACSDoor::closeDoor(char* doorMonitorId) {

PACSPeripheral* p = findPeripheralById(doorMonitorId);
if (p != NULL) {
if ((p != NULL) && (p->type == DOORMONITOR)) {
setPinInactive(p->pin, p->activeLevel);
return true;
}
Expand All @@ -155,7 +155,7 @@ bool PACSDoor::closeDoor(char* doorMonitorId) {
bool PACSDoor::pushREX(char* rexId) {

PACSPeripheral* p = findPeripheralById(rexId);
if (p != NULL) {
if ((p != NULL) && (p->type == REX)) {
setPinActive(p->pin, p->activeLevel);
delay(10);
setPinInactive(p->pin, p->activeLevel);
Expand Down
1 change: 1 addition & 0 deletions dctt.ino
Original file line number Diff line number Diff line change
Expand Up @@ -1176,6 +1176,7 @@ void apiCMD(WebServer &server, WebServer::ConnectionType type, char *url_tail, b

server.httpSuccess("text/html", NULL);
server.printP(ok);
server.printCRLF();

}
}
Expand Down

0 comments on commit 50fbc5c

Please sign in to comment.