mirror of
https://github.com/zephyrproject-rtos/zephyr
synced 2025-09-11 09:42:59 +00:00
CoAP library is migrated to support over socket based applications or other higher layer protocols. Most of the API's and functionality is kept as it is except few changes. net_pkt/net_buf is removed from CoAP library. Now it expects a pre-allocated flat buffer and length. If there is not enough space to append any data, library simply returns an error. It's user's responsibility to allocate and free memory. One change in functionality is, earlier coap_pending_clear() used to clear the memory, but now it's user's responsibility to free the memory. Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
56 lines
1.1 KiB
C
56 lines
1.1 KiB
C
/*
|
|
* Copyright (c) 2018 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
/**
|
|
* @file
|
|
*
|
|
* @brief CoAP implementation for Zephyr.
|
|
*/
|
|
|
|
#ifndef ZEPHYR_INCLUDE_NET_COAP_LINK_FORMAT_SOCK_H_
|
|
#define ZEPHYR_INCLUDE_NET_COAP_LINK_FORMAT_SOCK_H_
|
|
|
|
/**
|
|
* @addtogroup coap_sock COAP Library over Sockets
|
|
* @{
|
|
*/
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/**
|
|
* This resource should be added before all other resources that should be
|
|
* included in the responses of the .well-known/core resource.
|
|
*/
|
|
#define COAP_WELL_KNOWN_CORE_PATH \
|
|
((const char * const[]) { ".well-known", "core", NULL })
|
|
|
|
int coap_well_known_core_get(struct coap_resource *resource,
|
|
struct coap_packet *request,
|
|
struct coap_packet *response,
|
|
u8_t *data, u16_t len);
|
|
|
|
/**
|
|
* In case you want to add attributes to the resources included in the
|
|
* 'well-known/core' "virtual" resource, the 'user_data' field should point
|
|
* to a valid coap_core_metadata structure.
|
|
*/
|
|
struct coap_core_metadata {
|
|
const char * const *attributes;
|
|
void *user_data;
|
|
};
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
/**
|
|
* @}
|
|
*/
|
|
|
|
#endif /* ZEPHYR_INCLUDE_NET_COAP_LINK_FORMAT_SOCK_H_ */
|