KNX IoT
KNX IoT Point API stack implementation
oc_knx_helpers.h
Go to the documentation of this file.
1 /*
2 // Copyright (c) 2023 Cascoda Ltd.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 */
20 #ifndef OC_KNX_HELPERS_H
21 #define OC_KNX_HELPERS_H
22 
23 #include "oc_api.h"
24 #include "oc_helpers.h"
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 #ifndef PAGE_SIZE
31 #define PAGE_SIZE 20
32 #endif
33 
45 int check_if_query_l_exist(oc_request_t *request, bool *ps_exists,
46  bool *total_exists);
47 
64 int oc_frame_query_l(char *url, bool ps_exists, int ps, bool total_exists,
65  int total);
66 
76 bool check_if_query_pn_exist(oc_request_t *request, int *pn_value,
77  int *ps_value);
78 
87 int add_next_page_indicator(char *url, int next_page_num);
88 
94 int oc_frame_integer(int value);
95 
96 #ifdef __cplusplus
97 }
98 #endif
99 
100 #endif /* OC_KNX_HELPERS_H */
Main API of the stack for client and server.
generic helpers
bool check_if_query_pn_exist(oc_request_t *request, int *pn_value, int *ps_value)
helper function to check if query parameter pn exists
int oc_frame_integer(int value)
helper function to frame an integer in the response:
int oc_frame_query_l(char *url, bool ps_exists, int ps, bool total_exists, int total)
helper function to frame url part of query response: spec 1.0:
int add_next_page_indicator(char *url, int next_page_num)
helper function to frame next page indicator, if more requests (pages) are needed to get the full lis...
int check_if_query_l_exist(oc_request_t *request, bool *ps_exists, bool *total_exists)
helper function to check if query parameter l exists
request information structure
Definition: oc_ri.h:412