Merge branch 'develop' into contrib/coap-endpoint-parse

This commit is contained in:
Simon Duquennoy 2018-06-04 20:33:56 +02:00 committed by GitHub
commit 470378006d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 57 additions and 14 deletions

2
.gitignore vendored
View File

@ -60,7 +60,7 @@ COOJA.testlog
summary
tests/[0-9][0-9]-*/org/
tests/18-coap-lwm2m/Californium.properties
tests/18-coap-lwm2m/leshan-server-demo-1.0.0-SNAPSHOT-jar-with-dependencies.jar
tests/18-coap-lwm2m/leshan-server-demo*.jar
# x86 UEFI files
cpu/x86/uefi/Makefile.uefi

View File

@ -324,4 +324,26 @@ list_item_next(void *item)
return item == NULL ? NULL : ((struct list *)item)->next;
}
/*---------------------------------------------------------------------------*/
/**
* \brief Check if the list contains an item
* \param list The list that is checked
* \param item An item to look for in the list
* \returns 0 if the list does not contains the item, and 1 otherwise
*
* This function searches for an item in the list and returns
* 0 if the list does not contain the item, and 1 if the item
* is present in the list.
*/
bool
list_contains(list_t list, void *item)
{
struct list *l;
for(l = *list; l != NULL; l = l->next) {
if(item == l) {
return true;
}
}
return false;
}
/*---------------------------------------------------------------------------*/
/** @} */

View File

@ -66,6 +66,8 @@
#ifndef LIST_H_
#define LIST_H_
#include <stdbool.h>
#define LIST_CONCAT2(s1, s2) s1##s2
#define LIST_CONCAT(s1, s2) LIST_CONCAT2(s1, s2)
@ -151,6 +153,8 @@ void list_insert(list_t list, void *previtem, void *newitem);
void * list_item_next(void *item);
bool list_contains(list_t list, void *item);
#endif /* LIST_H_ */
/** @} */

View File

@ -68,9 +68,9 @@
#ifndef LWM2M_ENGINE_CLIENT_ENDPOINT_PREFIX
#ifdef LWM2M_DEVICE_MODEL_NUMBER
#define LWM2M_ENGINE_CLIENT_ENDPOINT_PREFIX LWM2M_DEVICE_MODEL_NUMBER
#define LWM2M_ENGINE_CLIENT_ENDPOINT_PREFIX "Contiki-NG-"LWM2M_DEVICE_MODEL_NUMBER
#else /* LWM2M_DEVICE_MODEL_NUMBER */
#define LWM2M_ENGINE_CLIENT_ENDPOINT_PREFIX "Contiki-"
#define LWM2M_ENGINE_CLIENT_ENDPOINT_PREFIX "Contiki-NG"
#endif /* LWM2M_DEVICE_MODEL_NUMBER */
#endif /* LWM2M_ENGINE_CLIENT_ENDPOINT_PREFIX */
@ -763,7 +763,7 @@ perform_multi_resource_read_op(lwm2m_object_t *object,
}
/* ---------- Read operation ------------- */
} else if(ctx->operation == LWM2M_OP_READ) {
lwm2m_status_t success;
lwm2m_status_t success = 0;
uint8_t lv;
lv = ctx->level;

View File

@ -30,7 +30,7 @@ DOCDIR=../../tools/doxygen
all: clean summary
doxygen:
@make -C $(DOCDIR) 2> doxygen.err > /dev/null
-@$(MAKE) -C $(DOCDIR) 2> doxygen.err > /dev/null
summary: doxygen
@( \
@ -55,4 +55,4 @@ summary: doxygen
clean:
@rm -f summary doxygen.err
@make -C $(DOCDIR) clean
@$(MAKE) -C $(DOCDIR) clean

View File

@ -156,6 +156,19 @@ UNIT_TEST(test_list)
UNIT_TEST_ASSERT(tail->next == NULL);
UNIT_TEST_ASSERT(list_length(lst) == 4);
/*
* Check that list contains elements 0, 1, 2, 3
* and not others
* 0 --> 1 --> 2 --> 3 --> NULL
*/
UNIT_TEST_ASSERT(list_contains(lst, &elements[0]));
UNIT_TEST_ASSERT(list_contains(lst, &elements[1]));
UNIT_TEST_ASSERT(list_contains(lst, &elements[2]));
UNIT_TEST_ASSERT(list_contains(lst, &elements[3]));
int i;
for(i=4; i<ELEMENT_COUNT; i++) {
UNIT_TEST_ASSERT(!list_contains(lst, &elements[i]));
}
/*
* Remove the tail
* 0 --> 1 --> 2 --> NULL

View File

@ -17,9 +17,10 @@ CPID=$!
sleep 10
echo "Downloading leshan"
wget -nc https://joakimeriksson.github.io/resources/leshan-server-demo-1.0.0-SNAPSHOT-jar-with-dependencies.jar
LESHAN_JAR=leshan-server-demo-1.0.0-SNAPSHOT-jar-with-dependencies.jar
wget -nc https://joakimeriksson.github.io/resources/$LESHAN_JAR
echo "Starting leshan server"
java -jar leshan-server-demo-1.0.0-SNAPSHOT-jar-with-dependencies.jar >leshan.log 2>leshan.err &
java -jar $LESHAN_JAR >leshan.log 2>leshan.err &
LESHID=$!
COUNTER=10

View File

@ -12,9 +12,10 @@ make CONTIKI_NG=../../$CONTIKI -C example-lwm2m-standalone/lwm2m clean >/dev/nul
make CONTIKI_NG=../../$CONTIKI -C example-lwm2m-standalone/lwm2m >make.log 2>make.err
echo "Downloading leshan"
wget -nc https://joakimeriksson.github.io/resources/leshan-server-demo-1.0.0-SNAPSHOT-jar-with-dependencies.jar
LESHAN_JAR=leshan-server-demo-1.0.0-SNAPSHOT-jar-with-dependencies.jar
wget -nc https://joakimeriksson.github.io/resources/$LESHAN_JAR
echo "Starting leshan server"
java -jar leshan-server-demo-1.0.0-SNAPSHOT-jar-with-dependencies.jar -lp 5686 -slp 5687 >leshan.log 2>leshan.err &
java -jar $LESHAN_JAR -lp 5686 -slp 5687 >leshan.log 2>leshan.err &
LESHID=$!
echo "Starting lwm2m standalone example"

View File

@ -16,9 +16,10 @@ CPID=$!
sleep 10
echo "Downloading leshan with Q-Mode support"
wget -nc https://carlosgp143.github.io/resources/leshan-server-demo-qmode-support1.0.0-SNAPSHOT-jar-with-dependencies.jar
LESHAN_JAR=leshan-server-demo-qmode-support1.0.0-SNAPSHOT-jar-with-dependencies.jar
wget -nc https://carlosgp143.github.io/resources/$LESHAN_JAR
echo "Starting leshan server with Q-Mode enabled"
java -jar leshan-server-demo-qmode-support1.0.0-SNAPSHOT-jar-with-dependencies.jar >leshan.log 2>leshan.err &
java -jar $LESHAN_JAR >leshan.log 2>leshan.err &
LESHID=$!
COUNTER=10

View File

@ -11,9 +11,10 @@ make CONTIKI_NG=../../$CONTIKI -C example-lwm2m-standalone/lwm2m clean >/dev/nul
make CONTIKI_NG=../../$CONTIKI -C example-lwm2m-standalone/lwm2m DEFINES=LWM2M_QUEUE_MODE_CONF_ENABLED=1,LWM2M_QUEUE_MODE_CONF_INCLUDE_DYNAMIC_ADAPTATION=1,LWM2M_QUEUE_MODE_OBJECT_CONF_ENABLED=1 >make.log 2>make.err
echo "Downloading leshan with Q-Mode support"
wget -nc https://carlosgp143.github.io/resources/leshan-server-demo-qmode-support1.0.0-SNAPSHOT-jar-with-dependencies.jar
LESHAN_JAR=leshan-server-demo-qmode-support1.0.0-SNAPSHOT-jar-with-dependencies.jar
wget -nc https://carlosgp143.github.io/resources/$LESHAN_JAR
echo "Starting leshan server with Q-Mode enabled"
java -jar leshan-server-demo-1.0.0-SNAPSHOT-jar-with-dependencies.jar -lp 5686 -slp 5687 >leshan.log 2>leshan.err &
java -jar $LESHAN_JAR -lp 5686 -slp 5687 >leshan.log 2>leshan.err &
LESHID=$!
echo "Starting lwm2m standalone example"