examples: Remove references to sockaddr* structures

This means that apps need to have no knowledge of what IP support is available.

Updates coap_uri_into_options() and coap_resolve_address_info()
which have only been recently added to develop branch and are not in any
previous release.
This commit is contained in:
Jon Shallow authored and Jon Shallow committed 2023-06-09 12:04:09 +01:00
1 parent d4b9a53eed
commit 21bd1df95b
19 files changed
+220 -181

No files matched your search

@@ -106,7 +106,8 @@ resolve_address(const char *host, const char *service, coap_address_t *dst,
str_host.s = (const uint8_t *)host;
str_host.length = strlen(host);
addr_info = coap_resolve_address_info(&str_host, port, port, AF_UNSPEC,
scheme_hint_bits);
scheme_hint_bits,
COAP_RESOLVE_TYPE_REMOTE);
if (addr_info) {
ret = 1;
*dst = addr_info->addr;
@@ -212,7 +213,7 @@ client_coap_init(int argc, char **argv) {
goto fail;
}
len = coap_uri_into_options(&uri, &optlist, 1, buf, sizeof(buf));
len = coap_uri_into_options(&uri, &dst, &optlist, 1, buf, sizeof(buf));
if (len) {
coap_log_warn("Failed to create options\n");
goto fail;