anjay
sim_bootstrap.h
Go to the documentation of this file.
1 /*
2  * Copyright 2017-2024 AVSystem <avsystem@avsystem.com>
3  * AVSystem Anjay LwM2M SDK
4  * All rights reserved.
5  *
6  * Licensed under the AVSystem-5-clause License.
7  * See the attached LICENSE file for details.
8  */
9 #ifndef ANJAY_INCLUDE_ANJAY_SIM_BOOTSTRAP_H
10 #define ANJAY_INCLUDE_ANJAY_SIM_BOOTSTRAP_H
11 
12 #include <avsystem/commons/avs_stream.h>
13 #include <avsystem/commons/avs_stream_md5.h>
14 
15 #include <anjay/bootstrapper.h>
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 #ifdef ANJAY_WITH_MODULE_SIM_BOOTSTRAP
22 
63  const void *cmd,
64  size_t cmd_length,
65  void *out_buf,
66  size_t out_buf_size,
67  size_t *out_response_size);
68 
85  anjay_sim_bootstrap_perform_command_cb_t *perform_command_cb,
86  void *perform_command_cb_arg);
87 
114 static inline avs_error_t anjay_sim_bootstrap_perform(
115  anjay_t *anjay,
116  anjay_sim_bootstrap_perform_command_cb_t *perform_command_cb,
117  void *perform_command_cb_arg) {
118  avs_error_t err = avs_errno(AVS_EIO);
119  avs_stream_t *stream =
120  anjay_sim_bootstrap_stream_create(perform_command_cb,
121  perform_command_cb_arg);
122  if (stream) {
123  err = anjay_bootstrapper(anjay, stream);
124  avs_stream_cleanup(&stream);
125  }
126  return err;
127 }
128 
141 avs_error_t
143  uint8_t (*md5)[AVS_COMMONS_MD5_LENGTH]);
144 
145 #endif // ANJAY_WITH_MODULE_SIM_BOOTSTRAP
146 
147 #ifdef __cplusplus
148 }
149 #endif
150 
151 #endif /* ANJAY_INCLUDE_ANJAY_SIM_BOOTSTRAP_H */
avs_error_t anjay_bootstrapper(anjay_t *anjay, avs_stream_t *data_stream)
struct anjay_struct anjay_t
Definition: core.h:45
int anjay_sim_bootstrap_perform_command_cb_t(void *arg, const void *cmd, size_t cmd_length, void *out_buf, size_t out_buf_size, size_t *out_response_size)
Definition: sim_bootstrap.h:62
avs_stream_t * anjay_sim_bootstrap_stream_create(anjay_sim_bootstrap_perform_command_cb_t *perform_command_cb, void *perform_command_cb_arg)
static avs_error_t anjay_sim_bootstrap_perform(anjay_t *anjay, anjay_sim_bootstrap_perform_command_cb_t *perform_command_cb, void *perform_command_cb_arg)
Definition: sim_bootstrap.h:114
avs_error_t anjay_sim_bootstrap_calculate_md5(avs_stream_t *stream, uint8_t(*md5)[AVS_COMMONS_MD5_LENGTH])