Commit graph

783 commits

Author SHA1 Message Date
Harald Pichler 3f6cb4e795 Merge branch 'contiki' 2017-09-05 11:14:11 +02:00
Ralf Schlatterbeck d890a492bb Set arduino LOOP_INTERVAL in project-conf.h 2017-08-20 19:42:42 +02:00
Ralf Schlatterbeck e3784fa9c7 Add query parameter to generic resouce macros
Modify all callback functions to use new signature.
ota-update now uses this to pass the partition to some get/put methods.
2017-08-20 15:01:30 +02:00
Ralf Schlatterbeck c35be7c066 First stab at OTA-update
Introduce new testing-app example.
Add a new coap error code for blockwise transfer.
Add include-file for bootloader callbacks (jumptable).
Note that only the bootloader for osd-merkur-256 will support
OTA-update, the -128 simply has not enough flash memory, so only
in the -256 we have the bootloader functions in the jump-table
of the bootloader and in the bootloader-if.h include-file.
2017-07-31 13:26:29 +02:00
Niclas Finne 576ca6457f Added boundary checks when parsing CoAP packets.
Thanks to Stephan Zeisberg for reporting this issue.
2017-06-14 17:00:53 +02:00
George Oikonomou 3c150a5e99 Merge pull request #2150 from posjodin/PR2
Several changes to fix and harden mqtt code.
2017-04-24 16:04:56 +01:00
Peter Sjödin a08adccfd5 Untabify mqtt.c 2017-04-11 17:19:43 +02:00
Peter 1fa9dde049 Merge remote-tracking branch 'contiki/master' into PR2 2017-04-11 17:00:38 +02:00
Atis Elsts f83f035855 Keep CoAP 'observe' option length <= 3 bytes 2017-04-08 15:02:52 +01:00
Alexandru-Ioan Pop f15b86158b Check broker IP conversion. Adjust state machine accordingly
The result of converting the IP address of the broker wasn't checked. As a result, the pointer was left uninitialised and the IPv6 address used for connecting was some random data. The function now returns an error. Before connect_to_broker is called, mqtt_register is executed, which memsets conn to 0, making its state 0 (MQTT_CONN_STATE_ERROR). In order to recover from this error state, the extra check was added in the MQTT_CLIENT_STATE_NEWCONFIG state.

This was discovered using [CodeSonar](https://www.grammatech.com/products/codesonar)
2017-03-31 17:33:29 +01:00
Gaëtan Harter f70adde9a9 er-coap-observe-client: missing 'addr' parameter 2017-03-23 15:12:42 +01:00
Gaëtan Harter c932ff45a3 er-coap: run uncrustify-fix-style.sh
Clean style before modifying.
2017-03-23 15:12:39 +01:00
Robert Olsson 34fa389054 Whitespace change to force new travis-check.
modified:   apps/mqtt/mqtt.h
2017-03-22 13:15:58 +01:00
Peter 432f12e156 Several changes to fix bugs and harden mqtt code.
1. The PT_MQTT_WAIT_SEND() macro has several issues:

- It does not check the return value from process_post(), which
  sometimes returns an error code. See next issue.

- Each time the macro is called, is posts an event to itself. The idea
seems to be that the event should be absorbed by the macro itself, so
when the macro terminates there is NOT a net growth of the event
queue. This does not work.  The reason is that the
PROCESS_WAIT_EVENT() sometimes absorbs a broadcast event instead of
its own event, and then the number of events in the event queue
increases. This leads to event explosions and overflow in the event
queue.

- The macro cannot call PT_EXIT(). This will expand to a return
statement, causing a return from the function calling the macro
(mqtt_process), rather then exiting the protothread (which was
probably the intention). Protothreads have lexical scope...

Fixes: 1) Check return value from process_post() 2) Loop until the
event posted to itself is absorbed (rather than just absorbing the
next event) 3) Replace PT_EXIT() with PT_INIT() (doesn't really make a
difference, could probably just be removed).

2. Change order of the checks in the protothread-calling loops in
mqtt_process().  Reason: When a protothread has been cleared by
PT_MQTT_WAIT_SEND(), it will not return a value, so checking against
PT_EXITED does not make sense.

3. PT_MQTT_WRITE_BYTES() should initialize conn->out_write_pos to 0.
When PT_MQTT_WRITE_BYTES() does not finish (due to TCP disconnect for
instance), it may leave conn->out_write_pos with a non-zero
value. Next time PT_MQTT_WRITE_BYTES() is called, it will take data
from the wrong place.

4. Put MQTT_CONN_STATE_ABORT_IMMEDIATE before
MQTT_CONN_STATE_NOT_CONNECTED in the enum list, so that the check
if(conn->state > MQTT_CONN_STATE_NOT_CONNECTED) in mqtt_connect()
fails when in state MQTT_CONN_STATE_ABORT_IMMEDIATE. Otherwise, it
will deadlock and not reattempt connections while in this state.
2017-03-21 16:43:15 +01:00
George Oikonomou 739b901e0d Add missing variable declaration
#1972 removed the declaration of `i` from various locations. In one of those locations it is still needed. This commit puts it back
2017-03-18 14:01:10 +00:00
George Oikonomou 758d9aa168 Merge pull request #1972 from MohamedSeliem/patch-11
update httpd_cgi to enable the compilation of webserver-ipv6 example
2017-03-18 13:50:52 +00:00
Thomas Blank ed1b27e40b Fix Bug in MQTT App: Refused Connections should not be pursued.
No means no.
2017-03-09 19:35:20 +01:00
Harald Pichler 2f8549aaae Merge branch 'contiki'
Conflicts:
	cpu/cc26xx-cc13xx/lib/cc13xxware
	cpu/cc26xx-cc13xx/lib/cc26xxware
2017-01-31 15:00:59 +01:00
Yasuyuki Tanaka 83f2382791 Orchestra: avoid a link error for nbr_routes 2017-01-19 13:55:08 +01:00
Harald Pichler 16e6a20b31 add button function 2016-12-06 21:36:22 +01:00
Mohamed Seliem 88fdc46e03 update httpd_cgi to enable the compilation of webserver-ipv6 example
this simple change fixes the bug reported in @#1541.
../../apps/webserver/httpd.h:63:9: note: expected ‘uip_ip6addr_t’ but argument is of type ‘union uip_ipaddr_t *’
2016-12-04 19:03:15 +02:00
Harald Pichler b708fac68d Merge branch 'contiki' 2016-11-15 08:29:23 +01:00
Antonio Lignan efde9132a8 Merge pull request #1769 from gebart/pr/rest-engine-periodic-add-poll
rest-engine: Allow adding periodic resources after starting REST engine
2016-11-11 09:01:32 +01:00
Harald Pichler 0556557d8b remove unneeded code 2016-10-28 11:43:55 +02:00
aho 8306aded79 fixed typo in debug PRINTF definition 2016-10-25 12:38:15 +03:00
Oliver Schmidt 957ac63a7c Improved dicarding of text in the HTML header.
Plain text in the HTML header (think of <title>text</title>) is collected as usual. The decision to discard it is triggered by the first withspace following. In the usual case of the <body> no preceeded by any whitespace this means that by the point the first whitespace is encountered we're not in "discard mode" anymore and therefore incorrectly render the text.

Explicitly calling do_word() just before leaving "discard mode" discards all text collected so far.
2016-10-11 11:25:31 +02:00
Harald Pichler a5b59e8cbb Merge branch 'contiki'
Conflicts:
	.gitmodules
	core/net/mac/contikimac/contikimac.c
	cpu/cc26xx-cc13xx/lib/cc13xxware
2016-09-21 21:09:29 +02:00
Harald Pichler 5de29079ae bugfix switch netstack mode 2016-09-16 16:18:02 +02:00
Nicolas Tsiftes fa6771f058 Merge pull request #1677 from gebart/pr/lwm2m-instance-list
oma-lwm2m: Add functionality to send object instance list as core link format
2016-09-06 16:50:11 +02:00
Ralf Schlatterbeck 28cb276c70 Merge branch 'osd'
Conflicts:
	apps/arduino/arduino-process.c
	apps/arduino/arduino-process.h
	apps/json-resource/generic_resource.c
	apps/json-resource/generic_resource.h
	apps/time/Makefile.time
	apps/time/resource_gmtime.c
	apps/time/resource_timestamp.c
	apps/time/time.c
	apps/time/time_resource.h
	core/dev/leds.c
	core/lib/petsciiconv.c
	core/net/ip/resolv.c
	core/net/ip/slipdev.c
	core/net/ip/tcpip.c
	core/net/ipv4/uip.c
	core/net/ipv6/uip-ds6.c
	core/net/mac/contikimac/contikimac.c
	core/net/mac/frame802154.h
	core/net/mac/framer-802154.c
	core/net/mac/nullrdc.c
	core/net/rpl/rpl-dag.c
	core/net/rpl/rpl-ext-header.c
	core/net/rpl/rpl-icmp6.c
	core/net/rpl/rpl-mrhof.c
	core/net/rpl/rpl-of0.c
	core/net/rpl/rpl-timers.c
	core/net/rpl/rpl.c
	cpu/avr/Makefile.avr
	cpu/avr/dev/lanc111.c
	cpu/avr/radio/rf230bb/halbb.c
	dev/arduino/arduino-compat.h
	examples/osd/.gitignore
	examples/osd/arduino-dooralert/Makefile
	examples/osd/arduino-dooralert/flash.sh
	examples/osd/arduino-dooralert/run.sh
	examples/osd/arduino-dooralert/sketch.pde
	examples/osd/arduino-merkurboard/Makefile
	examples/osd/arduino-merkurboard/README.md
	examples/osd/arduino-merkurboard/flash.sh
	examples/osd/arduino-merkurboard/project-conf.h
	examples/osd/arduino-merkurboard/run.sh
	examples/osd/arduino-plantobserving/Makefile
	examples/osd/arduino-plantobserving/flash.sh
	examples/osd/arduino-plantobserving/project-conf.h
	examples/osd/arduino-plantobserving/run.sh
	examples/osd/arduino-plantobserving/sketch.pde
	examples/osd/arduino-roomalert/Makefile
	examples/osd/arduino-roomalert/flash.sh
	examples/osd/arduino-roomalert/run.sh
	examples/osd/arduino-roomalert/sketch.pde
	examples/osd/arduino-sketch/Makefile
	examples/osd/arduino-sketch/flash.sh
	examples/osd/arduino-sketch/led_pwm.h
	examples/osd/arduino-sketch/resource_led_pwm.c
	examples/osd/arduino-sketch/run.sh
	examples/osd/arduino-sketch/sketch.pde
	examples/osd/arduino-wateralert/Makefile
	examples/osd/arduino-wateralert/flash.sh
	examples/osd/arduino-wateralert/run.sh
	examples/osd/arduino-wateralert/sketch.pde
	examples/osd/climate/Makefile
	examples/osd/climate/er-example-server.c
	examples/osd/climate/flash.sh
	examples/osd/climate/project-conf.h
	examples/osd/climate/run.sh
	examples/osd/climate/server-only.csc
	examples/osd/climate2/Makefile
	examples/osd/climate2/er-example-server.c
	examples/osd/climate2/flash.sh
	examples/osd/climate2/project-conf.h
	examples/osd/climate2/run.sh
	examples/osd/climate2/server-only.csc
	examples/osd/dual-rgbw-actor/Makefile
	examples/osd/dual-rgbw-actor/flash.sh
	examples/osd/dual-rgbw-actor/run.sh
	examples/osd/dual-rgbw-actor/server-client.csc
	examples/osd/dual-rgbw-actor/server-only.csc
	examples/osd/embedd-vm-merkurboard/Makefile
	examples/osd/embedd-vm-merkurboard/embedd-vm-server.c
	examples/osd/embedd-vm-merkurboard/flash.sh
	examples/osd/embedd-vm-merkurboard/run.sh
	examples/osd/embedd-vm-merkurboard/server-only.csc
	examples/osd/er-rest-example-merkurboard/Makefile
	examples/osd/er-rest-example-merkurboard/README.md
	examples/osd/er-rest-example-merkurboard/er-example-client.c
	examples/osd/er-rest-example-merkurboard/er-example-server.c
	examples/osd/er-rest-example-merkurboard/er-plugtest-server.c
	examples/osd/er-rest-example-merkurboard/flash.sh
	examples/osd/er-rest-example-merkurboard/flashclient.sh
	examples/osd/er-rest-example-merkurboard/project-conf.h
	examples/osd/er-rest-example-merkurboard/run.sh
	examples/osd/er-rest-example-merkurboard/runclient.sh
	examples/osd/er-rest-example-merkurboard/server-client.csc
	examples/osd/light-actor/Makefile
	examples/osd/light-actor/er-example-server.c
	examples/osd/light-actor/flash.sh
	examples/osd/light-actor/pcintkey.c
	examples/osd/light-actor/project-conf.h
	examples/osd/light-actor/run.sh
	examples/osd/light-actor/server-only.csc
	examples/osd/light-shutter-control/Makefile
	examples/osd/light-shutter-control/flash.sh
	examples/osd/light-shutter-control/pcintkey.c
	examples/osd/light-shutter-control/run.sh
	examples/osd/light-shutter-control/server-only.csc
	examples/osd/merkurboard/Makefile
	examples/osd/merkurboard/README.md
	examples/osd/merkurboard/er-example-client.c
	examples/osd/merkurboard/er-example-server.c
	examples/osd/merkurboard/er-plugtest-server.c
	examples/osd/merkurboard/flash.sh
	examples/osd/merkurboard/flashclient.sh
	examples/osd/merkurboard/project-conf.h
	examples/osd/merkurboard/run.sh
	examples/osd/merkurboard/runclient.sh
	examples/osd/native-border-router/Makefile
	examples/osd/native-border-router/border-router-cmds.c
	examples/osd/native-border-router/border-router-cmds.h
	examples/osd/native-border-router/border-router-rdc.c
	examples/osd/native-border-router/border-router.c
	examples/osd/native-border-router/border-router.h
	examples/osd/native-border-router/project-conf.h
	examples/osd/native-border-router/slip-config.c
	examples/osd/native-border-router/slip-dev.c
	examples/osd/native-border-router/tun-bridge.c
	examples/osd/pingtheplug/Makefile
	examples/osd/pingtheplug/er-example-server.c
	examples/osd/pingtheplug/flash.sh
	examples/osd/pingtheplug/pcintkey.c
	examples/osd/pingtheplug/run.sh
	examples/osd/pingtheplug/server-only.csc
	examples/osd/pir-sensor/Makefile
	examples/osd/pir-sensor/flash.sh
	examples/osd/pir-sensor/run.sh
	examples/osd/pir-sensor/server-client.csc
	examples/osd/pir-sensor/server-only.csc
	examples/osd/powerbox/Makefile
	examples/osd/powerbox/er-example-server.c
	examples/osd/powerbox/flash.sh
	examples/osd/powerbox/run.sh
	examples/osd/powerbox/server-only.csc
	examples/osd/pwm-example/Makefile
	examples/osd/pwm-example/er-example-server.c
	examples/osd/pwm-example/flash.sh
	examples/osd/pwm-example/led_pwm.h
	examples/osd/pwm-example/resource_led_pwm.c
	examples/osd/pwm-example/run.sh
	examples/osd/rpl-border-router/Makefile
	examples/osd/rpl-border-router/border-router.c
	examples/osd/rpl-border-router/flash.sh
	examples/osd/rpl-border-router/project-conf.h
	examples/osd/rpl-border-router/run.sh
	examples/osd/rpl-border-router/slip-bridge.c
	examples/osd/runall.sh
	examples/osd/servo-sensor/Makefile
	examples/osd/servo-sensor/er-example-server.c
	examples/osd/servo-sensor/flash.sh
	examples/osd/servo-sensor/project-conf.h
	examples/osd/servo-sensor/run.sh
	examples/osd/servo-sensor/server-client.csc
	examples/osd/servo-sensor/server-only.csc
	examples/osd/slip-radio/Makefile
	examples/osd/slip-radio/flash.sh
	examples/osd/slip-radio/no-framer.c
	examples/osd/slip-radio/project-conf.h
	examples/osd/slip-radio/run.sh
	examples/osd/slip-radio/slip-net.c
	examples/osd/slip-radio/slip-radio-cc2420.c
	examples/osd/slip-radio/slip-radio-sky-sensors.c
	examples/osd/slip-radio/slip-radio.c
	examples/osd/slip-radio/slip-radio.h
	examples/osd/wallclock-time/Makefile
	examples/osd/wallclock-time/flash.sh
	examples/osd/wallclock-time/run.sh
	examples/osd/wirelessplug/Makefile
	examples/osd/wirelessplug/flash.sh
	examples/osd/wirelessplug/run.sh
	examples/osd/wirelessplug/server-client.csc
	examples/osd/wirelessplug/server-only.csc
	platform/avr-atmega128rfa1/apps/raven-lcd-interface/raven-lcd.c
	platform/avr-raven/apps/raven-lcd-interface/raven-lcd.c
	tools/tunslip6.c
2016-08-12 22:04:56 +02:00
Harald Pichler 8402b1c151 initial upload, add button 2016-08-03 21:58:02 +02:00
Joakim Nohlgård f16f5b5241 squash clean up left overs 2016-07-09 10:39:23 +02:00
Joakim Nohlgård 6b238873ef squash move rest-engine timers to activate timer 2016-07-09 10:34:23 +02:00
Joakim Nohlgård e7070a5f79 rest-engine: Allow adding periodic resources after starting REST engine
Without this fix, any periodic resources added after the REST engine was
already running were never started.
2016-07-06 19:18:34 +02:00
Harald Pichler 3c8e91d74e cleanup confilicrts 2016-06-28 16:37:16 +02:00
Tiago Koji Castro Shibata c2a0f739f7 Compilation targeting c64
Adds some casts required by cc65 compiler and small fixes
2016-06-12 21:16:01 -03:00
Simon Duquennoy c3ea1f9fc6 Orchestra: added support for RPL non-storing mode 2016-06-08 14:03:24 +02:00
Simon Duquennoy 6c946319d9 Merge pull request #1667 from alignan/pull/at-driver
AT driver (master) and example
2016-06-04 22:47:24 +02:00
Joakim Nohlgård e8edb6b1a0 oma-lwm2m: Add JSON writer 2016-05-28 07:55:54 +02:00
Joakim Nohlgård 9832b356ba oma-lwm2m: Use Accept header to determine the writer object for the content 2016-05-28 07:55:27 +02:00
Joakim Nohlgård 14cdb30886 oma-lwm2m: Only send active instances 2016-05-24 20:00:56 +02:00
Joakim Nohlgård 84cd7a4e92 oma-lwm2m: Add functionality to send object instance list as core link format 2016-05-24 20:00:56 +02:00
Nicolas Tsiftes 562a33aa16 Merge pull request #1670 from gebart/pr/lwm2m-decimal-point
oma-lwm2m: Handle text/plain floatfix numbers without decimal point
2016-05-23 15:22:35 +02:00
Yasuyuki Tanaka bc54f8bac3 Orchestra: add NULL checks into new_time_source (eb-per-time-source) 2016-05-21 13:43:42 +02:00
Joakim Nohlgård 99c77bda8c oma-lwm2m: Handle text/plain floatfix numbers without decimal point
Fixes bug: If no decimal point is present then the entire number is
treated as the decimal part instead of the integer part
2016-05-21 09:48:06 +02:00
Simon Duquennoy c7694e4dbd Orchestra: fix orchestra-rule-eb-per-time-source to handle hash collisions 2016-05-20 13:51:24 +02:00
Simon Duquennoy 7e8d042609 Orchestra: fix bug in new_time_source 2016-05-20 13:40:50 +02:00
Simon Duquennoy 287b4767e3 Orchestra: handle case where ORCHESTRA_UNICAST_PERIOD is smaller than the network size 2016-05-20 13:40:20 +02:00
Antonio Lignan 2b30370b42 AT driver (master) and example 2016-05-15 12:19:04 +02:00
Nicolas Tsiftes 98fcac15cd Merge pull request #1651 from gebart/pr/lwm2m-json-sv-bv
oma-lwm2m: Use sv for string value, bv for boolean
2016-05-12 17:01:16 +02:00