Commit Graph

276 Commits

Author SHA1 Message Date
Dirk Ziegelmeier
5c58e25de5 Minor code readability improvement in mqtt.c 2017-01-15 09:22:13 +01:00
Dirk Ziegelmeier
f8ef8c48f7 Simplify HTTPD #include path handling
- Move fsdata.h content to lwip/apps/fs.h -> no #include path needed any more to src/apps/httpd/
- Create a #define to specify fsdata file name. One can use path in there now, e.g. "../mywebserver/mkfsdata_output.c" -> no #include path needed any more to location of generated file
2017-01-11 10:59:15 +01:00
Dirk Ziegelmeier
52f448978f MQTT: Add check that WILL topic length must be > 0 2017-01-08 19:08:54 +01:00
Dirk Ziegelmeier
6d5ddb7139 MQTT: Fix possible bug in connect message generation that WILL flag can be set without appending a will message
The boolean condition of setting the WILL flag differs from that of appending the will message
Found by Axel Lin
(I fixed it the same way as Axel suggested, but I wanted a different commit message)
2017-01-08 19:07:43 +01:00
Axel Lin
a2915b7142 mqtt: Slightly improve mqtt_create_request
Mainly for better readability, also save NULL test while iterating the for loop.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2017-01-07 20:39:41 +01:00
Axel Lin
7faa4bcbe2 mqtt: Prevent NULL pointer dereference before assertion checking
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2017-01-06 12:15:03 +01:00
Dirk Ziegelmeier
0ffaccaec3 Add missing #include in httpd.c for atoi() 2017-01-05 08:53:26 +01:00
Erik Ekman
d2631e6a53 mqtt: Fix pedantic enum warning
src/apps/mqtt/mqtt.c:81:17: error: comma at end of enumerator list [-Werror=pedantic]
2017-01-04 00:24:00 +01:00
Dirk Ziegelmeier
2096f1a657 Fix C++ style comment in mqtt.c 2017-01-01 20:23:11 +01:00
Axel Lin
edfeab7932 mqtt: Trivial coding style fix
Add proper blank for if/for/while statements.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2017-01-01 19:20:24 +01:00
Dirk Ziegelmeier
f874d15185 Add #include <string.h> in snmp_netconn.c because memset() is used 2017-01-01 12:38:34 +01:00
Dirk Ziegelmeier
1466b7ac61 Several mqtt documentation fixes found by clang 2016-12-29 09:44:07 +01:00
Axel Lin
bfa0358a52 mqtt: Allow setting server port to connect
This is a mqtt client, so it does not make sense to determinate the server port
at compile time. Update mqtt_client_connect() function to allow setting server
port.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2016-12-23 09:52:31 +01:00
Dirk Ziegelmeier
3a557baedd Move a few MQTT options from mqtt.c to mqtt_opts.h 2016-12-21 09:42:25 +01:00
Dirk Ziegelmeier
6e219b6b11 Change signature of mqtt_client_connect() to take an IP addr instead of a string 2016-12-21 09:36:28 +01:00
Dirk Ziegelmeier
ec1450bac4 Add mqtt documentation from Erik Anderson, rev 4b84fff 2016-12-21 09:29:47 +01:00
Axel Lin
5be91de56c mqtt: Trivial error message fix
Fix trivial copy-paste mistake.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2016-12-21 08:54:57 +01:00
Axel Lin
d5bc856f45 mqtt: Check conn_state before create request for sub_unsub
This also avoid a request leak in client->conn_state == TCP_DISCONNECTED error
path.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2016-12-20 19:45:31 +01:00
Dirk Ziegelmeier
16b895b466 Undo removal of mqtt_publish() from documentation in Simon's last commit (guess it was by accident) 2016-12-20 10:48:19 +01:00
Dirk Ziegelmeier
dcb761637d Minor documentation fix in MQTT 2016-12-20 10:42:56 +01:00
Axel Lin
02f4610b1c mqtt: Use LWIP_ARRAYSIZE to replace hardcoded value
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2016-12-20 10:36:42 +01:00
goldsimon
b6a131edfb mqtt: fix C usage (declaration after statement), fix casting to smaller type 2016-12-20 10:27:43 +01:00
Dirk Ziegelmeier
12bc2c0425 MQTT cleanups:
- create mqtt_opts.h file and move options in there
- documentation cleanups
2016-12-20 10:08:50 +01:00
Dirk Ziegelmeier
14e36866f5 Some cleanups in MQTT client
Integrate in documentation
Compile fixes, mostly: Variables must be declared before any statement in a function
2016-12-20 09:41:21 +01:00
Dirk Ziegelmeier
1e82465766 task #14281: Add MQTT client
Thanks to Erik Andersen
Taken from https://github.com/erian747/, branch mqtt, rev 5d59470
2016-12-20 09:16:21 +01:00
goldsimon
fb07d47b82 more LWIP_NOASSERT fixes 2016-12-19 10:34:49 +01:00
Dirk Ziegelmeier
e5f9f187ad Continue to fix incorrect casts via size_t for some platforms
Now also for casts:
- to remove alignment warnings
- casts between pointers and ints
2016-12-12 10:17:33 +01:00
Dirk Ziegelmeier
f2a5aa2866 Fix bug #49827: wrong cast to size_t on 16-bit x86 architecture
I hope I caught all of them.
TODO: Same for casts to get rid of alignment warnings, these are also casts via size_t
2016-12-12 10:07:00 +01:00
goldsimon
ac4d994249 mdns.c: use group initializer constants from prot/dns.h 2016-12-09 13:10:12 +01:00
goldsimon
f308694dd4 Revert "mdns.c: use constants from dns.h/.c"
This reverts commit 0e883bbbc5.
2016-12-09 13:08:00 +01:00
goldsimon
0e883bbbc5 mdns.c: use constants from dns.h/.c 2016-12-09 12:49:49 +01:00
Dirk Ziegelmeier
89cb7b7aa1 Try to remove #include <stdlib.h> from many files. Does not seem necessary any more and might cause problems when porting lwIP. 2016-12-08 11:05:01 +01:00
Dirk Ziegelmeier
e00a131160 Fix bug #49778: sntp_stop does not cancel all timers
Patch by Ari Suutari
2016-12-06 20:29:12 +01:00
Axel Lin
795acf020e lwiperf: Simplify #if LWIPERF_CHECK_RX_DATA guard
The variable i is equal to q->len after exit the for loop.
Check the received data should not change the logic of update packet_idx.
So let's simplify the code a bit.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2016-12-06 11:36:25 +01:00
Dirk Ziegelmeier
1687721600 Fix compile when IPv4 is disabled 2016-12-05 22:01:58 +01:00
Axel Lin
12e35c4c12 mdns: Fix assertion message in mdns_resp_add_service_txtitem()
So we know which function emits the assertion.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2016-11-30 11:36:05 +01:00
Dirk Ziegelmeier
ad17f345e7 mdns: Use strlen to determine string length of strings contained in a struct - padding seems to be applied to these strings, and sizeof() returns the _padded_ size???
Found by compiling with CLANG with address sanitizer enabled
2016-11-16 21:01:15 +01:00
Erik Ekman
b90682dc8b Update email address
I am leaving Verisure at the end of the month.
2016-11-10 11:19:51 +01:00
Dirk Ziegelmeier
5d22679c67 Use API function instead of accessing struct members directly 2016-11-05 16:14:11 +01:00
Erik Ekman
725feb0d4a mdns: Use netif_get/set_client_data helpers 2016-10-11 11:34:59 +02:00
Dirk Ziegelmeier
f6e27940bd Make lwIP compile with clang -Wdocumentation -> several documentation fixes 2016-10-09 12:21:39 +02:00
Dirk Ziegelmeier
13fb616bb2 Cleanup hton*/ntoh* function handling and platform abstraction
Let lwip use functions/macros prefixed by lwip_ internally to avoid naming clashes with external #includes.
Remove over-complicated #define handling in def.h
Make functions easier to override in cc.h. The following is sufficient now (no more LWIP_PLATFORM_BYTESWAP):
#define lwip_htons(x) <your_htons>
#define lwip_htonl(x) <your_htonl>
2016-10-06 12:55:57 +02:00
Dirk Ziegelmeier
fa211096c2 Fix macro name clash with windows headers in TFTP server
Reported by Gisle Vanem
2016-10-05 21:02:46 +02:00
Axel Lin
87172d6d35 mdns: Use NETIF_TO_HOST at appropriate places
Trivial cleanup, use NETIF_TO_HOST macro to get mdns_host from netif.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2016-10-05 11:23:08 +02:00
Dirk Ziegelmeier
81549578bf Fix compile of TFTP with MSVC 2016-10-04 08:54:52 +02:00
Dirk Ziegelmeier
f8683499a6 TFTP: Add missing newline at end of file 2016-10-03 14:33:57 +02:00
Dirk Ziegelmeier
1e5efee7cb TFTP server depends on UDP 2016-10-03 09:50:34 +02:00
Dirk Ziegelmeier
b040544628 task #14150: Add TFTP server from Logan Gunthorpe
Originally written by Logan Gunthorpe, modifications/fixes/IPv6 by Dirk Ziegelmeier
2016-10-03 09:47:41 +02:00
Dirk Ziegelmeier
af04864094 Remove non-standard strnlen() call in snmp_msg.c 2016-09-29 08:30:33 +02:00
Dirk Ziegelmeier
5ddd2aef4b Substitute custom itoa implementation mdns by lwip_itoa() and strlen() call 2016-09-29 08:25:57 +02:00