KNX IoT
KNX IoT Point API stack implementation
oc_discovery.h File Reference

CoAP Discovery. More...

#include <stddef.h>

Go to the source code of this file.

Functions

bool oc_add_resource_to_wk (const oc_resource_t *resource, oc_request_t *request, size_t device_index, size_t *response_length, int truncate)
 add the resource to the response in application link format More...
 
void oc_create_discovery_resource (int resource_idx, size_t device)
 create a resource that is discoverable. More...
 
bool oc_filter_resource (const oc_resource_t *resource, oc_request_t *request, size_t device_index, size_t *response_length, int *skipped, int first_entry, int truncate)
 filter resource if it needs to be included in the response of a link-format response More...
 

Detailed Description

CoAP Discovery.

Definition in file oc_discovery.h.

Function Documentation

◆ oc_add_resource_to_wk()

bool oc_add_resource_to_wk ( const oc_resource_t resource,
oc_request_t request,
size_t  device_index,
size_t *  response_length,
int  truncate 
)

add the resource to the response in application link format

Parameters
resourcethe resource
requestthe request
device_indexthe device index
response_lengththe response length (to be increased)
truncate1 = do urn truncation; remove the urn part of the rt value
Returns
true
false

◆ oc_create_discovery_resource()

void oc_create_discovery_resource ( int  resource_idx,
size_t  device 
)

create a resource that is discoverable.

Parameters
resource_idxthe resource index
devicethe device to which the resource belongs

◆ oc_filter_resource()

bool oc_filter_resource ( const oc_resource_t resource,
oc_request_t request,
size_t  device_index,
size_t *  response_length,
int *  skipped,
int  first_entry,
int  truncate 
)

filter resource if it needs to be included in the response of a link-format response

Parameters
resourcethe resource to be included
requestthe request, with all query parameters
device_indexthe device index on the request is being made
response_lengththe current response length
skippednumber of entries already skipped
first_entryfirst entry to be included
truncatewhether to truncate the response payload
Returns
true resource added (as entry) to the response
false resource not added to the response