-
Notifications
You must be signed in to change notification settings - Fork 2.1k
cord/endpoint: Full rewrite of CoRE RD endpoint module #20040
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
base: master
Are you sure you want to change the base?
Conversation
This is a full rewrite of the CORD module to improve reliability, mainly by continuing registration attempts if the server for some reason stops responding.
a56c3d6
to
0780cf3
Compare
0780cf3
to
dbe7cf0
Compare
Flash usage for |
Might be relevant: #18633 |
#endif | ||
|
||
#ifndef MODULE_CORD_ENDPOINT | ||
static const char wkrd[] = "/.well-known/rd"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static const char wkrd[] = "/.well-known/rd"; | |
static const char wellknown_rd[] = "/.well-known/rd"; |
static const char wkrd[] = "/.well-known/rd"; | ||
#endif | ||
|
||
int _pkt_add_qstring(coap_pkt_t *pkt) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is your reasoning for "string" in the function name?
int _pkt_add_qstring(coap_pkt_t *pkt) | |
int _pkt_add_uri_query(coap_pkt_t *pkt) |
|
||
int _pkt_add_qstring(coap_pkt_t *pkt) | ||
{ | ||
/* extend the url with some query string options */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, why is this done?
/* extend the url with some query string options */ | |
/* extend the url with a 'key=value' query option: 'ep=cord_endpoint_name' */ |
|
||
/* [optional] set the lifetime parameter */ | ||
#if CONFIG_CORD_LT | ||
char lt[11]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, is 11 always long enough? Are there constraints on the lifetime (by the rfc, etc.)? Are they enforced at buildtime?
char lt[11]; | |
char lifetime[11]; |
{ | ||
#ifndef CONFIG_CORD_ENDPOINT | ||
if (cord_endpoint_name[0] == '\0') { | ||
uint8_t luid[CORD_ENDPOINT_SUFFIX_LEN / 2]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whats luid
?
uint8_t luid[CORD_ENDPOINT_SUFFIX_LEN / 2]; | ||
|
||
if (PREFIX_LEN > 1) { | ||
memcpy(cord_endpoint_name, CORD_ENDPOINT_PREFIX, (PREFIX_LEN - 1)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this memcpy
is safe as cord_endpoint_name
has different size depending on the compilation settings?
return 0; | ||
} | ||
|
||
void _init_epname(void) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
void _init_epname(void) | |
/* Generate a locally unique endpoint name */ | |
void _init_epname(void) |
{ | ||
(void)cord; | ||
#ifdef MODULE_CORD_ENDPOINT | ||
memset(cord->rd_regif, 0, CORD_URI_MAX); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either this or the check in line 139 is wrong?
memset(cord->rd_regif, 0, CORD_URI_MAX); | |
memset(cord->rd_regif, 0, sizeof(cord->rd_regif)); |
} | ||
return 0; | ||
} | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#endif | |
#endif /* MODULE_CORD_ENDPOINT */ |
* @file | ||
* @brief Standalone extension for the CoRE RD endpoint implementation | ||
* | ||
* @author Hauke Petersen <[email protected]> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your name?
Ping? The release is coming up... |
Contribution description
This PR is an almost full rewrite of the CORD endpoint module in RIOT. Changes:
Testing procedure
The example modules and shell module have been adapted to work with the new module
Issues/PRs references
None