diff --git a/examples/dummy-web-server.pl b/examples/dummy-web-server.pl index 6743c43..56015ef 100755 --- a/examples/dummy-web-server.pl +++ b/examples/dummy-web-server.pl @@ -423,6 +423,17 @@ sub process_user_comm_led return content_response($r, $http->{url}); } +sub process_user_comm_voltage +{ + my ($http) = @_; + + my $voltage = (((time - $startTime) % 60) - 30) / 30.0 + 4.0; + $voltage = sprintf("%.2f V", $voltage); + + my $r = '{"voltage": "' . $voltage . '"}'; + return content_response($r, $http->{url}); +} + sub process_user_comm() { my ($http) = @_; @@ -431,4 +442,9 @@ sub process_user_comm() { return process_user_comm_led($http); } + + if( $http->{url} eq '/Voltage.html.json' ) + { + return process_user_comm_voltage($http); + } } diff --git a/examples/web-server/GZipped.html.gz b/examples/web-server/GZipped.html.gz deleted file mode 100644 index e9c012c..0000000 Binary files a/examples/web-server/GZipped.html.gz and /dev/null differ diff --git a/examples/web-server/Voltage.html b/examples/web-server/Voltage.html new file mode 100644 index 0000000..08e1017 --- /dev/null +++ b/examples/web-server/Voltage.html @@ -0,0 +1,10 @@ + + +