Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change binary literal to hex literal #37

Merged
merged 1 commit into from
Mar 8, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Change binary literal to hex literal
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 Mar 7, 2019
commit 0e3957ff0a4bfa4ede93bb6cb6e8a58ab99def85
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