summaryrefslogtreecommitdiff
path: root/mesh/model.h
diff options
context:
space:
mode:
authorBrian Gix <brian.gix@intel.com>2019-07-16 15:56:44 -0700
committerBrian Gix <brian.gix@intel.com>2019-07-18 09:49:21 -0700
commit060b3439f0c147309e097914df1ca351541b0495 (patch)
treedaae5b099ab13750f495e8e625ec95e5a5565f74 /mesh/model.h
parent8f0839a1c46300ceb1b129d17a3bff446ff79d08 (diff)
downloadbluez-060b3439f0c147309e097914df1ca351541b0495.tar.gz
mesh: Propagate Net Index up Rx message chain
When a model receives a message, it is required by the spec to respond using the same credentials. When an App Key is used, this is trivial because App keys are bound to Net keys, so only the App Index is required. Messages received on a Device key however, need the Net Index preserved from original message for re-use during the response.
Diffstat (limited to 'mesh/model.h')
-rw-r--r--mesh/model.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/mesh/model.h b/mesh/model.h
index a6951293f..fa031f598 100644
--- a/mesh/model.h
+++ b/mesh/model.h
@@ -67,7 +67,8 @@ struct mesh_model_pub {
typedef void (*mesh_model_unregister)(void *user_data);
typedef bool (*mesh_model_recv_cb)(uint16_t src, uint32_t dst, uint16_t unicast,
- uint16_t app_idx, const uint8_t *data,
+ uint16_t app_idx, uint16_t net_idx,
+ const uint8_t *data,
uint16_t len, uint8_t ttl,
const void *user_data);
typedef int (*mesh_model_bind_cb)(uint16_t app_idx, int action);
@@ -116,14 +117,15 @@ int mesh_model_sub_get(struct mesh_node *node, uint16_t addr, uint32_t id,
uint8_t *buf, uint16_t buf_size, uint16_t *size);
uint16_t mesh_model_cfg_blk(uint8_t *pkt);
bool mesh_model_send(struct mesh_node *node, uint16_t src, uint16_t dst,
- uint16_t app_idx, uint8_t ttl,
+ uint16_t app_idx, uint16_t net_idx,
+ uint8_t ttl,
const void *msg, uint16_t msg_len);
int mesh_model_publish(struct mesh_node *node, uint32_t mod_id, uint16_t src,
uint8_t ttl, const void *msg, uint16_t msg_len);
bool mesh_model_rx(struct mesh_node *node, bool szmict, uint32_t seq0,
uint32_t seq, uint32_t iv_index, uint8_t ttl,
- uint16_t src, uint16_t dst, uint8_t key_id,
- const uint8_t *data, uint16_t size);
+ uint16_t net_idx, uint16_t src, uint16_t dst,
+ uint8_t key_aid, const uint8_t *data, uint16_t size);
void mesh_model_app_key_generate_new(struct mesh_node *node, uint16_t net_idx);
void mesh_model_app_key_delete(struct mesh_node *node, struct l_queue *models,
uint16_t idx);