Skip to content

Commit

Permalink
Change binary literal to hex literal
Browse files Browse the repository at this point in the history
This will fix a compile issue for compilers not supporting the binary literal extensions, as it is not standard C.
  • Loading branch information
Phillip Cao authored and niondir committed Mar 8, 2019
1 parent 4b68d6a commit 7f5fed4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/coap_message.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ CoAP_Result_t _rom CoAP_ParseMessageFromDatagram(uint8_t* srcArr, uint16_t srcAr
if (Version != COAP_VERSION)
return COAP_PARSE_UNKOWN_COAP_VERSION;

Msg.Type = (srcArr[0] & 0b110000) >> 4;
TokenLength = srcArr[0] & 0b1111;
Msg.Type = (srcArr[0] & 0x30) >> 4;
TokenLength = srcArr[0] & 0xF;
if (TokenLength > 8) {
INFO("CoAP-Parse Byte1 Error\r\n");
return COAP_PARSE_MESSAGE_FORMAT_ERROR;
Expand Down

0 comments on commit 7f5fed4

Please sign in to comment.