Azure IoT / azure_c_shared_utility

Dependents:   STM32F746_iothub_client_sample_mqtt f767zi_mqtt iothub_client_sample_amqp iothub_client_sample_http ... more

Revision:
0:fa2de1b79154
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wolfssl_connection.h	Fri Apr 08 12:01:36 2016 -0700
@@ -0,0 +1,32 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+#ifndef WOLFSSL_CONNECTION_H
+#define WOLFSSL_CONNECTION_H
+
+#include "wolfssl/ssl.h"
+#include "TCPSocketConnection.h"
+
+class WolfSSLConnection : public TCPSocketConnection
+{
+public:
+    WolfSSLConnection();
+    virtual ~WolfSSLConnection();
+    
+public:
+    int connect(const char* host, const int port);
+    bool is_connected(void);
+    int send(char* data, int length);
+    int send_all(char* data, int length);
+    int receive(char* data, int length);
+    int receive_all(char* data, int length);
+    bool close(bool shutdown = true);
+    bool load_certificate(const unsigned char* certificate, size_t size);
+    
+protected:
+    WOLFSSL_CTX* sslContext;
+    WOLFSSL* ssl;
+    bool isConnected;
+};
+
+#endif /* WOLFSSL_CONNECTION_H */