Zephyr API Documentation 4.0.99
A Scalable Open Source RTOS
|
MCUmgr SMP client API . More...
Data Structures | |
struct | smp_client_object |
SMP client object. More... | |
Typedefs | |
typedef int(* | smp_client_res_fn) (struct net_buf *nb, void *user_data) |
Response callback for SMP send. | |
Functions | |
int | smp_client_object_init (struct smp_client_object *smp_client, int smp_type) |
Initialize a SMP client object. | |
int | smp_client_single_response (struct net_buf *nb, const struct smp_hdr *res_hdr) |
SMP client response handler. | |
struct net_buf * | smp_client_buf_allocation (struct smp_client_object *smp_client, uint16_t group, uint8_t command_id, uint8_t op, enum smp_mcumgr_version_t version) |
Allocate buffer and initialize with SMP header. | |
void | smp_client_buf_free (struct net_buf *nb) |
Free a SMP client buffer. | |
int | smp_client_send_cmd (struct smp_client_object *smp_client, struct net_buf *nb, smp_client_res_fn cb, void *user_data, int timeout_in_sec) |
SMP client data send request. | |
MCUmgr SMP client API .
typedef int(* smp_client_res_fn) (struct net_buf *nb, void *user_data) |
#include <zephyr/mgmt/mcumgr/smp/smp_client.h>
Response callback for SMP send.
nb | net_buf for response |
user_data | same user data that was provided as part of the request |
struct net_buf * smp_client_buf_allocation | ( | struct smp_client_object * | smp_client, |
uint16_t | group, | ||
uint8_t | command_id, | ||
uint8_t | op, | ||
enum smp_mcumgr_version_t | version ) |
#include <zephyr/mgmt/mcumgr/smp/smp_client.h>
Allocate buffer and initialize with SMP header.
smp_client | SMP client object |
group | SMP group id |
command_id | SMP command id |
op | SMP operation type |
version | SMP MCUmgr version |
void smp_client_buf_free | ( | struct net_buf * | nb | ) |
#include <zephyr/mgmt/mcumgr/smp/smp_client.h>
Free a SMP client buffer.
nb | The net_buf to free. |
int smp_client_object_init | ( | struct smp_client_object * | smp_client, |
int | smp_type ) |
#include <zephyr/mgmt/mcumgr/smp/smp_client.h>
Initialize a SMP client object.
smp_client | The Client to construct. |
smp_type | SMP transport type for discovering transport object |
int smp_client_send_cmd | ( | struct smp_client_object * | smp_client, |
struct net_buf * | nb, | ||
smp_client_res_fn | cb, | ||
void * | user_data, | ||
int | timeout_in_sec ) |
#include <zephyr/mgmt/mcumgr/smp/smp_client.h>
SMP client data send request.
smp_client | SMP client object |
nb | net_buf packet for send |
cb | Callback for response handler |
user_data | user defined data pointer which will be returned back to response callback |
timeout_in_sec | Timeout in seconds for send process. Client will retry transport based CONFIG_SMP_CMD_RETRY_TIME |
int smp_client_single_response | ( | struct net_buf * | nb, |
const struct smp_hdr * | res_hdr ) |
#include <zephyr/mgmt/mcumgr/smp/smp_client.h>
SMP client response handler.
nb | response net_buf |
res_hdr | Parsed SMP header |