On platforms which do not define the macro __SDCC the strcasecmp
function may not have a definition (true at least on CC26xx). The
prototype for this function is now defined if __SDCC is false.
Now callback functions get the URI of the request, this allows to use a
single resource for multiple different URIs.
The is_json flag is now gone for the to-string function, instead the
macro has an is_str flag. If set this automagically produces quotes
around the string for json output.
Now from-string functions can return an error-code, 0 for success, -1
for error.
Bug fixes include:
- keep interrupts disabled during lpm_sleep() so that we don't
miss any interrupts we may have been expecting
- check that the pending etimer isn't already expired (and don't sleep
at all if it is)
- check that the about-to-be scheduled rtimer wakeup is neither too
far into the future nor too close into the future (or even in the
past) before actually setting the interrupt (should fix#1509); If
the time is out of bounds we use a default min or max value instead.
- Correctly handle LPM_MODE_MAX_SUPPORTED set to zero (and added a
macro for the zero value) so that sleeping can be disabled altogether
- If no etimer is set, we specify a wakeup time which is reasonably far
into the future instead of setting none at all (this will save on
power consumption whenever no etimers are set).
Also did a bit of refactoring in that some long functions were broken
into multiple functions.
Otherwise a crash results with a bootloader compiled with a newer AVR
toolchain (e.g. Debian Jessie). If you still have an ages-old bootloader
without a jump-table, as a short-term measure you can revert this change
in your run.sh. As a long-term fix we recommend you get your bootloader
updated!
Now we manage a timezone and daylight-savings aware version of
localtime. We parse UNIX timezone strings. The default (active after the
first call to localtime or localtime_r) is CET/CEST, the timezone of
Europe/Vienna. The wallclock-time osd-example demonstrates how to set a
different timezone via the timezone resource.
Note: After startup no timezone is set. So in this state querying the
timezone resource will return an empty string. After first call to
localtime (if not timezone has been set via the timezone resource) a
query to timezone will return the default timezone string for CET/CEST.
The string returned by the localtime and utc timezones now also includes
the timezone name.
New fields tm_gmtoff and tm_zone were added to the tm structure. These
are available in BSD systems and when setting special compiler
definitions on Linux.
Note: the timezone offset information in the tm structure (tm_gmtoff)
as well as in the tz structure returned by gettimeofday (tz_minuteswest)
may be wrong sign, this code is largely untested.