tried to support aliot again(untested)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
*
|
||||
* Filename: AliyunIoTSDK.cpp
|
||||
* Filename: aliyun_iot_sdk.cpp
|
||||
*
|
||||
* Description: basic SDK for ESP32
|
||||
*
|
||||
@@ -10,10 +10,11 @@
|
||||
*
|
||||
**/
|
||||
|
||||
#include "AliyunIoTSDK.h"
|
||||
#include <PubSubClient.h>
|
||||
#include <SHA256.h>
|
||||
|
||||
#include "aliyun_iot_sdk.h"
|
||||
|
||||
#define CHECK_INTERVAL 30000
|
||||
#define MESSAGE_BUFFER_SIZE 10
|
||||
#define MQTT_CONNECT_RETRY_MAX 3
|
||||
@@ -148,12 +149,12 @@ int AliyunIoTSDK::mqttCheckConnect() {
|
||||
return mqttStatus;
|
||||
}
|
||||
|
||||
int AliyunIoTSDK::begin(Client &espClient,
|
||||
int AliyunIoTSDK::begin(PubSubClient &mqttClient,
|
||||
const char *_productKey,
|
||||
const char *_deviceName,
|
||||
const char *_deviceSecret,
|
||||
const char *_region) {
|
||||
client = new PubSubClient(espClient);
|
||||
client = new PubSubClient(mqttClient);
|
||||
productKey = _productKey;
|
||||
deviceName = _deviceName;
|
||||
deviceSecret = _deviceSecret;
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
*
|
||||
* Filename: AliyunIoTSDK.h
|
||||
* Filename: aliyun_iot_sdk.h
|
||||
*
|
||||
* Description: header file of basic SDK for ESP32
|
||||
*
|
||||
@@ -58,13 +58,13 @@ public:
|
||||
|
||||
/**
|
||||
* Initialize and connect to AliyunIoT
|
||||
* @param espClient : WiFi client
|
||||
* @param mqttClient : PubSubClient
|
||||
* @param _productKey : AliyunIoT product key
|
||||
* @param _deviceName : AliyunIoT device name
|
||||
* @param _deviceSecret : AliyunIoT device secret
|
||||
* @param _region : AliyunIoT region
|
||||
*/
|
||||
static int begin(Client &espClient,
|
||||
static int begin(PubSubClient &mqttClient,
|
||||
const char *_productKey,
|
||||
const char *_deviceName,
|
||||
const char *_deviceSecret,
|
||||
Reference in New Issue
Block a user