mesh: fix warnings without asserts

This commit is contained in:
Matthias Ringwald 2019-10-04 23:36:57 +02:00
parent 20cc5dae5d
commit d4e23df00f
2 changed files with 3 additions and 4 deletions

View File

@ -988,8 +988,7 @@ void mesh_network_send_pdu(mesh_network_pdu_t * network_pdu){
printf("^^ into network_pdus_queued\n");
#endif
uint8_t net_mic_len = network_pdu->data[1] & 0x80 ? 8 : 4;
btstack_assert((network_pdu->len + net_mic_len) <= 29);
btstack_assert((network_pdu->len + (network_pdu->data[1] & 0x80 ? 8 : 4)) <= 29);
btstack_assert(network_pdu->len >= 9);
// setup callback

View File

@ -1008,9 +1008,9 @@ void mesh_upper_transport_init(){
void mesh_upper_transport_send_access_pdu(mesh_pdu_t *pdu){
if (pdu->pdu_type == MESH_PDU_TYPE_NETWORK){
mesh_network_pdu_t * network_pdu = (mesh_network_pdu_t *) pdu;
btstack_assert(network_pdu->len >= 9);
btstack_assert(mesh_network_pdu_len((mesh_network_pdu_t *) pdu) >= 9);
}
btstack_linked_list_add_tail(&upper_transport_outgoing, (btstack_linked_item_t*) pdu);
mesh_upper_transport_run();
}