From b53cd3bd65d7656a27e7de8bd636ac70c85e4fd4 Mon Sep 17 00:00:00 2001 From: Milanka Ringwald Date: Fri, 7 Dec 2018 16:12:02 +0100 Subject: [PATCH] mesh: provide mesh_transport_seq_zero based on seq in transport_pdu --- test/mesh/mesh_transport.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/test/mesh/mesh_transport.c b/test/mesh/mesh_transport.c index 1fb19dee1..385e949fd 100644 --- a/test/mesh/mesh_transport.c +++ b/test/mesh/mesh_transport.c @@ -221,6 +221,9 @@ static uint16_t mesh_transport_ttl(mesh_transport_pdu_t * transport_pdu){ static uint32_t mesh_transport_seq(mesh_transport_pdu_t * transport_pdu){ return big_endian_read_24(transport_pdu->network_header, 2); } +static uint32_t mesh_transport_seq_zero(mesh_transport_pdu_t * transport_pdu){ + return big_endian_read_24(transport_pdu->network_header, 2) & 0x1fff; +} static uint16_t mesh_transport_src(mesh_transport_pdu_t * transport_pdu){ return big_endian_read_16(transport_pdu->network_header, 5); } @@ -593,11 +596,6 @@ static mesh_transport_pdu_t * mesh_transport_pdu_for_segmented_message(mesh_netw test_transport_pdu->netkey_index = network_pdu->netkey_index; test_transport_pdu->block_ack = 0; test_transport_pdu->acknowledgement_timer_active = 0; - - uint8_t * lower_transport_pdu = mesh_network_pdu_data(network_pdu); - uint16_t seg_zero = ( big_endian_read_16(lower_transport_pdu, 1) >> 2) & 0x1fff; - // TODO: reconstruct full seq auth - mesh_transport_set_seq(test_transport_pdu, seg_zero); printf("mesh_transport_pdu_for_segmented_message: setup transport pdu %p for src %x\n", test_transport_pdu, mesh_transport_src(test_transport_pdu)); } else { printf("mesh_transport_pdu_for_segmented_message: transport pdu %p already set up for src %x\n", test_transport_pdu, mesh_transport_src(test_transport_pdu));