From a7043f1eb25c2924f16ac728543dcc365a4b571d Mon Sep 17 00:00:00 2001 From: Patrick Grosse Date: Sat, 25 Mar 2017 10:44:52 +0100 Subject: [PATCH] pkg: microcoap: bump version (ef27289, Feb 5 2016) * Latest version contains more CoAP content types * More comments * Small bugfixes --- pkg/microcoap/Makefile | 2 +- .../0001-Remove-unneeded-.c-files.patch | 32 ++++++++++----- .../patches/0002-Add-RIOT-Makefile.patch | 19 ++++----- ...e-flag-from-DEBUG-to-MICROCOAP_DEBUG.patch | 16 ++++---- ...atch => 0004-Increment-MAX_SEGMENTS.patch} | 19 ++++----- .../0005-fix-uninitialized-variable.patch | 17 +++----- ...006-Removed-unnecessary-library.json.patch | 39 +++++++++++++++++++ 7 files changed, 97 insertions(+), 47 deletions(-) rename pkg/microcoap/patches/{0004-increment_max_segments.patch => 0004-Increment-MAX_SEGMENTS.patch} (66%) create mode 100644 pkg/microcoap/patches/0006-Removed-unnecessary-library.json.patch diff --git a/pkg/microcoap/Makefile b/pkg/microcoap/Makefile index b776bfd11..fce23da17 100644 --- a/pkg/microcoap/Makefile +++ b/pkg/microcoap/Makefile @@ -1,6 +1,6 @@ PKG_NAME=microcoap PKG_URL=https://github.com/1248/microcoap.git -PKG_VERSION=9cb1dcda2182a8dca8483b230cda8b591a924c82 +PKG_VERSION=ef272895925f0d4c563725fe0102966f544a0fdc PKG_LICENSE=MIT .PHONY: all diff --git a/pkg/microcoap/patches/0001-Remove-unneeded-.c-files.patch b/pkg/microcoap/patches/0001-Remove-unneeded-.c-files.patch index 76a384667..c97571326 100644 --- a/pkg/microcoap/patches/0001-Remove-unneeded-.c-files.patch +++ b/pkg/microcoap/patches/0001-Remove-unneeded-.c-files.patch @@ -1,13 +1,13 @@ -From 8976fda8df092ce24e1c6bbf718f94cb98009231 Mon Sep 17 00:00:00 2001 -From: Martine Lenders -Date: Sun, 1 Feb 2015 16:35:56 +0100 -Subject: [PATCH 1/2] Remove unneeded *.c files +From 335f83548f4a4a13b556800bcc354d77db8c3434 Mon Sep 17 00:00:00 2001 +From: Patrick Grosse +Date: Sat, 25 Mar 2017 10:32:27 +0100 +Subject: [PATCH 1/6] Remove unneeded *.c files --- endpoints.c | 113 ---------------------------------------------------------- - main-posix.c | 71 ------------------------------------ + main-posix.c | 85 ------------------------------------------- microcoap.ino | 99 -------------------------------------------------- - 3 files changed, 283 deletions(-) + 3 files changed, 297 deletions(-) delete mode 100644 endpoints.c delete mode 100644 main-posix.c delete mode 100644 microcoap.ino @@ -133,10 +133,10 @@ index ccc961b..0000000 - diff --git a/main-posix.c b/main-posix.c deleted file mode 100644 -index dd73cf9..0000000 +index 3711b02..0000000 --- a/main-posix.c +++ /dev/null -@@ -1,71 +0,0 @@ +@@ -1,85 +0,0 @@ -#include -#include -#include @@ -150,17 +150,31 @@ index dd73cf9..0000000 -int main(int argc, char **argv) -{ - int fd; +-#ifdef IPV6 +- struct sockaddr_in6 servaddr, cliaddr; +-#else /* IPV6 */ - struct sockaddr_in servaddr, cliaddr; +-#endif /* IPV6 */ - uint8_t buf[4096]; - uint8_t scratch_raw[4096]; - coap_rw_buffer_t scratch_buf = {scratch_raw, sizeof(scratch_raw)}; - +-#ifdef IPV6 +- fd = socket(AF_INET6,SOCK_DGRAM,0); +-#else /* IPV6 */ - fd = socket(AF_INET,SOCK_DGRAM,0); +-#endif /* IPV6 */ - - bzero(&servaddr,sizeof(servaddr)); +-#ifdef IPV6 +- servaddr.sin6_family = AF_INET6; +- servaddr.sin6_addr = in6addr_any; +- servaddr.sin6_port = htons(PORT); +-#else /* IPV6 */ - servaddr.sin_family = AF_INET; - servaddr.sin_addr.s_addr = htonl(INADDR_ANY); - servaddr.sin_port = htons(PORT); +-#endif /* IPV6 */ - bind(fd,(struct sockaddr *)&servaddr, sizeof(servaddr)); - - endpoint_setup(); @@ -314,5 +328,5 @@ index 148b6ce..0000000 -} - -- -1.9.1 +2.7.4 diff --git a/pkg/microcoap/patches/0002-Add-RIOT-Makefile.patch b/pkg/microcoap/patches/0002-Add-RIOT-Makefile.patch index 5b297aee3..de5ebdd18 100644 --- a/pkg/microcoap/patches/0002-Add-RIOT-Makefile.patch +++ b/pkg/microcoap/patches/0002-Add-RIOT-Makefile.patch @@ -1,18 +1,19 @@ -From 007576627163a35881ebdf50701f94b73aa7aae7 Mon Sep 17 00:00:00 2001 -From: Martine Lenders -Date: Sun, 1 Feb 2015 16:40:35 +0100 -Subject: [PATCH 2/2] Add RIOT Makefile +From 021e6371d6915126cf0e9cf7556b9b4a6f3ae14f Mon Sep 17 00:00:00 2001 +From: Patrick Grosse +Date: Sat, 25 Mar 2017 10:33:22 +0100 +Subject: [PATCH 2/6] Add RIOT Makefile --- - Makefile | 22 +--------------------- - 1 file changed, 1 insertion(+), 21 deletions(-) + Makefile | 23 +---------------------- + 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/Makefile b/Makefile -index bb3c5fc..48422e9 100644 +index 19175d2..48422e9 100644 --- a/Makefile +++ b/Makefile -@@ -1,21 +1 @@ +@@ -1,22 +1 @@ -CFLAGS += -Wall -DDEBUG +-# -DIPV6 -SRC = $(wildcard *.c) -OBJ = $(SRC:%.c=%.o) -DEPS = $(SRC:%.c=%.d) @@ -35,5 +36,5 @@ index bb3c5fc..48422e9 100644 - @$(RM) $(EXEC) $(OBJ) $(DEPS) +include $(RIOTBASE)/Makefile.base -- -1.9.1 +2.7.4 diff --git a/pkg/microcoap/patches/0003-change-flag-from-DEBUG-to-MICROCOAP_DEBUG.patch b/pkg/microcoap/patches/0003-change-flag-from-DEBUG-to-MICROCOAP_DEBUG.patch index 646218fa3..f26708ac8 100644 --- a/pkg/microcoap/patches/0003-change-flag-from-DEBUG-to-MICROCOAP_DEBUG.patch +++ b/pkg/microcoap/patches/0003-change-flag-from-DEBUG-to-MICROCOAP_DEBUG.patch @@ -1,7 +1,7 @@ -From a90622ce42cd1a816fab4d8f6829426bfc8683b2 Mon Sep 17 00:00:00 2001 -From: Lotte Steenbrink -Date: Sun, 8 Feb 2015 15:00:01 -0800 -Subject: [PATCH] change flag from DEBUG to MICROCOAP_DEBUG +From 265f4bb3d661b32fb3ec58712c48982bab433a52 Mon Sep 17 00:00:00 2001 +From: Patrick Grosse +Date: Sat, 25 Mar 2017 10:35:03 +0100 +Subject: [PATCH 3/6] change flag from DEBUG to MICROCOAP_DEBUG --- coap.c | 8 ++++---- @@ -9,7 +9,7 @@ Subject: [PATCH] change flag from DEBUG to MICROCOAP_DEBUG 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/coap.c b/coap.c -index 4f30e3a..ada66c2 100644 +index 4d036f5..407d1d2 100644 --- a/coap.c +++ b/coap.c @@ -9,7 +9,7 @@ @@ -49,10 +49,10 @@ index 4f30e3a..ada66c2 100644 { coap_dumpHeader(&pkt->hdr); diff --git a/coap.h b/coap.h -index c132334..4a7adc5 100644 +index c67c7ce..8c91369 100644 --- a/coap.h +++ b/coap.h -@@ -145,12 +145,22 @@ typedef struct +@@ -158,12 +158,22 @@ typedef struct /////////////////////// @@ -77,5 +77,5 @@ index c132334..4a7adc5 100644 int coap_handle_req(coap_rw_buffer_t *scratch, const coap_packet_t *inpkt, coap_packet_t *outpkt); void coap_option_nibble(uint32_t value, uint8_t *nibble); -- -1.8.3.2 +2.7.4 diff --git a/pkg/microcoap/patches/0004-increment_max_segments.patch b/pkg/microcoap/patches/0004-Increment-MAX_SEGMENTS.patch similarity index 66% rename from pkg/microcoap/patches/0004-increment_max_segments.patch rename to pkg/microcoap/patches/0004-Increment-MAX_SEGMENTS.patch index 31a2a9cf8..f36abc43c 100644 --- a/pkg/microcoap/patches/0004-increment_max_segments.patch +++ b/pkg/microcoap/patches/0004-Increment-MAX_SEGMENTS.patch @@ -1,19 +1,19 @@ -From a9ac5cc1f075b8d42cff1dc4b8f4967c755e2303 Mon Sep 17 00:00:00 2001 -From: Lotte Steenbrink -Date: Tue, 31 Mar 2015 05:54:31 +0200 -Subject: [PATCH] Increment MAX_SEGMENTS +From e78af387a5c0972cba16766541e5e659b0e08eaf Mon Sep 17 00:00:00 2001 +From: Patrick Grosse +Date: Sat, 25 Mar 2017 10:35:39 +0100 +Subject: [PATCH 4/6] Increment MAX_SEGMENTS --- coap.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/coap.h b/coap.h -index 9090285..7bea5f1 100644 +index 8c91369..5d79e4e 100644 --- a/coap.h +++ b/coap.h -@@ -131,7 +131,12 @@ typedef enum +@@ -135,7 +135,12 @@ typedef enum /////////////////////// - + typedef int (*coap_endpoint_func)(coap_rw_buffer_t *scratch, const coap_packet_t *inpkt, coap_packet_t *outpkt, uint8_t id_hi, uint8_t id_lo); +/* To increase COAP_MAX_SEGMENTS, set CFLAGS to -DCOAP_MAX_SEGMENTS=. */ +#ifndef COAP_MAX_SEGMENTS @@ -24,5 +24,6 @@ index 9090285..7bea5f1 100644 typedef struct { int count; --- -2.1.0 \ No newline at end of file +-- +2.7.4 + diff --git a/pkg/microcoap/patches/0005-fix-uninitialized-variable.patch b/pkg/microcoap/patches/0005-fix-uninitialized-variable.patch index 278723a3b..3bd88e0c1 100644 --- a/pkg/microcoap/patches/0005-fix-uninitialized-variable.patch +++ b/pkg/microcoap/patches/0005-fix-uninitialized-variable.patch @@ -1,19 +1,14 @@ -From ac2d404d32d96a50a779ded7ad007f15bcf2b4b0 Mon Sep 17 00:00:00 2001 -From: Kaspar Schleiser -Date: Mon, 30 Nov 2015 02:11:12 +0100 -Subject: [PATCH] fix uninitialized variable +From 3d467db74c39df3f79cacfe661fb29d413e2db38 Mon Sep 17 00:00:00 2001 +From: Patrick Grosse +Date: Sat, 25 Mar 2017 10:36:09 +0100 +Subject: [PATCH 5/6] fix uninitialized variable -coap.c: In function 'coap_build': -coap.c:298:17: error: 'len' may be used uninitialized in this function -[-Werror=maybe-uninitialized] - uint8_t len, delta = 0; - ^ --- coap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coap.c b/coap.c -index ada66c2..b6b05af 100644 +index 407d1d2..5006b59 100644 --- a/coap.c +++ b/coap.c @@ -295,7 +295,7 @@ int coap_build(uint8_t *buf, size_t *buflen, const coap_packet_t *pkt) @@ -26,5 +21,5 @@ index ada66c2..b6b05af 100644 if (((size_t)(p-buf)) > *buflen) return COAP_ERR_BUFFER_TOO_SMALL; -- -2.6.2 +2.7.4 diff --git a/pkg/microcoap/patches/0006-Removed-unnecessary-library.json.patch b/pkg/microcoap/patches/0006-Removed-unnecessary-library.json.patch new file mode 100644 index 000000000..1f58aeac9 --- /dev/null +++ b/pkg/microcoap/patches/0006-Removed-unnecessary-library.json.patch @@ -0,0 +1,39 @@ +From 83a5433b23b7c801067ac1dbccb6c1f6d0f78599 Mon Sep 17 00:00:00 2001 +From: Patrick Grosse +Date: Thu, 30 Mar 2017 13:08:05 +0200 +Subject: [PATCH 6/6] Removed unnecessary library.json + +--- + library.json | 20 -------------------- + 1 file changed, 20 deletions(-) + delete mode 100644 library.json + +diff --git a/library.json b/library.json +deleted file mode 100644 +index 570161c..0000000 +--- a/library.json ++++ /dev/null +@@ -1,20 +0,0 @@ +-{ +- "name": "microcoap", +- "keywords": "coap, web", +- "description": "A small CoAP implementation for microcontrollers", +- "repository": { +- "type": "git", +- "url": "https://github.com/1248/microcoap.git" +- }, +- "authors": { +- "name": "Toby Jaffey", +- "url": "http://twitter.com/tobyjaffey" +- }, +- "exclude": [ +- "main-posix.c", +- "microcoap.ino" +- ], +- "examples": "microcoap.ino", +- "frameworks": "arduino", +- "platforms": "*" +-} +-- +2.7.4 +