the push is modified as follows:

1. delete some junk files.
2. mqttclient added comments and updated to v1.0.2.
3. update README.md.
4. update the author's own server certificate.
5. minor changes to salof.
This commit is contained in:
jiejieTop
2020-03-21 21:47:08 +08:00
parent c0cb4460b7
commit 476e0dec02
43 changed files with 1100 additions and 15612 deletions

View File

@@ -2,19 +2,19 @@
* @Author: jiejie
* @Github: https://github.com/jiejieTop
* @Date: 2019-12-09 21:30:54
* @LastEditTime : 2020-01-14 03:38:15
* @LastEditTime: 2020-02-25 03:49:43
* @Description: the code belongs to jiejie, please keep the author information and source code according to the license.
*/
#include "platform_timer.h"
#include "platform_nettype_tcp.h"
#if MQTT_NETWORK_TYPE_TLS
#ifdef MQTT_NETWORK_TYPE_TLS
#include "platform_nettype_tls.h"
#endif
int network_read(network_t *n, unsigned char *buf, int len, int timeout)
{
#if MQTT_NETWORK_TYPE_TLS
#ifdef MQTT_NETWORK_TYPE_TLS
return platform_nettype_tls_read(n, buf, len, timeout);
#else
return platform_nettype_tcp_read(n, buf, len, timeout);
@@ -23,7 +23,7 @@ int network_read(network_t *n, unsigned char *buf, int len, int timeout)
int network_write(network_t *n, unsigned char *buf, int len, int timeout)
{
#if MQTT_NETWORK_TYPE_TLS
#ifdef MQTT_NETWORK_TYPE_TLS
return platform_nettype_tls_write(n, buf, len, timeout);
#else
return platform_nettype_tcp_write(n, buf, len, timeout);
@@ -32,7 +32,7 @@ int network_write(network_t *n, unsigned char *buf, int len, int timeout)
int network_connect(network_t *n)
{
#if MQTT_NETWORK_TYPE_TLS
#ifdef MQTT_NETWORK_TYPE_TLS
return platform_nettype_tls_connect(n);
#else
return platform_nettype_tcp_connect(n);
@@ -41,7 +41,7 @@ int network_connect(network_t *n)
void network_disconnect(network_t *n)
{
#if MQTT_NETWORK_TYPE_TLS
#ifdef MQTT_NETWORK_TYPE_TLS
platform_nettype_tls_disconnect(n);
#else
platform_nettype_tcp_disconnect(n);
@@ -61,7 +61,7 @@ int network_init(network_t* n, network_params_t* network_params)
n->network_params.addr = network_params->addr;
n->network_params.port = network_params->port;
#if MQTT_NETWORK_TYPE_TLS
#ifdef MQTT_NETWORK_TYPE_TLS
n->network_params.network_ssl_params.ca_crt = network_params->network_ssl_params.ca_crt;
n->network_params.network_ssl_params.ca_crt_len = strlen(n->network_params.network_ssl_params.ca_crt);
#if defined(MBEDTLS_FS_IO)