Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: EthernetInterface FXOS8700Q HTTPClient HTTPD MQTTS SDFileSystem YodiwoPlegma mbed-rpc mbed-rtos mbed wolfSSL
Diff: pairing_backend.cpp
- Revision:
- 3:11b767300d32
- Parent:
- 2:b7489c070d1f
- Child:
- 4:cc4c5b6d9730
--- a/pairing_backend.cpp Fri Sep 04 08:41:34 2015 +0000
+++ b/pairing_backend.cpp Tue Sep 15 14:43:15 2015 +0000
@@ -54,7 +54,7 @@
char* result = (char *)malloc(sizeof(char) * len);
if (!result)
return NULL;
- sprintf(result, "%s" PAGE_SERVER_PHASE2 "?token2=%s&noderedirect=%snext", ctx->postUrl, ctx->token2, nodeUrlBase);
+ sprintf(result, "%s" "1/" PAGE_SERVER_PHASE2 "?token2=%s&noderedirect=%snext", ctx->postUrl, ctx->token2, nodeUrlBase);
return result;
}
@@ -97,7 +97,7 @@
int __get_tokens(pairing_context *ctx)
{
strcpy(url, ctx->postUrl);
- strcat(url, "/gettokens");
+ strcat(url, "/1/gettokensreq");
http.dumpReqHeader(true);
http.dumpResHeader(true);
int ret;
@@ -122,12 +122,12 @@
map.put("uuid", ctx->uuid);
printf("\nTrying to post data...\n");
ret = http.post(url, map, &inText);
- Yodiwo_Plegma_PairingServerTokensResponse_t tokens;
+ Yodiwo_Plegma_NodePairing_PairingServerTokensResponse_t tokens;
if (!ret)
{
printf("Executed POST successfully - read %d characters\n", strlen(str));
printf("Result: %s\n", str);
- int jret = Yodiwo_Plegma_PairingServerTokensResponse_FromJson(str, strlen(str), &tokens);
+ int jret = Yodiwo_Plegma_NodePairing_PairingServerTokensResponse_FromJson(str, strlen(str), &tokens);
if (jret == Yodiwo_JsonSuccessParse) {
ctx->token1 = tokens.token1;
ctx->token2 = tokens.token2;
@@ -149,7 +149,7 @@
int __get_keys(pairing_context *ctx)
{
strcpy(url, ctx->postUrl);
- strcat(url, "/getkeys");
+ strcat(url, "/1/getkeysreq");
http.dumpReqHeader(true);
http.dumpResHeader(true);
int ret;
@@ -161,12 +161,12 @@
map.put("token1", ctx->token1);
printf("\nTrying to post data...\n");
ret = http.post(url, map, &inText);
- Yodiwo_Plegma_PairingServerKeysResponse_t keys;
+ Yodiwo_Plegma_NodePairing_PairingServerKeysResponse_t keys;
if (!ret)
{
printf("Executed POST successfully - read %d characters\n", strlen(str));
printf("Result: %s\n", str);
- int jret = Yodiwo_Plegma_PairingServerKeysResponse_FromJson(str, strlen(str), &keys);
+ int jret = Yodiwo_Plegma_NodePairing_PairingServerKeysResponse_FromJson(str, strlen(str), &keys);
if (jret == Yodiwo_JsonSuccessParse) {
ctx->nodeKey = keys.nodeKey;
ctx->secretKey = keys.secretKey;