1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

nanocoap: introduce coap_get_method()

This commit is contained in:
Benjamin Valentin 2023-12-18 15:21:06 +01:00 committed by Benjamin Valentin
parent 5b2beea08a
commit 2e7cdfb345

View File

@ -499,6 +499,18 @@ static inline unsigned coap_get_code_raw(const coap_pkt_t *pkt)
return (unsigned)pkt->hdr->code;
}
/**
* @brief Get a request's method type
*
* @param[in] pkt CoAP request packet
*
* @returns request method type
*/
static inline coap_method_t coap_get_method(const coap_pkt_t *pkt)
{
return pkt->hdr->code;
}
/**
* @brief Get the message ID of the given CoAP packet
*