|Rick Companje 924285b51e||3 years ago|
|.settings||6 years ago|
|extra||4 years ago|
|src||3 years ago|
|test||6 years ago|
|.buildpath||7 years ago|
|.gitignore||7 years ago|
|.project||6 years ago|
|Config.in||7 years ago|
|LICENSE.txt||6 years ago|
|Makefile||3 years ago|
|NOTICE.txt||6 years ago|
|README.md||4 years ago|
|ReleaseNotes.md||3 years ago|
|config.ld||7 years ago|
|doxify.sh||7 years ago|
|license-spec.lua||4 years ago|
|post-install.sh||3 years ago|
|post-remove.sh||7 years ago|
|pre-remove.sh||7 years ago|
General documentation can be found on the wiki: http://doodle3d.com/help/wiki. Source code documentation can be generated, see below.
The script ‘doxify.sh’ generates HTML documentation of the source code in the directory ‘docs’. Make sure the ‘ldoc’ program is installed on your machine and the LDOC variable in the script points there.
On OSX, this can be accomplished by installing it through luarocks (run
sudo luarocks install ldoc). Luarocks can be installed using MacPorts. After installing that, the command would be
sudo port install luarocks.
The Doodle3D API can be called using a terminal:
d3dapi p=/network/scan r=GET
Where the p parameter is the module you want to call and r is the method. Post request can be send using the same method:
d3dapi p=/printer/print r=POST
Syntax errors in Lua can lead to tricky issues since they might only surface when the faulty code is actually being run.
One countermeasure for this is to use pcall instead of regular calls in many cases. To let the error ‘happen’ (which in turn gives information in the form of stack traces), tell the code to use regular calls by setting ‘M.DEBUG_PCALLS’ to ‘true’ in
Additionally, when the pcall setting is not enough, a second way of debugging is to take uhttpd out of the loop and invoke the Lua code from command-line. To do this, set ‘M.DEBUG_API’ to ‘true’ in
conf_defaults.lua. Then invoke the API using the command
d3dapi p=/mod/func r=POST where
p= is followed by the API path and
r= followed by either ‘GET’ or ‘POST’.
Note that because stack traces are sent to
stderr, this script redirects output streams to a separate log file:
/tmp/wifibox.stdout.log; apart from these traces, the file should not contain any data.
CGI gateway of uhttpd also uses this script, so the API can also be used to obtain stack traces by calling it as
<wifibox-ip>/cgi-bin/d3dapi/<endpoint> (note the extra