From 266ae8dc87431757318cfc6dccb7c49314ccb5c4 Mon Sep 17 00:00:00 2001 From: David Caloguerea Date: Fri, 18 Nov 2016 16:36:57 -0300 Subject: [PATCH 01/18] Update spark.json --- spark.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spark.json b/spark.json index 2aee707..c560012 100644 --- a/spark.json +++ b/spark.json @@ -1,5 +1,5 @@ { - "name": "httpsclient-particle", + "name": "httpsclient-particle-2", "author": "Vamsi Vytla", "license": "GPL", "version": "0.0.8", From 7acf91c743c6b15fdead7e513f15eda80c9e7c10 Mon Sep 17 00:00:00 2001 From: David Caloguerea Date: Fri, 18 Nov 2016 16:37:54 -0300 Subject: [PATCH 02/18] Update spark.json --- spark.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spark.json b/spark.json index c560012..2aee707 100644 --- a/spark.json +++ b/spark.json @@ -1,5 +1,5 @@ { - "name": "httpsclient-particle-2", + "name": "httpsclient-particle", "author": "Vamsi Vytla", "license": "GPL", "version": "0.0.8", From f4884a13da89c445f6758ba1d7d330b7dd351545 Mon Sep 17 00:00:00 2001 From: David Caloguerea Date: Mon, 21 Nov 2016 09:41:16 -0300 Subject: [PATCH 03/18] Update httpsclient-particle.h --- firmware/httpsclient-particle.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/firmware/httpsclient-particle.h b/firmware/httpsclient-particle.h index 58445bf..b1bd406 100644 --- a/firmware/httpsclient-particle.h +++ b/firmware/httpsclient-particle.h @@ -20,8 +20,10 @@ extern TCPClient client; extern bool g_https_complete; extern uint32 g_bytes_received; extern const bool g_https_trace; + +void (*callback_func) (char*, int); -int httpsclientSetup(const char * host, const char * path); +int httpsclientSetup(const char * host, const char * path, function callback_func); int httpsClientConnection(unsigned char * requestContent, uint32 msg_len, const char * msg); void httpsclientCleanUp(); From e6550ae0e9ae431656d8f96b26a45cc33801f344 Mon Sep 17 00:00:00 2001 From: David Caloguerea Date: Mon, 21 Nov 2016 09:45:01 -0300 Subject: [PATCH 04/18] Update httpsclient-particle.h --- firmware/httpsclient-particle.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firmware/httpsclient-particle.h b/firmware/httpsclient-particle.h index b1bd406..9069c2a 100644 --- a/firmware/httpsclient-particle.h +++ b/firmware/httpsclient-particle.h @@ -21,7 +21,7 @@ extern bool g_https_complete; extern uint32 g_bytes_received; extern const bool g_https_trace; -void (*callback_func) (char*, int); +void (*g_callback_func) (char*, int); int httpsclientSetup(const char * host, const char * path, function callback_func); int httpsClientConnection(unsigned char * requestContent, uint32 msg_len, From 54f75c1383db0a86e3a8dfe651c84d2a0b065276 Mon Sep 17 00:00:00 2001 From: David Caloguerea Date: Mon, 21 Nov 2016 09:45:51 -0300 Subject: [PATCH 05/18] Update httpsclient-particle.cpp --- firmware/httpsclient-particle.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/firmware/httpsclient-particle.cpp b/firmware/httpsclient-particle.cpp index c527dcb..2868a74 100644 --- a/firmware/httpsclient-particle.cpp +++ b/firmware/httpsclient-particle.cpp @@ -70,10 +70,11 @@ void httpsclientSetPath(const char * path) { g_path = path; } -int httpsclientSetup(const char * host, const char * path) { +int httpsclientSetup(const char * host, const char * path, function callback_func) { int rc; g_host = host; g_path = path; + g_callback_func = callback_func; if ((rc = matrixSslOpen()) < 0) { if (g_https_trace) _psTrace("MatrixSSL library init failure."); return rc; @@ -455,6 +456,7 @@ int httpsClientConnection(unsigned char * requestContent, uint32 msg_len, case MATRIXSSL_APP_DATA: case MATRIXSSL_APP_DATA_COMPRESSED: g_bytes_received += len; + g_callback_func(g_buf,len); if (g_https_trace) { for (int i = 0 ; i < len; i++) { Serial.print((char)g_buf[i]); From 8407a584cdf90048e488ea676071713e5fec32fd Mon Sep 17 00:00:00 2001 From: David Caloguerea Date: Mon, 21 Nov 2016 09:55:50 -0300 Subject: [PATCH 06/18] Update spark.json --- spark.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spark.json b/spark.json index 2aee707..a241da4 100644 --- a/spark.json +++ b/spark.json @@ -2,6 +2,6 @@ "name": "httpsclient-particle", "author": "Vamsi Vytla", "license": "GPL", - "version": "0.0.8", + "version": "0.0.9", "description": "A library that helps photon boards talk https to web servers" } From ffb130ed08d564685b38359d26a11fe49450fbaf Mon Sep 17 00:00:00 2001 From: David Caloguerea Date: Mon, 21 Nov 2016 10:00:00 -0300 Subject: [PATCH 07/18] Update httpsclient-particle.h --- firmware/httpsclient-particle.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/firmware/httpsclient-particle.h b/firmware/httpsclient-particle.h index 9069c2a..d0c6685 100644 --- a/firmware/httpsclient-particle.h +++ b/firmware/httpsclient-particle.h @@ -21,9 +21,10 @@ extern bool g_https_complete; extern uint32 g_bytes_received; extern const bool g_https_trace; -void (*g_callback_func) (char*, int); +typedef void (*callback_function)(char*, int); +callback_function g_callback_func; -int httpsclientSetup(const char * host, const char * path, function callback_func); +int httpsclientSetup(const char * host, const char * path, callback_function pFunc); int httpsClientConnection(unsigned char * requestContent, uint32 msg_len, const char * msg); void httpsclientCleanUp(); From a41184ad2f473edef1d2967c339c9f3ec6bb67f7 Mon Sep 17 00:00:00 2001 From: David Caloguerea Date: Mon, 21 Nov 2016 10:08:19 -0300 Subject: [PATCH 08/18] Update httpsclient-particle.cpp --- firmware/httpsclient-particle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firmware/httpsclient-particle.cpp b/firmware/httpsclient-particle.cpp index 2868a74..96d8520 100644 --- a/firmware/httpsclient-particle.cpp +++ b/firmware/httpsclient-particle.cpp @@ -456,7 +456,7 @@ int httpsClientConnection(unsigned char * requestContent, uint32 msg_len, case MATRIXSSL_APP_DATA: case MATRIXSSL_APP_DATA_COMPRESSED: g_bytes_received += len; - g_callback_func(g_buf,len); + (*g_callback_func)(g_buf,len); if (g_https_trace) { for (int i = 0 ; i < len; i++) { Serial.print((char)g_buf[i]); From 8d57e6b53235bf5c7798460abf76a8fde33e64cb Mon Sep 17 00:00:00 2001 From: David Caloguerea Date: Mon, 21 Nov 2016 10:17:22 -0300 Subject: [PATCH 09/18] Update httpsclient-particle.cpp --- firmware/httpsclient-particle.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/firmware/httpsclient-particle.cpp b/firmware/httpsclient-particle.cpp index 96d8520..6d0f4ec 100644 --- a/firmware/httpsclient-particle.cpp +++ b/firmware/httpsclient-particle.cpp @@ -70,11 +70,11 @@ void httpsclientSetPath(const char * path) { g_path = path; } -int httpsclientSetup(const char * host, const char * path, function callback_func) { +int httpsclientSetup(const char * host, const char * path, callback_func pFunc) { int rc; g_host = host; g_path = path; - g_callback_func = callback_func; + g_callback_func = pFunc; if ((rc = matrixSslOpen()) < 0) { if (g_https_trace) _psTrace("MatrixSSL library init failure."); return rc; From a4229886ac1fc60e0b6ff45f534df2130f7ba0ff Mon Sep 17 00:00:00 2001 From: David Caloguerea Date: Mon, 21 Nov 2016 10:22:44 -0300 Subject: [PATCH 10/18] Update httpsclient-particle.h --- firmware/httpsclient-particle.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firmware/httpsclient-particle.h b/firmware/httpsclient-particle.h index d0c6685..0971462 100644 --- a/firmware/httpsclient-particle.h +++ b/firmware/httpsclient-particle.h @@ -21,7 +21,7 @@ extern bool g_https_complete; extern uint32 g_bytes_received; extern const bool g_https_trace; -typedef void (*callback_function)(char*, int); +typedef void (*callback_function)(unsigned char*, int); callback_function g_callback_func; int httpsclientSetup(const char * host, const char * path, callback_function pFunc); From 18e9f6d9f088848de0a19a83938c8c0ab1a7eabe Mon Sep 17 00:00:00 2001 From: David Caloguerea Date: Mon, 21 Nov 2016 10:30:56 -0300 Subject: [PATCH 11/18] Update httpsclient-particle.cpp --- firmware/httpsclient-particle.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/firmware/httpsclient-particle.cpp b/firmware/httpsclient-particle.cpp index 6d0f4ec..8a200a5 100644 --- a/firmware/httpsclient-particle.cpp +++ b/firmware/httpsclient-particle.cpp @@ -70,6 +70,7 @@ void httpsclientSetPath(const char * path) { g_path = path; } +typedef void (*callback_function)(unsigned char*, int); int httpsclientSetup(const char * host, const char * path, callback_func pFunc) { int rc; g_host = host; From 2868cc69a93a6a8796ab128acb3de1966c5d0337 Mon Sep 17 00:00:00 2001 From: David Caloguerea Date: Mon, 21 Nov 2016 10:33:35 -0300 Subject: [PATCH 12/18] Update httpsclient-particle.cpp --- firmware/httpsclient-particle.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/firmware/httpsclient-particle.cpp b/firmware/httpsclient-particle.cpp index 8a200a5..8761be0 100644 --- a/firmware/httpsclient-particle.cpp +++ b/firmware/httpsclient-particle.cpp @@ -70,8 +70,7 @@ void httpsclientSetPath(const char * path) { g_path = path; } -typedef void (*callback_function)(unsigned char*, int); -int httpsclientSetup(const char * host, const char * path, callback_func pFunc) { +int httpsclientSetup(const char * host, const char * path, void (*pFunc)(unsigned char*, int)) { int rc; g_host = host; g_path = path; From 4337f83f61cb11c92717bc8b29036097030d96b1 Mon Sep 17 00:00:00 2001 From: David Caloguerea Date: Mon, 21 Nov 2016 10:35:22 -0300 Subject: [PATCH 13/18] Update httpsclient-particle.h --- firmware/httpsclient-particle.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firmware/httpsclient-particle.h b/firmware/httpsclient-particle.h index 0971462..b044152 100644 --- a/firmware/httpsclient-particle.h +++ b/firmware/httpsclient-particle.h @@ -22,7 +22,7 @@ extern uint32 g_bytes_received; extern const bool g_https_trace; typedef void (*callback_function)(unsigned char*, int); -callback_function g_callback_func; +callback_function g_weatherCallback_func; int httpsclientSetup(const char * host, const char * path, callback_function pFunc); int httpsClientConnection(unsigned char * requestContent, uint32 msg_len, From 67801f9bed094088b76cdd3051aa848e6a0e9c52 Mon Sep 17 00:00:00 2001 From: David Caloguerea Date: Mon, 21 Nov 2016 10:35:48 -0300 Subject: [PATCH 14/18] Update httpsclient-particle.cpp --- firmware/httpsclient-particle.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/firmware/httpsclient-particle.cpp b/firmware/httpsclient-particle.cpp index 8761be0..65f1bae 100644 --- a/firmware/httpsclient-particle.cpp +++ b/firmware/httpsclient-particle.cpp @@ -74,7 +74,7 @@ int httpsclientSetup(const char * host, const char * path, void (*pFunc)(unsigne int rc; g_host = host; g_path = path; - g_callback_func = pFunc; + g_weatherCallback_func = pFunc; if ((rc = matrixSslOpen()) < 0) { if (g_https_trace) _psTrace("MatrixSSL library init failure."); return rc; @@ -456,7 +456,7 @@ int httpsClientConnection(unsigned char * requestContent, uint32 msg_len, case MATRIXSSL_APP_DATA: case MATRIXSSL_APP_DATA_COMPRESSED: g_bytes_received += len; - (*g_callback_func)(g_buf,len); + (*g_weatherCallback_func)(g_buf,len); if (g_https_trace) { for (int i = 0 ; i < len; i++) { Serial.print((char)g_buf[i]); From 6882ac64abd373602580279fb355fedfb9967b81 Mon Sep 17 00:00:00 2001 From: David Caloguerea Date: Mon, 21 Nov 2016 10:42:58 -0300 Subject: [PATCH 15/18] Update httpsclient-particle.h --- firmware/httpsclient-particle.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/firmware/httpsclient-particle.h b/firmware/httpsclient-particle.h index b044152..5e3232b 100644 --- a/firmware/httpsclient-particle.h +++ b/firmware/httpsclient-particle.h @@ -1,3 +1,5 @@ +#ifndef HTTPSCLIENT_PARTICLE +#define HTTPSCLIENT_PARTICLE #pragma once #include "application.h" @@ -33,3 +35,4 @@ void httpsclientSetPath(const char * path); #ifdef __cplusplus } #endif +#endif From 6f244af20059d2fe46dbc9c2ee15797ca5a6430d Mon Sep 17 00:00:00 2001 From: David Caloguerea Date: Mon, 21 Nov 2016 10:47:05 -0300 Subject: [PATCH 16/18] Update httpsclient-particle.h --- firmware/httpsclient-particle.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firmware/httpsclient-particle.h b/firmware/httpsclient-particle.h index 5e3232b..61fc448 100644 --- a/firmware/httpsclient-particle.h +++ b/firmware/httpsclient-particle.h @@ -24,7 +24,7 @@ extern uint32 g_bytes_received; extern const bool g_https_trace; typedef void (*callback_function)(unsigned char*, int); -callback_function g_weatherCallback_func; +extern callback_function g_weatherCallback_func; int httpsclientSetup(const char * host, const char * path, callback_function pFunc); int httpsClientConnection(unsigned char * requestContent, uint32 msg_len, From 397a069deec13bf447dbb59a2647d63911319542 Mon Sep 17 00:00:00 2001 From: David Caloguerea Date: Mon, 21 Nov 2016 10:49:14 -0300 Subject: [PATCH 17/18] Update httpsclient-particle.h --- firmware/httpsclient-particle.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/firmware/httpsclient-particle.h b/firmware/httpsclient-particle.h index 61fc448..f39f930 100644 --- a/firmware/httpsclient-particle.h +++ b/firmware/httpsclient-particle.h @@ -1,5 +1,3 @@ -#ifndef HTTPSCLIENT_PARTICLE -#define HTTPSCLIENT_PARTICLE #pragma once #include "application.h" @@ -35,4 +33,3 @@ void httpsclientSetPath(const char * path); #ifdef __cplusplus } #endif -#endif From 6f8798d0ed673db13ca19a55db4420ddfc747c42 Mon Sep 17 00:00:00 2001 From: David Caloguerea Date: Mon, 21 Nov 2016 11:21:33 -0300 Subject: [PATCH 18/18] Update httpsclient-particle.cpp --- firmware/httpsclient-particle.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/firmware/httpsclient-particle.cpp b/firmware/httpsclient-particle.cpp index 65f1bae..cf9932c 100644 --- a/firmware/httpsclient-particle.cpp +++ b/firmware/httpsclient-particle.cpp @@ -70,6 +70,8 @@ void httpsclientSetPath(const char * path) { g_path = path; } +void (*g_weatherCallback_func)(unsigned char*, int); + int httpsclientSetup(const char * host, const char * path, void (*pFunc)(unsigned char*, int)) { int rc; g_host = host;