mesh: add mesh_network_pdu_set_seq

This commit is contained in:
Matthias Ringwald 2019-10-07 18:00:24 +02:00
parent b489fec06c
commit b7cd54c5a6
2 changed files with 7 additions and 0 deletions

View File

@ -1098,6 +1098,10 @@ uint8_t mesh_network_pdu_len(mesh_network_pdu_t * network_pdu){
return network_pdu->len - 9;
}
void mesh_network_pdu_set_seq(mesh_network_pdu_t * network_pdu, uint32_t seq){
big_endian_store_24(network_pdu->data, 2, seq);
}
static void mesh_network_dump_network_pdu(mesh_network_pdu_t * network_pdu){
if (network_pdu){
printf("- %p: ", network_pdu); printf_hexdump(network_pdu->data, network_pdu->len);

View File

@ -379,6 +379,9 @@ uint8_t mesh_network_control_opcode(mesh_network_pdu_t * network_pdu);
uint8_t * mesh_network_pdu_data(mesh_network_pdu_t * network_pdu);
uint8_t mesh_network_pdu_len(mesh_network_pdu_t * network_pdu);
// Mesh Network PDU Setter
void mesh_network_pdu_set_seq(mesh_network_pdu_t * network_pdu, uint32_t seq);
// Testing only
void mesh_network_received_message(const uint8_t * pdu_data, uint8_t pdu_len, uint8_t flags);
void mesh_network_process_proxy_configuration_message(const uint8_t * pdu_data, uint8_t pdu_len);