Skip to content

Commit

Permalink
Merge pull request 1248#15 from 1248/revert-13-documentation_init_PR
Browse files Browse the repository at this point in the history
Revert "add comments to more complex structs"
  • Loading branch information
tobyjaffey committed Feb 25, 2015
2 parents e0cd1c7 + 2c575f8 commit e9d972a
Showing 1 changed file with 15 additions and 24 deletions.
39 changes: 15 additions & 24 deletions coap.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@ extern "C" {
//http://tools.ietf.org/html/rfc7252#section-3
typedef struct
{
uint8_t ver; /* CoAP version number */
coap_msgtype_t t; /* CoAP Message Type */
uint8_t tkl; /* Token length: indicates length of the Token field */
coap_responsecode_t code; /* CoAP status code. Can be request (0.xx), success reponse (2.xx),
* client error response (4.xx), or rever error response (5.xx)
* For possible values, see http://tools.ietf.org/html/rfc7252#section-12.1 */
uint8_t ver;
uint8_t t;
uint8_t tkl;
uint8_t code;
uint8_t id[2];
} coap_header_t;

Expand All @@ -37,18 +35,17 @@ typedef struct

typedef struct
{
uint8_t num; /* Option number. See http://tools.ietf.org/html/draft-ietf-core-coap-18#section-5.10 */
coap_buffer_t buf; /* Option value */
uint8_t num;
coap_buffer_t buf;
} coap_option_t;

typedef struct
{
coap_header_t hdr; /* Header of the packet */
coap_buffer_t tok; /* Token value, size as specified by hdr.tkl */
uint8_t numopts; /* Number of options */
coap_option_t opts[MAXOPT]; /* Options of the packet. For possible entries see
* http://tools.ietf.org/html/draft-ietf-core-coap-18#section-5.10 */
coap_buffer_t payload; /* Payload carried by the packet */
coap_header_t hdr;
coap_buffer_t tok;
uint8_t numopts;
coap_option_t opts[MAXOPT];
coap_buffer_t payload;
} coap_packet_t;

/////////////////////////////////////////
Expand Down Expand Up @@ -140,16 +137,10 @@ typedef struct

typedef struct
{
coap_method_t method; /* (i.e. POST, PUT or GET) */
coap_endpoint_func handler; /* callback function which handles this
* type of endpoint (and calls
* coap_make_response() at some point) */
const coap_endpoint_path_t *path; /* path towards a resource (i.e. foo/bar/) */
const char *core_attr; /* the 'ct' attribute, as defined in RFC7252, section 7.2.1.:
* "The Content-Format code "ct" attribute
* provides a hint about the
* Content-Formats this resource returns."
* (Section 12.3. lists possible ct values.) */
coap_method_t method;
coap_endpoint_func handler;
const coap_endpoint_path_t *path;
const char *core_attr;
} coap_endpoint_t;


Expand Down

0 comments on commit e9d972a

Please sign in to comment.