net: zoap: Remove magic number
Value 0xFF represents End Of Options marker in CoAP message. Use #define than magic numbers in code. Change-Id: I3bef21ea827987f7c2e670447ee20574cb6288ae Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
This commit is contained in:
parent
38503f8c76
commit
6740e691e8
1 changed files with 3 additions and 1 deletions
|
@ -21,6 +21,8 @@
|
|||
#include <net/zoap_link_format.h>
|
||||
|
||||
#define PKT_WAIT_TIME K_SECONDS(1)
|
||||
/* CoAP End Of Options Marker */
|
||||
#define COAP_MARKER 0xFF
|
||||
|
||||
static int format_uri(const char * const *path, struct net_buf *buf)
|
||||
{
|
||||
|
@ -348,7 +350,7 @@ int _zoap_well_known_core_get(struct zoap_resource *resource,
|
|||
if (!response.start) {
|
||||
temp = response.pkt->frags;
|
||||
str = net_buf_add(temp, 1);
|
||||
*str = 0xFF;
|
||||
*str = COAP_MARKER;
|
||||
response.start = str + 1;
|
||||
} else {
|
||||
temp = net_pkt_get_data(context, PKT_WAIT_TIME);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue