2016-11-05 04:33:46 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2016 Intel Corporation
|
|
|
|
*
|
2017-01-19 09:01:01 +08:00
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
2016-11-05 04:33:46 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
*
|
|
|
|
* @brief CoAP implementation for Zephyr.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __LINK_FORMAT_H__
|
|
|
|
#define __LINK_FORMAT_H__
|
|
|
|
|
2017-07-24 21:23:14 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2017-02-01 22:33:07 +08:00
|
|
|
/**
|
2017-07-20 21:29:45 +08:00
|
|
|
* @addtogroup zoap COAP Library
|
2017-02-01 22:33:07 +08:00
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
2016-11-05 04:33:46 +08:00
|
|
|
#define _ZOAP_WELL_KNOWN_CORE_PATH \
|
|
|
|
((const char * const[]) { ".well-known", "core", NULL })
|
|
|
|
|
|
|
|
int _zoap_well_known_core_get(struct zoap_resource *resource,
|
|
|
|
struct zoap_packet *request,
|
|
|
|
const struct sockaddr *from);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This resource should be added before all other resources that should be
|
|
|
|
* included in the responses of the .well-known/core resource.
|
|
|
|
*/
|
|
|
|
#define ZOAP_WELL_KNOWN_CORE_RESOURCE \
|
|
|
|
{ .get = _zoap_well_known_core_get, \
|
|
|
|
.path = _ZOAP_WELL_KNOWN_CORE_PATH, \
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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 zoap_core_metadata structure.
|
|
|
|
*/
|
|
|
|
struct zoap_core_metadata {
|
|
|
|
const char * const *attributes;
|
|
|
|
void *user_data;
|
|
|
|
};
|
|
|
|
|
2017-02-01 22:33:07 +08:00
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
2017-07-24 21:23:14 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2016-11-05 04:33:46 +08:00
|
|
|
#endif /* __LINK_FORMAT_H__ */
|