Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
header composition fix
  • Loading branch information
gioblu committed Aug 7, 2016
1 parent 1a7192c commit 3266cf3
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions PJON.h
Expand Up @@ -392,12 +392,10 @@ limitations under the License. */
uint8_t new_length = _shared ? (length + (_sender_info ? 9 : 4)) : (length + (_sender_info ? 1 : 0));

// Compose PJON 1 byte header from internal configuration
if(header == 0) {
header |= (_shared ? MODE_BIT : 0);
header |= (_sender_info ? SENDER_INFO_BIT : 0);
header |= (_acknowledge ? ACK_REQUEST_BIT : 0);
}

header |= (_shared ? MODE_BIT : 0);
header |= (_sender_info ? SENDER_INFO_BIT : 0);
header |= (_acknowledge ? ACK_REQUEST_BIT : 0);

if(new_length >= PACKET_MAX_LENGTH) {
_error(CONTENT_TOO_LONG, new_length);
return FAIL;
Expand Down

0 comments on commit 3266cf3

Please sign in to comment.