Skip to content

Commit

Permalink
Fix #15: initialize CoapPacket vars.
Browse files Browse the repository at this point in the history
  • Loading branch information
sesponda committed Mar 23, 2020
1 parent 1945070 commit cf7dd30
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions coap-simple.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,14 @@ class CoapOption {

class CoapPacket {
public:
uint8_t type;
uint8_t code;
uint8_t *token;
uint8_t tokenlen;
uint8_t *payload;
uint8_t payloadlen;
uint16_t messageid;

uint8_t optionnum;
uint8_t type = 0;
uint8_t code = 0;
uint8_t *token = NULL;
uint8_t tokenlen = 0;
uint8_t *payload = NULL;
uint8_t payloadlen = 0;
uint16_t messageid = 0;
uint8_t optionnum = 0;
CoapOption options[MAX_OPTION_NUM];

void addOption(uint8_t number, uint8_t length, uint8_t *opt_payload);
Expand Down

0 comments on commit cf7dd30

Please sign in to comment.