39 #ifndef COAP_TRANSACTIONS_H_
40 #define COAP_TRANSACTIONS_H_
48 #define COAP_RESPONSE_TIMEOUT_TICKS (CLOCK_SECOND * COAP_RESPONSE_TIMEOUT)
49 #define COAP_RESPONSE_TIMEOUT_BACKOFF_MASK (long)((CLOCK_SECOND * COAP_RESPONSE_TIMEOUT * ((float)COAP_RESPONSE_RANDOM_FACTOR - 1.0)) + 0.5) + 1
52 typedef struct coap_transaction {
53 struct coap_transaction *next;
56 struct etimer retrans_timer;
57 uint8_t retrans_counter;
62 restful_response_handler callback;
66 uint8_t packet[COAP_MAX_PACKET_SIZE + 1];
70 void coap_register_as_transaction_handler();
72 coap_transaction_t *coap_new_transaction(uint16_t mid, uip_ipaddr_t *addr,
74 void coap_send_transaction(coap_transaction_t *t);
75 void coap_clear_transaction(coap_transaction_t *t);
76 coap_transaction_t *coap_get_transaction_by_mid(uint16_t mid);
78 void coap_check_transactions();
An implementation of the Constrained Application Protocol (RFC).