diff options
author | Brian Gix <brian.gix@intel.com> | 2020-03-18 10:00:20 -0700 |
---|---|---|
committer | Brian Gix <brian.gix@intel.com> | 2020-03-20 11:51:18 -0700 |
commit | e8c870c63b8f7f9f2e23ba3f5f3ad6b9adc1012e (patch) | |
tree | c5bb2e6f4b0a9c5d22a8c4e3cdf3c3dae7c85178 /mesh/net.h | |
parent | 40339fed960a891c1a91f5bf4b3e73d00a952070 (diff) | |
download | bluez-e8c870c63b8f7f9f2e23ba3f5f3ad6b9adc1012e.tar.gz |
mesh: Allow short messages to be segmented
For added reliability, it is legal to send short messages as "single
segment" segmented messages, which require transport layer
acknowledgement. This feature is intended for heavy usage in the future
so I am adding it now.
Further, to support this functionality, an additional queue has been
added to allow multiple SAR messages to the same DST to be queued and
sent serially.
Diffstat (limited to 'mesh/net.h')
-rw-r--r-- | mesh/net.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mesh/net.h b/mesh/net.h index 6fedd69d7..cb90c1d92 100644 --- a/mesh/net.h +++ b/mesh/net.h @@ -40,8 +40,9 @@ struct mesh_node; #define MAX_UNSEG_LEN 15 /* msg_len == 11 + sizeof(MIC) */ #define MAX_SEG_LEN 12 /* UnSeg length - 3 octets overhead */ -#define SEG_MAX(len) (((len) <= MAX_UNSEG_LEN) ? 0 : \ +#define SEG_MAX(seg, len) ((!seg && len <= MAX_UNSEG_LEN) ? 0 : \ (((len) - 1) / MAX_SEG_LEN)) + #define SEG_OFF(seg) ((seg) * MAX_SEG_LEN) #define MAX_SEG_TO_LEN(seg) ((seg) ? SEG_OFF((seg) + 1) : MAX_UNSEG_LEN) @@ -311,7 +312,8 @@ void mesh_net_transport_send(struct mesh_net *net, uint32_t key_id, bool mesh_net_app_send(struct mesh_net *net, bool frnd_cred, uint16_t src, uint16_t dst, uint8_t key_id, uint16_t net_idx, uint8_t ttl, uint32_t seq, uint32_t iv_index, - bool szmic, const void *msg, uint16_t msg_len, + bool segmented, bool szmic, + const void *msg, uint16_t msg_len, mesh_net_status_func_t status_func, void *user_data); void mesh_net_ack_send(struct mesh_net *net, uint32_t key_id, |