Commit aa225f74 authored by Olaf Bergmann's avatar Olaf Bergmann

dcaf_coap.h: fix coap.h include path for ESP-IDF

Under ESP-IDF [1], coap.h resides in port/include/coap and therefore
is not found by the #include <coap2/coap.h>. This adds a pre-processor
conditional to #include <coap.h> if ESP_PLATFORM is defined.

[1] https://github.com/espressif/esp-idf
parent 5743f52d
/*
* dcaf_coap.h -- CoAP compatibility wrapper libdcaf
*
* Copyright (C) 2018 Olaf Bergmann <bergmann@tzi.org>
* Copyright (C) 2018-2020 Olaf Bergmann <bergmann@tzi.org>
*
* This file is part of the DCAF library libdcaf. Please see README
* for terms of use.
......@@ -10,7 +10,17 @@
#ifndef _DCAF_COAP_H_
#define _DCAF_COAP_H_ 1
/*
* The auto-generated file coap.h usually resides in the coap2 include
* path. As the ESP-IDF does not generate the file and comes with a
* custom coap.h that lives in port/coap we need to change the include
* path accordingly.
*/
#ifdef ESP_PLATFORM
#include <coap.h>
#else /* !ESP_PLATFORM */
#include <coap2/coap.h>
#endif /* !ESP_PLATFORM */
#define COAP_CODE_BAD_REQUEST (COAP_RESPONSE_CODE(400))
#define COAP_CODE_UNAUTHORIZED (COAP_RESPONSE_CODE(401))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment