Skip to content

Commit 0292600

Browse files
author
Arto Kinnunen
authored
Use callback function when deleting request (ARMmbed#109)
Use provided callback function when deleting request.
1 parent 1edc4a8 commit 0292600

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

source/coap_message_handler.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,10 @@ int8_t coap_message_handler_request_delete(coap_msg_handler_t *handle, int8_t se
586586
tr_error("response transaction not found");
587587
return -2;
588588
}
589+
590+
if (transaction_ptr->resp_cb) {
591+
transaction_ptr->resp_cb(transaction_ptr->service_id, transaction_ptr->remote_address, transaction_ptr->remote_port, NULL);
592+
}
589593
transaction_delete(transaction_ptr);
590594
return 0;
591595
}

test/coap-service/unittest/stub/coap_message_handler_stub.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ void transactions_delete_all(uint8_t *address_ptr, uint16_t port)
4040

4141
}
4242

43-
void transactions_delete_all_by_service_id(int8_t service_id)
44-
{
45-
}
46-
4743
int8_t coap_message_handler_destroy(coap_msg_handler_t *handle)
4844
{
4945
return coap_message_handler_stub.int8_value;

0 commit comments

Comments
 (0)