libamxb  4.8.2
Bus Agnostic C API
amxb_operators.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** SPDX-License-Identifier: BSD-2-Clause-Patent
4 **
5 ** SPDX-FileCopyrightText: Copyright (c) 2023 SoftAtHome
6 **
7 ** Redistribution and use in source and binary forms, with or without modification,
8 ** are permitted provided that the following conditions are met:
9 **
10 ** 1. Redistributions of source code must retain the above copyright notice,
11 ** this list of conditions and the following disclaimer.
12 **
13 ** 2. Redistributions in binary form must reproduce the above copyright notice,
14 ** this list of conditions and the following disclaimer in the documentation
15 ** and/or other materials provided with the distribution.
16 **
17 ** Subject to the terms and conditions of this license, each copyright holder
18 ** and contributor hereby grants to those receiving rights under this license
19 ** a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable
20 ** (except for failure to satisfy the conditions of this license) patent license
21 ** to make, have made, use, offer to sell, sell, import, and otherwise transfer
22 ** this software, where such license applies only to those patent claims, already
23 ** acquired or hereafter acquired, licensable by such copyright holder or contributor
24 ** that are necessarily infringed by:
25 **
26 ** (a) their Contribution(s) (the licensed copyrights of copyright holders and
27 ** non-copyrightable additions of contributors, in source or binary form) alone;
28 ** or
29 **
30 ** (b) combination of their Contribution(s) with the work of authorship to which
31 ** such Contribution(s) was added by such copyright holder or contributor, if,
32 ** at the time the Contribution is added, such addition causes such combination
33 ** to be necessarily infringed. The patent license shall not apply to any other
34 ** combinations which include the Contribution.
35 **
36 ** Except as expressly stated above, no rights or licenses from any copyright
37 ** holder or contributor is granted under this license, whether expressly, by
38 ** implication, estoppel or otherwise.
39 **
40 ** DISCLAIMER
41 **
42 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
43 ** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
44 ** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
45 ** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
46 ** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
47 ** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
48 ** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
49 ** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
50 ** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
51 ** USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
52 **
53 ****************************************************************************/
54 
55 #if !defined(__AMXB_OPERATORS_H__)
56 #define __AMXB_OPERATORS_H__
57 
58 #ifdef __cplusplus
59 extern "C"
60 {
61 #endif
62 
63 #include <amxb/amxb_types.h>
64 
65 
77 #define AMXB_FLAG_PARAMETERS 0x0001
78 #define AMXB_FLAG_FUNCTIONS 0x0002
79 #define AMXB_FLAG_EVENTS 0x0004
80 #define AMXB_FLAG_OBJECTS 0x0008
81 #define AMXB_FLAG_INSTANCES 0x0010
82 #define AMXB_FLAG_FIRST_LVL 0x0020
83 #define AMXB_FLAG_NAMED 0x0040
84 #define AMXB_FLAG_EXISTS 0x0080
85 #define AMXB_FLAG_TEMPLATE_INFO 0x0100
86 #define AMXB_FLAG_PARTIAL 0x0200
87 #define AMXB_FLAG_PROTECTED 0x0400
88 
116 int amxb_call(amxb_bus_ctx_t* const bus_ctx,
117  const char* object,
118  const char* method,
119  amxc_var_t* args,
120  amxc_var_t* ret,
121  int timeout);
122 
158  const char* object,
159  const char* method,
160  amxc_var_t* args,
161  amxb_be_done_cb_fn_t done_fn,
162  void* priv);
163 
164 
224 int amxb_get(amxb_bus_ctx_t* const bus_ctx,
225  const char* object,
226  int32_t depth,
227  amxc_var_t* ret,
228  int timeout);
229 
295  const char* object,
296  const char* filter,
297  int32_t depth,
298  amxc_var_t* ret,
299  int timeout);
300 
399  amxc_var_t* req_paths,
400  int32_t depth,
401  amxc_var_t* ret,
402  int timeout);
403 
467 int amxb_set(amxb_bus_ctx_t* const bus_ctx,
468  const char* object,
469  amxc_var_t* values,
470  amxc_var_t* ret,
471  int timeout);
472 
638  uint32_t flags,
639  amxc_var_t* req_paths,
640  amxc_var_t* ret,
641  int timeout);
711 int amxb_add(amxb_bus_ctx_t* const bus_ctx,
712  const char* object,
713  uint32_t index,
714  const char* name,
715  amxc_var_t* values,
716  amxc_var_t* ret,
717  int timeout);
718 
762 int amxb_del(amxb_bus_ctx_t* const bus_ctx,
763  const char* object,
764  uint32_t index,
765  const char* name,
766  amxc_var_t* ret,
767  int timeout);
768 
831  const char* object,
832  uint32_t flags,
833  amxc_var_t* ret,
834  int timeout);
835 
920  const char* object,
921  uint32_t flags,
922  amxc_var_t* ret,
923  int timeout);
924 
952 int amxb_list(amxb_bus_ctx_t* const bus_ctx,
953  const char* object,
954  uint32_t flags,
955  amxb_be_cb_fn_t fn,
956  void* priv);
957 
959  amxd_path_t* obj_path,
960  amxc_var_t* ret_val);
961 
1014  const char* search_path,
1015  int32_t depth,
1016  amxc_var_t* ret,
1017  int timeout);
1018 
1019 #ifdef __cplusplus
1020 }
1021 #endif
1022 
1023 #endif // __AMXB_OPERATORS_H__
int amxb_resolve(amxb_bus_ctx_t *bus_ctx, amxd_path_t *obj_path, amxc_var_t *ret_val)
void(* amxb_be_cb_fn_t)(const amxb_bus_ctx_t *bus_ctx, const amxc_var_t *const data, void *priv)
Definition: amxb_types.h:85
void(* amxb_be_done_cb_fn_t)(const amxb_bus_ctx_t *bus_ctx, amxb_request_t *req, int status, void *priv)
Definition: amxb_types.h:89
int amxb_del(amxb_bus_ctx_t *const bus_ctx, const char *object, uint32_t index, const char *name, amxc_var_t *ret, int timeout)
Deletes one or more instances of a multi-instance object.
int amxb_set(amxb_bus_ctx_t *const bus_ctx, const char *object, amxc_var_t *values, amxc_var_t *ret, int timeout)
Sets parameter values of one single object or of multiple instance objects.
int amxb_get_supported(amxb_bus_ctx_t *const bus_ctx, const char *object, uint32_t flags, amxc_var_t *ret, int timeout)
Gets the supported data model.
int amxb_describe(amxb_bus_ctx_t *const bus_ctx, const char *object, uint32_t flags, amxc_var_t *ret, int timeout)
Describes an object.
amxb_request_t * amxb_async_call(amxb_bus_ctx_t *const bus_ctx, const char *object, const char *method, amxc_var_t *args, amxb_be_done_cb_fn_t done_fn, void *priv)
Invokes a data model function.
int amxb_call(amxb_bus_ctx_t *const bus_ctx, const char *object, const char *method, amxc_var_t *args, amxc_var_t *ret, int timeout)
Invokes a data model function.
int amxb_get_multiple(amxb_bus_ctx_t *const bus_ctx, amxc_var_t *req_paths, int32_t depth, amxc_var_t *ret, int timeout)
Fetches one or more (root) objects or multiple parameters.
int amxb_get(amxb_bus_ctx_t *const bus_ctx, const char *object, int32_t depth, amxc_var_t *ret, int timeout)
Fetches one or more objects or a single parameter.
int amxb_get_instances(amxb_bus_ctx_t *const bus_ctx, const char *search_path, int32_t depth, amxc_var_t *ret, int timeout)
Fetches the instances and the unique keys of a multi-instance object.
int amxb_get_filtered(amxb_bus_ctx_t *const bus_ctx, const char *object, const char *filter, int32_t depth, amxc_var_t *ret, int timeout)
Fetches one or more objects and their parameters that are matching a filter.
int amxb_add(amxb_bus_ctx_t *const bus_ctx, const char *object, uint32_t index, const char *name, amxc_var_t *values, amxc_var_t *ret, int timeout)
Adds an instance to a multi-instance object.
int amxb_set_multiple(amxb_bus_ctx_t *const bus_ctx, uint32_t flags, amxc_var_t *req_paths, amxc_var_t *ret, int timeout)
Sets parameter values for multiple objects (request paths)
int amxb_list(amxb_bus_ctx_t *const bus_ctx, const char *object, uint32_t flags, amxb_be_cb_fn_t fn, void *priv)
List the service elements/nodes of an object.
A request structure.
Definition: amxb_types.h:138
static amxb_bus_ctx_t * bus_ctx
Definition: test_amxb_e2e.c:84