Lines Matching +full:trigger +full:- +full:conversion +full:- +full:via +full:- +full:int

3  * Copyright (c) 2017-2019 Foundries.io
5 * SPDX-License-Identifier: Apache-2.0
10 * @brief LwM2M high-level API
13 * LwM2M high-level interface is defined in this header.
18 * OMA-TS-LightweightM2M_Core-V1_1_1-20190617-A
20 * @defgroup lwm2m_api LwM2M high-level API
46 /* clang-format off */
61 /* clang-format on */
73 /* clang-format off */
88 /* clang-format on */
97 typedef void (*lwm2m_socket_fault_cb_t)(int error);
105 uint8_t level; /**< Path level (0-4). Ex. 4 = resource instance. */
157 /** De-registration failure */
169 /** De-register */
185 typedef int (*lwm2m_set_sockopt_cb_t)(struct lwm2m_ctx *client_ctx);
241 int tls_tag;
255 int (*load_credentials)(struct lwm2m_ctx *client_ctx);
266 * Enabled via the use of coaps:// protocol prefix in connection
286 int sec_obj_inst;
289 int srv_obj_inst;
297 int sock_fd;
324 void (*set_socket_state)(int fd, enum lwm2m_socket_states state);
358 * The client or LwM2M objects can register a function of this type via:
365 * (typically 0 for non-multi instance resources).
382 * On a block-wise transfers the handler is called multiple times with the data blocks
386 * A function of this type can be registered via:
393 * (typically 0 for non-multi instance resources).
397 * block of data. For non-block transfers this is always
400 * For non-block transfers this is 0.
401 * @param[in] offset Offset of the data block. For non-block transfers this is always 0.
406 typedef int (*lwm2m_engine_set_data_cb_t)(uint16_t obj_inst_id,
414 * Various object instance and resource-based events in the LwM2M engine
415 * can trigger a callback of this function type: object instance create,
418 * Register a function of this type via:
427 typedef int (*lwm2m_engine_user_cb_t)(uint16_t obj_inst_id);
432 * Resource executes trigger a callback of this type.
434 * Register a function of this type via:
445 typedef int (*lwm2m_engine_execute_cb_t)(uint16_t obj_inst_id,
467 * An LwM2M client can register one of the following error codes via
486 * client can set one of the following codes via:
511 int lwm2m_device_add_err(uint8_t error_code);
544 * After processing a firmware update, the client sets the result via one of
545 * the following codes via lwm2m_set_u8("5/0/5", [result code])
685 int lwm2m_swmgmt_set_activate_cb(uint16_t obj_inst_id, lwm2m_engine_execute_cb_t cb);
698 int lwm2m_swmgmt_set_deactivate_cb(uint16_t obj_inst_id, lwm2m_engine_execute_cb_t cb);
711 int lwm2m_swmgmt_set_install_package_cb(uint16_t obj_inst_id, lwm2m_engine_execute_cb_t cb);
724 int lwm2m_swmgmt_set_delete_package_cb(uint16_t obj_inst_id, lwm2m_engine_execute_cb_t cb);
737 int lwm2m_swmgmt_set_read_package_version_cb(uint16_t obj_inst_id, lwm2m_engine_get_data_cb_t cb);
750 int lwm2m_swmgmt_set_write_package_cb(uint16_t obj_inst_id, lwm2m_engine_set_data_cb_t cb);
762 int lwm2m_swmgmt_install_completed(uint16_t obj_inst_id, int error_code);
807 int lwm2m_update_observer_min_period(struct lwm2m_ctx *client_ctx,
824 int lwm2m_update_observer_max_period(struct lwm2m_ctx *client_ctx,
830 * LwM2M clients use this function to create non-default LwM2M objects:
838 int lwm2m_create_object_inst(const struct lwm2m_obj_path *path);
849 int lwm2m_delete_object_inst(const struct lwm2m_obj_path *path);
855 * lwm2m main thread until all the write-operations are finished.
875 int lwm2m_set_opaque(const struct lwm2m_obj_path *path, const char *data_ptr, uint16_t data_len);
885 int lwm2m_set_string(const struct lwm2m_obj_path *path, const char *data_ptr);
895 int lwm2m_set_u8(const struct lwm2m_obj_path *path, uint8_t value);
905 int lwm2m_set_u16(const struct lwm2m_obj_path *path, uint16_t value);
915 int lwm2m_set_u32(const struct lwm2m_obj_path *path, uint32_t value);
925 int lwm2m_set_s8(const struct lwm2m_obj_path *path, int8_t value);
935 int lwm2m_set_s16(const struct lwm2m_obj_path *path, int16_t value);
945 int lwm2m_set_s32(const struct lwm2m_obj_path *path, int32_t value);
955 int lwm2m_set_s64(const struct lwm2m_obj_path *path, int64_t value);
965 int lwm2m_set_bool(const struct lwm2m_obj_path *path, bool value);
975 int lwm2m_set_f64(const struct lwm2m_obj_path *path, const double value);
985 int lwm2m_set_objlnk(const struct lwm2m_obj_path *path, const struct lwm2m_objlnk *value);
995 int lwm2m_set_time(const struct lwm2m_obj_path *path, time_t value);
1000 * Value type must match the target resource as no type conversion are
1015 * * STRING is char * and the null-terminator should be included in the size.
1016 * * OPAQUE is any binary data. When null-terminated string is written in OPAQUE
1025 /** Size of the value. For string resources, it should contain the null-terminator. */
1033 * does not do any type conversion.
1041 int lwm2m_set_bulk(const struct lwm2m_res_item res_list[], size_t res_list_size);
1052 int lwm2m_get_opaque(const struct lwm2m_obj_path *path, void *buf, uint16_t buflen);
1063 int lwm2m_get_string(const struct lwm2m_obj_path *path, void *str, uint16_t buflen);
1073 int lwm2m_get_u8(const struct lwm2m_obj_path *path, uint8_t *value);
1083 int lwm2m_get_u16(const struct lwm2m_obj_path *path, uint16_t *value);
1093 int lwm2m_get_u32(const struct lwm2m_obj_path *path, uint32_t *value);
1103 int lwm2m_get_s8(const struct lwm2m_obj_path *path, int8_t *value);
1113 int lwm2m_get_s16(const struct lwm2m_obj_path *path, int16_t *value);
1123 int lwm2m_get_s32(const struct lwm2m_obj_path *path, int32_t *value);
1133 int lwm2m_get_s64(const struct lwm2m_obj_path *path, int64_t *value);
1143 int lwm2m_get_bool(const struct lwm2m_obj_path *path, bool *value);
1153 int lwm2m_get_f64(const struct lwm2m_obj_path *path, double *value);
1163 int lwm2m_get_objlnk(const struct lwm2m_obj_path *path, struct lwm2m_objlnk *buf);
1173 int lwm2m_get_time(const struct lwm2m_obj_path *path, time_t *buf);
1193 int lwm2m_register_read_callback(const struct lwm2m_obj_path *path, lwm2m_engine_get_data_cb_t cb);
1196 * @brief Set resource (instance) pre-write callback
1203 * @param[in] cb Pre-write resource callback
1207 int lwm2m_register_pre_write_callback(const struct lwm2m_obj_path *path,
1230 int lwm2m_register_validate_callback(const struct lwm2m_obj_path *path,
1234 * @brief Set resource (instance) post-write callback
1239 * It allows an LwM2M client or object to post-process the value of a resource
1240 * or trigger other related resource calculations.
1243 * @param[in] cb Post-write resource callback
1247 int lwm2m_register_post_write_callback(const struct lwm2m_obj_path *path,
1260 int lwm2m_register_exec_callback(const struct lwm2m_obj_path *path, lwm2m_engine_execute_cb_t cb);
1272 int lwm2m_register_create_callback(uint16_t obj_id,
1285 int lwm2m_register_delete_callback(uint16_t obj_id,
1289 * @brief Resource read-only value bit
1294 * @brief Resource read-only flag
1301 #define LWM2M_HAS_RES_FLAG(res, f) ((res->data_flags & f) == f)
1313 * @param[in] data_flags Data buffer flags (such as read-only, etc)
1317 int lwm2m_set_res_buf(const struct lwm2m_obj_path *path, void *buffer_ptr, uint16_t buffer_len,
1330 int lwm2m_set_res_data_len(const struct lwm2m_obj_path *path, uint16_t data_len);
1347 * @param[out] data_flags Data buffer flags (such as read-only, etc)
1351 int lwm2m_get_res_buf(const struct lwm2m_obj_path *path, void **buffer_ptr, uint16_t *buffer_len,
1357 * LwM2M clients use this function to create multi-resource instances:
1365 int lwm2m_create_res_inst(const struct lwm2m_obj_path *path);
1376 int lwm2m_delete_res_inst(const struct lwm2m_obj_path *path);
1388 int lwm2m_update_device_service_period(uint32_t period_ms);
1397 * valid LwM2M-path.
1414 int lwm2m_engine_stop(struct lwm2m_ctx *client_ctx);
1427 int lwm2m_engine_start(struct lwm2m_ctx *client_ctx);
1469 * @return 0 for success, -EINPROGRESS when client is already running
1472 int lwm2m_rd_client_start(struct lwm2m_ctx *client_ctx, const char *ep_name,
1477 * @brief Stop the LwM2M RD (De-register) Client
1491 int lwm2m_rd_client_stop(struct lwm2m_ctx *client_ctx,
1503 int lwm2m_engine_pause(void);
1515 int lwm2m_engine_resume(void);
1518 * @brief Trigger a Registration Update of the LwM2M RD Client
1566 int lwm2m_send_cb(struct lwm2m_ctx *ctx, const struct lwm2m_obj_path path_list[],
1590 int lwm2m_enable_cache(const struct lwm2m_obj_path *path, struct lwm2m_time_series_elem *data_cache,
1597 LWM2M_SECURITY_PSK = 0, /**< Pre-Shared Key mode */
1610 * @return int Positive values are @ref lwm2m_security_mode_e, negative error codes otherwise.
1612 int lwm2m_security_mode(struct lwm2m_ctx *ctx);
1624 int lwm2m_set_default_sockopt(struct lwm2m_ctx *ctx);