diff --git a/handlers.js b/handlers.js
index a4ebbb9..3594750 100644
--- a/handlers.js
+++ b/handlers.js
@@ -96,6 +96,8 @@ function homepage(res, req) {
+ '
'
+ 'Misc.
'
+ ''
@@ -356,11 +358,11 @@ function sound(res, req) {
data = '{"return":"1","msg":"Unable to perform action, rabbit is sleeping."}';
} else {
var id = getParameter(req, "id");
- var url = getParameter(req, "url");
+ var uri = getParameter(req, "url");
- if (id && url) {
+ if (id && uri) {
data = '{"return":"1","msg":"You cannot use ID and URL parameters at the same time."}';
- } else if ((id === undefined) && (url === undefined)) {
+ } else if ((id === undefined) && (uri === undefined)) {
data = '{"return":"1","msg":"No sound to play."}';
} else if (id) {
data = '{"return":"0"}';
@@ -622,6 +624,26 @@ function rfid_list_ext(res, req) {
}
exports.rfid_list_ext = rfid_list_ext;
+function rfid_start_record(res, req) {
+ log.trace('rfid_start_record: begin');
+
+ var data = '{"return":"0"}';
+
+ sendResponse(res, data);
+ log.trace('rfid_start_record: end');
+}
+exports.rfid_start_record = rfid_start_record;
+
+function rfid_stop_record(res, req) {
+ log.trace('rfid_stop_record: begin');
+
+ var data = '{"return":"0"}';
+
+ sendResponse(res, data);
+ log.trace('rfid_stop_record: end');
+}
+exports.rfid_stop_record = rfid_stop_record;
+
function clock(res, req) {
log.trace('clock: begin');
diff --git a/index.js b/index.js
index 195d639..61d1fcb 100644
--- a/index.js
+++ b/index.js
@@ -53,6 +53,8 @@ handle['/cgi-bin/reboot'] = handlers.reboot;
handle['/cgi-bin/reset_install_flag'] = handlers.reset_install_flag;
handle['/cgi-bin/rfid_list'] = handlers.rfid_list;
handle['/cgi-bin/rfid_list_ext'] = handlers.rfid_list_ext;
+handle['/cgi-bin/rfid_start_record'] = handlers.rfid_start_record;
+handle['/cgi-bin/rfid_stop_record'] = handlers.rfid_stop_record;
handle['/cgi-bin/sleep'] = handlers.sleep;
handle['/cgi-bin/snapshot'] = handlers.snapshot;
handle['/cgi-bin/snapshot_ftp'] = handlers.snapshot_ftp;
diff --git a/karotz.js b/karotz.js
index 31644be..dea325a 100644
--- a/karotz.js
+++ b/karotz.js
@@ -87,7 +87,7 @@ function sleep() {
sleeping = true;
sleepTime = Math.floor(new Date().getTime() / 1000);
return sleeping;
-};
+}
exports.sleep = sleep;
function wakeup() {
@@ -95,14 +95,14 @@ function wakeup() {
sleeping = false;
sleepTime = 0;
return sleeping;
-};
+}
exports.wakeup = wakeup;
function reboot() {
log.info("Karotz reboot");
wakeup();
return sleeping;
-};
+}
exports.reboot = reboot;
function leds(color1, color2, pulse, speed) {
diff --git a/router.js b/router.js
index 532c9e9..2b666dd 100644
--- a/router.js
+++ b/router.js
@@ -35,14 +35,14 @@ function route(pathname, handle, res, req) {
if (typeof handle[pathname] === 'function') {
return handle[pathname](res, req);
- } else {
- log.failure('No request handler found for ' + pathname);
- res.writeHead(404, {
- 'Content-Type' : 'text/plain'
- });
- res.write('404 Not Found');
- res.end();
}
+
+ log.failure('No request handler found for ' + pathname);
+ res.writeHead(404, {
+ 'Content-Type' : 'text/plain'
+ });
+ res.write('404 Not Found');
+ res.end();
}
exports.route = route;