[riot-notifications] [RIOT-OS/RIOT] pkg/wakaama: Add basic LWM2M client implementation (#11036)

Leandro Lanzieri notifications at github.com
Thu Jun 6 11:09:34 CEST 2019


leandrolanzieri commented on this pull request.



> +    char *uri;
+    char uri_buf[URI_LENGTH + 1];
+
+    memset(uri_buf, 0, sizeof(uri_buf));
+    DEBUG("Creating connection\n");
+    /* get the server URI from the requested instance */
+    uri = _get_uri_from_security_obj(client_data->obj_security, instance_id,
+                                     uri_buf, sizeof(uri_buf) - 1);
+
+    if (!uri) {
+        DEBUG("[_connection_create] Could not get URI of instance\n");
+        goto out;
+    }
+
+    /* parse the URI in the form "coaps://[host]:port" */
+    if (!strncmp(uri, SCHEME_COAPS, strlen(SCHEME_COAPS))) {

But I only need to check the first `strlen(SCHEME_COAPS)` characters of uri. I could replace this with `sizeof(SCHEME_COAPS)-1` though.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11036#discussion_r291088265
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190606/58f65023/attachment.html>


More information about the notifications mailing list