mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-03 00:15:49 +03:00
83 lines
2.0 KiB
Plaintext
83 lines
2.0 KiB
Plaintext
#ifndef _CONFIG_H_
|
|
#define _CONFIG_H_
|
|
|
|
#include "contiki.h"
|
|
#include "contiki-lib.h"
|
|
#include "contiki-net.h"
|
|
|
|
#define WITH_CONTIKI 1
|
|
|
|
#define COAP_MAX_PDU_SIZE 64
|
|
|
|
/** Number of resources that can be handled by a CoAP server in addition to
|
|
* @c /.well-known/core */
|
|
#define COAP_MAX_RESOURCES 3
|
|
|
|
/** Number of attributes that can be handled (should be at least
|
|
* @c 2 * COAP_MAX_RESOURCES. to carry the content type and the
|
|
* resource type. */
|
|
#define COAP_MAX_ATTRIBUTES 4
|
|
|
|
/**
|
|
* Number of PDUs that can be stored simultaneously. This number
|
|
* includes both, the PDUs stored for retransmission as well as the
|
|
* PDUs received. Beware that choosing a too small value can lead to
|
|
* many retransmissions to be dealt with.
|
|
*/
|
|
#define COAP_PDU_MAXCNT 4
|
|
|
|
/**
|
|
* Maximum number of subscriptions. Every additional subscriber costs
|
|
* 36 B.
|
|
*/
|
|
#define COAP_MAX_SUBSCRIBERS 3
|
|
|
|
/**
|
|
* Number of notifications that may be sent non-confirmable before a
|
|
* confirmable message is sent to detect if observers are alive. The
|
|
* maximum allowed value here is @c 15.
|
|
*/
|
|
#define COAP_OBS_MAX_NON 5
|
|
|
|
/**
|
|
* Number of confirmable notifications that may fail (i.e. time out
|
|
* without being ACKed) before an observer is removed. The maximum
|
|
* value for COAP_OBS_MAX_FAIL is @c 3.
|
|
*/
|
|
#define COAP_OBS_MAX_FAIL 3
|
|
|
|
#define DEBUG DEBUG_PRINT
|
|
#define HAVE_STRNLEN 1
|
|
#define HAVE_SNPRINTF 1
|
|
|
|
/* there is no file-oriented output */
|
|
#define COAP_DEBUG_FD NULL
|
|
#define COAP_ERR_FD NULL
|
|
|
|
#include "contiki-conf.h"
|
|
|
|
#if defined(PLATFORM) && PLATFORM == PLATFORM_MC1322X
|
|
/* Redbee econotags get a special treatment here: endianness is set
|
|
* explicitly, and assert() is defined as emtpy directive unless
|
|
* HAVE_ASSERT_H is given.
|
|
*/
|
|
|
|
#define BYTE_ORDER UIP_LITTLE_ENDIAN
|
|
|
|
#ifndef HAVE_ASSERT_H
|
|
# define assert(x)
|
|
#endif
|
|
|
|
#endif /* defined(PLATFORM) && PLATFORM == PLATFORM_MC1322X */
|
|
|
|
#ifndef BYTE_ORDER
|
|
# ifdef UIP_CONF_BYTE_ORDER
|
|
# define BYTE_ORDER UIP_CONF_BYTE_ORDER
|
|
# else
|
|
# error "UIP_CONF_BYTE_ORDER not defined"
|
|
# endif /* UIP_CONF_BYTE_ORDER */
|
|
#endif /* BYTE_ORDER */
|
|
|
|
#endif /* _CONFIG_H_ */
|
|
|