anjay
Loading...
Searching...
No Matches
sw_mgmt.h
Go to the documentation of this file.
1/*
2 * Copyright 2017-2026 AVSystem <avsystem@avsystem.com>
3 * AVSystem Anjay LwM2M SDK
4 * All rights reserved.
5 *
6 * Licensed under AVSystem Anjay LwM2M Client SDK - Non-Commercial License.
7 * See the attached LICENSE file for details.
8 */
9
10#ifndef ANJAY_INCLUDE_ANJAY_SW_MGMT_H
11#define ANJAY_INCLUDE_ANJAY_SW_MGMT_H
12
13#include <anjay/anjay_config.h>
14#include <anjay/dm.h>
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
39
50#define ANJAY_SW_MGMT_ERR_NOT_ENOUGH_SPACE \
51 (-(int) ANJAY_SW_MGMT_UPDATE_RESULT_NOT_ENOUGH_SPACE)
52#define ANJAY_SW_MGMT_ERR_OUT_OF_MEMORY \
53 (-(int) ANJAY_SW_MGMT_UPDATE_RESULT_OUT_OF_MEMORY)
54#define ANJAY_SW_MGMT_ERR_INTEGRITY_FAILURE \
55 (-(int) ANJAY_SW_MGMT_UPDATE_RESULT_INTEGRITY_FAILURE)
56#define ANJAY_SW_MGMT_ERR_UNSUPPORTED_PACKAGE_TYPE \
57 (-(int) ANJAY_SW_MGMT_UPDATE_RESULT_UNSUPPORTED_PACKAGE_TYPE)
120
144
171typedef int
172anjay_sw_mgmt_stream_open_t(void *obj_ctx, anjay_iid_t iid, void *inst_ctx);
173
201typedef int anjay_sw_mgmt_stream_write_t(void *obj_ctx,
202 anjay_iid_t iid,
203 void *inst_ctx,
204 const void *data,
205 size_t length);
206
240typedef int
241anjay_sw_mgmt_stream_finish_t(void *obj_ctx, anjay_iid_t iid, void *inst_ctx);
242
266typedef int
267anjay_sw_mgmt_check_integrity_t(void *obj_ctx, anjay_iid_t iid, void *inst_ctx);
268
289typedef void
290anjay_sw_mgmt_reset_t(void *obj_ctx, anjay_iid_t iid, void *inst_ctx);
291
322typedef const char *
323anjay_sw_mgmt_get_name_t(void *obj_ctx, anjay_iid_t iid, void *inst_ctx);
324
355typedef const char *
356anjay_sw_mgmt_get_version_t(void *obj_ctx, anjay_iid_t iid, void *inst_ctx);
357
401typedef int
402anjay_sw_mgmt_pkg_install_t(void *obj_ctx, anjay_iid_t iid, void *inst_ctx);
403
433typedef int
434anjay_sw_mgmt_pkg_uninstall_t(void *obj_ctx, anjay_iid_t iid, void *inst_ctx);
435
463typedef int anjay_sw_mgmt_prepare_for_update_t(void *obj_ctx,
464 anjay_iid_t iid,
465 void *inst_ctx);
466
498typedef int
499anjay_sw_mgmt_activate_t(void *obj_ctx, anjay_iid_t iid, void *inst_ctx);
500
532typedef int
533anjay_sw_mgmt_deactivate_t(void *obj_ctx, anjay_iid_t iid, void *inst_ctx);
534
535#ifdef ANJAY_WITH_DOWNLOADER
536
614typedef int
616 anjay_iid_t iid,
617 void *inst_ctx,
618 const char *download_uri,
619 anjay_security_config_t *out_security_info);
620
641typedef avs_coap_udp_tx_params_t
643 anjay_iid_t iid,
644 void *inst_ctx,
645 const char *download_uri);
646
671typedef avs_time_duration_t
673 anjay_iid_t iid,
674 void *inst_ctx,
675 const char *download_uri);
676
696
714
715#endif // ANJAY_WITH_DOWNLOADER
716
744typedef int anjay_sw_mgmt_add_handler_t(void *obj_ctx,
745 anjay_iid_t iid,
746 void **out_inst_ctx);
747
773typedef int
774anjay_sw_mgmt_remove_handler_t(void *obj_ctx, anjay_iid_t iid, void *inst_ctx);
775
845
850typedef struct {
858
863 void *obj_ctx;
864
865#if defined(ANJAY_WITH_DOWNLOADER)
872#endif // defined(ANJAY_WITH_DOWNLOADER)
874
897 const anjay_sw_mgmt_settings_t *settings);
898
918 anjay_iid_t iid,
919 bool *out_state);
920
946
979 anjay_t *anjay,
980 anjay_iid_t iid,
982
998 anjay_t *anjay,
999 const anjay_sw_mgmt_instance_initializer_t *instance_initializer);
1000
1029
1030#ifdef __cplusplus
1031}
1032#endif
1033
1034#endif /* ANJAY_INCLUDE_ANJAY_SW_MGMT_H */
uint16_t anjay_iid_t
Definition core.h:1299
struct anjay_struct anjay_t
Definition core.h:49
Definition core.h:2021
Definition sw_mgmt.h:776
anjay_sw_mgmt_stream_finish_t * stream_finish
Definition sw_mgmt.h:786
anjay_sw_mgmt_get_name_t * get_name
Definition sw_mgmt.h:798
anjay_sw_mgmt_pkg_uninstall_t * pkg_uninstall
Definition sw_mgmt.h:809
anjay_sw_mgmt_remove_handler_t * remove_handler
Definition sw_mgmt.h:843
anjay_sw_mgmt_get_version_t * get_version
Definition sw_mgmt.h:802
anjay_sw_mgmt_activate_t * activate
Definition sw_mgmt.h:816
anjay_sw_mgmt_pkg_install_t * pkg_install
Definition sw_mgmt.h:806
anjay_sw_mgmt_stream_open_t * stream_open
Definition sw_mgmt.h:779
anjay_sw_mgmt_get_tcp_request_timeout_t * get_tcp_request_timeout
Definition sw_mgmt.h:828
anjay_sw_mgmt_get_coap_tx_params_t * get_coap_tx_params
Definition sw_mgmt.h:833
anjay_sw_mgmt_get_security_config_t * get_security_config
Definition sw_mgmt.h:824
anjay_sw_mgmt_stream_write_t * stream_write
Definition sw_mgmt.h:783
anjay_sw_mgmt_deactivate_t * deactivate
Definition sw_mgmt.h:819
anjay_sw_mgmt_prepare_for_update_t * prepare_for_update
Definition sw_mgmt.h:813
anjay_sw_mgmt_reset_t * reset
Definition sw_mgmt.h:794
anjay_sw_mgmt_add_handler_t * add_handler
Definition sw_mgmt.h:839
anjay_sw_mgmt_check_integrity_t * check_integrity
Definition sw_mgmt.h:790
Definition sw_mgmt.h:125
anjay_iid_t iid
Definition sw_mgmt.h:137
void * inst_ctx
Definition sw_mgmt.h:142
anjay_sw_mgmt_initial_state_t initial_state
Definition sw_mgmt.h:130
Definition sw_mgmt.h:850
const anjay_sw_mgmt_handlers_t * handlers
Definition sw_mgmt.h:857
bool prefer_same_socket_downloads
Definition sw_mgmt.h:871
void * obj_ctx
Definition sw_mgmt.h:863
int anjay_sw_mgmt_install(anjay_t *anjay, const anjay_sw_mgmt_settings_t *settings)
anjay_sw_mgmt_initial_state_t
Definition sw_mgmt.h:64
@ ANJAY_SW_MGMT_INITIAL_STATE_INSTALLED_DEACTIVATED
Definition sw_mgmt.h:111
@ ANJAY_SW_MGMT_INITIAL_STATE_INSTALLING
Definition sw_mgmt.h:104
@ ANJAY_SW_MGMT_INITIAL_STATE_IDLE
Definition sw_mgmt.h:79
@ ANJAY_SW_MGMT_INITIAL_STATE_INSTALLED_ACTIVATED
Definition sw_mgmt.h:118
@ ANJAY_SW_MGMT_INITIAL_STATE_DELIVERED
Definition sw_mgmt.h:95
@ ANJAY_SW_MGMT_INITIAL_STATE_DOWNLOADED
Definition sw_mgmt.h:87
int anjay_sw_mgmt_deactivate_t(void *obj_ctx, anjay_iid_t iid, void *inst_ctx)
Definition sw_mgmt.h:533
int anjay_sw_mgmt_remove_handler_t(void *obj_ctx, anjay_iid_t iid, void *inst_ctx)
Definition sw_mgmt.h:774
int anjay_sw_mgmt_check_integrity_t(void *obj_ctx, anjay_iid_t iid, void *inst_ctx)
Definition sw_mgmt.h:267
anjay_sw_mgmt_update_result_t
Definition sw_mgmt.h:24
@ ANJAY_SW_MGMT_UPDATE_RESULT_UPDATE_ERROR
Definition sw_mgmt.h:35
@ ANJAY_SW_MGMT_UPDATE_RESULT_INSTALLATION_FAILURE
Definition sw_mgmt.h:36
@ ANJAY_SW_MGMT_UPDATE_RESULT_DOWNLOADED_VERIFIED
Definition sw_mgmt.h:28
@ ANJAY_SW_MGMT_UPDATE_RESULT_INSTALLED
Definition sw_mgmt.h:27
@ ANJAY_SW_MGMT_UPDATE_RESULT_CONNECTION_LOST
Definition sw_mgmt.h:31
@ ANJAY_SW_MGMT_UPDATE_RESULT_NOT_ENOUGH_SPACE
Definition sw_mgmt.h:29
@ ANJAY_SW_MGMT_UPDATE_RESULT_INVALID_URI
Definition sw_mgmt.h:34
@ ANJAY_SW_MGMT_UPDATE_RESULT_UNINSTALLATION_FAILURE
Definition sw_mgmt.h:37
@ ANJAY_SW_MGMT_UPDATE_RESULT_DOWNLOADING
Definition sw_mgmt.h:26
@ ANJAY_SW_MGMT_UPDATE_RESULT_OUT_OF_MEMORY
Definition sw_mgmt.h:30
@ ANJAY_SW_MGMT_UPDATE_RESULT_INTEGRITY_FAILURE
Definition sw_mgmt.h:32
@ ANJAY_SW_MGMT_UPDATE_RESULT_INITIAL
Definition sw_mgmt.h:25
@ ANJAY_SW_MGMT_UPDATE_RESULT_UNSUPPORTED_PACKAGE_TYPE
Definition sw_mgmt.h:33
int anjay_sw_mgmt_add_handler_t(void *obj_ctx, anjay_iid_t iid, void **out_inst_ctx)
Definition sw_mgmt.h:744
int anjay_sw_mgmt_prepare_for_update_t(void *obj_ctx, anjay_iid_t iid, void *inst_ctx)
Definition sw_mgmt.h:463
int anjay_sw_mgmt_stream_write_t(void *obj_ctx, anjay_iid_t iid, void *inst_ctx, const void *data, size_t length)
Definition sw_mgmt.h:201
avs_coap_udp_tx_params_t anjay_sw_mgmt_get_coap_tx_params_t(void *obj_ctx, anjay_iid_t iid, void *inst_ctx, const char *download_uri)
Definition sw_mgmt.h:642
int anjay_sw_mgmt_pkg_install_t(void *obj_ctx, anjay_iid_t iid, void *inst_ctx)
Definition sw_mgmt.h:402
const char * anjay_sw_mgmt_get_version_t(void *obj_ctx, anjay_iid_t iid, void *inst_ctx)
Definition sw_mgmt.h:356
int anjay_sw_mgmt_pull_reconnect(anjay_t *anjay)
int anjay_sw_mgmt_activate_t(void *obj_ctx, anjay_iid_t iid, void *inst_ctx)
Definition sw_mgmt.h:499
int anjay_sw_mgmt_add_instance(anjay_t *anjay, const anjay_sw_mgmt_instance_initializer_t *instance_initializer)
int anjay_sw_mgmt_remove_instance(anjay_t *anjay, anjay_iid_t iid)
int anjay_sw_mgmt_get_activation_state(anjay_t *anjay, anjay_iid_t iid, bool *out_state)
anjay_sw_mgmt_finish_pkg_install_result_t
Definition sw_mgmt.h:924
@ ANJAY_SW_MGMT_FINISH_PKG_INSTALL_SUCCESS_INACTIVE
Definition sw_mgmt.h:929
@ ANJAY_SW_MGMT_FINISH_PKG_INSTALL_SUCCESS_ACTIVE
Definition sw_mgmt.h:939
@ ANJAY_SW_MGMT_FINISH_PKG_INSTALL_FAILURE
Definition sw_mgmt.h:944
const char * anjay_sw_mgmt_get_name_t(void *obj_ctx, anjay_iid_t iid, void *inst_ctx)
Definition sw_mgmt.h:323
int anjay_sw_mgmt_stream_finish_t(void *obj_ctx, anjay_iid_t iid, void *inst_ctx)
Definition sw_mgmt.h:241
avs_time_duration_t anjay_sw_mgmt_get_tcp_request_timeout_t(void *obj_ctx, anjay_iid_t iid, void *inst_ctx, const char *download_uri)
Definition sw_mgmt.h:672
int anjay_sw_mgmt_stream_open_t(void *obj_ctx, anjay_iid_t iid, void *inst_ctx)
Definition sw_mgmt.h:172
int anjay_sw_mgmt_pkg_uninstall_t(void *obj_ctx, anjay_iid_t iid, void *inst_ctx)
Definition sw_mgmt.h:434
void anjay_sw_mgmt_reset_t(void *obj_ctx, anjay_iid_t iid, void *inst_ctx)
Definition sw_mgmt.h:290
int anjay_sw_mgmt_get_security_config_t(void *obj_ctx, anjay_iid_t iid, void *inst_ctx, const char *download_uri, anjay_security_config_t *out_security_info)
Definition sw_mgmt.h:615
void anjay_sw_mgmt_pull_suspend(anjay_t *anjay)
int anjay_sw_mgmt_finish_pkg_install(anjay_t *anjay, anjay_iid_t iid, anjay_sw_mgmt_finish_pkg_install_result_t pkg_install_result)