Zephyr Project API  3.4.0
A Scalable Open Source RTOS
dfd_srv.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
15#ifndef ZEPHYR_INCLUDE_BLUETOOTH_MESH_DFD_SRV_H__
16#define ZEPHYR_INCLUDE_BLUETOOTH_MESH_DFD_SRV_H__
17
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
28#ifndef CONFIG_BT_MESH_DFD_SRV_TARGETS_MAX
29#define CONFIG_BT_MESH_DFD_SRV_TARGETS_MAX 0
30#endif
31
32struct bt_mesh_dfd_srv;
33
38#define BT_MESH_DFD_SRV_INIT(_cb) \
39 { \
40 .cb = _cb, \
41 .dfu = BT_MESH_DFU_CLI_INIT(&_bt_mesh_dfd_srv_dfu_cb), \
42 .upload = { \
43 .blob = { .cb = &_bt_mesh_dfd_srv_blob_cb }, \
44 }, \
45 }
46
53#define BT_MESH_MODEL_DFD_SRV(_srv) \
54 BT_MESH_MODEL_DFU_CLI(&(_srv)->dfu), \
55 BT_MESH_MODEL_BLOB_SRV(&(_srv)->upload.blob), \
56 BT_MESH_MODEL_CB(BT_MESH_MODEL_ID_DFD_SRV, _bt_mesh_dfd_srv_op, NULL, \
57 _srv, &_bt_mesh_dfd_srv_cb)
58
61
74 int (*recv)(struct bt_mesh_dfd_srv *srv,
75 const struct bt_mesh_dfu_slot *slot,
76 const struct bt_mesh_blob_io **io);
77
87 void (*del)(struct bt_mesh_dfd_srv *srv,
88 const struct bt_mesh_dfu_slot *slot);
89
102 int (*send)(struct bt_mesh_dfd_srv *srv,
103 const struct bt_mesh_dfu_slot *slot,
104 const struct bt_mesh_blob_io **io);
105
113 void (*phase)(struct bt_mesh_dfd_srv *srv, enum bt_mesh_dfd_phase phase);
114};
115
118 const struct bt_mesh_dfd_srv_cb *cb;
123 const struct bt_mesh_blob_io *io;
126 bool apply;
129
130 struct {
132 const struct bt_mesh_dfu_slot *slot;
133 const struct flash_area *area;
136};
137
139extern const struct bt_mesh_model_op _bt_mesh_dfd_srv_op[];
140extern const struct bt_mesh_model_cb _bt_mesh_dfd_srv_cb;
141extern const struct bt_mesh_dfu_cli_cb _bt_mesh_dfd_srv_dfu_cb;
142extern const struct bt_mesh_blob_srv_cb _bt_mesh_dfd_srv_blob_cb;
145#ifdef __cplusplus
146}
147#endif
148
149#endif /* ZEPHYR_INCLUDE_BLUETOOTH_MESH_DFD_SRV_H__ */
150
Access layer APIs.
#define CONFIG_BT_MESH_DFD_SRV_TARGETS_MAX
Definition: dfd_srv.h:29
bt_mesh_dfd_upload_phase
Definition: dfd.h:100
bt_mesh_dfd_phase
Definition: dfd.h:73
__UINT16_TYPE__ uint16_t
Definition: stdint.h:89
Definition: blob_cli.h:104
Definition: blob.h:145
BLOB Transfer Server model event handlers.
Definition: blob_srv.h:51
BLOB Transfer Server instance.
Definition: blob_srv.h:131
Definition: blob_cli.h:40
Definition: dfd_srv.h:60
int(* recv)(struct bt_mesh_dfd_srv *srv, const struct bt_mesh_dfu_slot *slot, const struct bt_mesh_blob_io **io)
Slot receive callback.
Definition: dfd_srv.h:74
void(* del)(struct bt_mesh_dfd_srv *srv, const struct bt_mesh_dfu_slot *slot)
Slot delete callback.
Definition: dfd_srv.h:87
int(* send)(struct bt_mesh_dfd_srv *srv, const struct bt_mesh_dfu_slot *slot, const struct bt_mesh_blob_io **io)
Slot send callback.
Definition: dfd_srv.h:102
void(* phase)(struct bt_mesh_dfd_srv *srv, enum bt_mesh_dfd_phase phase)
Phase change callback (Optional).
Definition: dfd_srv.h:113
Definition: dfd_srv.h:117
struct bt_mesh_blob_target_pull pull_ctxs[0]
Definition: dfd_srv.h:122
struct bt_mesh_dfu_cli dfu
Definition: dfd_srv.h:120
enum bt_mesh_dfd_phase phase
Definition: dfd_srv.h:127
struct bt_mesh_blob_cli_inputs inputs
Definition: dfd_srv.h:128
const struct flash_area * area
Definition: dfd_srv.h:133
uint16_t target_cnt
Definition: dfd_srv.h:124
const struct bt_mesh_blob_io * io
Definition: dfd_srv.h:123
const struct bt_mesh_dfu_slot * slot
Definition: dfd_srv.h:132
const struct bt_mesh_dfd_srv_cb * cb
Definition: dfd_srv.h:118
struct bt_mesh_dfd_srv::@96 upload
enum bt_mesh_dfd_upload_phase phase
Definition: dfd_srv.h:131
struct bt_mesh_blob_srv blob
Definition: dfd_srv.h:134
struct bt_mesh_dfu_target targets[0]
Definition: dfd_srv.h:121
struct bt_mesh_model * mod
Definition: dfd_srv.h:119
bool apply
Definition: dfd_srv.h:126
uint16_t slot_idx
Definition: dfd_srv.h:125
Definition: dfu_cli.h:130
Definition: dfu_cli.h:184
Definition: dfu.h:155
Definition: dfu_cli.h:54
Definition: access.h:645
Definition: access.h:208
Definition: access.h:723
Flash partition.
Definition: flash_map.h:57