adjusted downlink messge handler framework

This commit is contained in:
strawmanbobi
2022-03-24 17:25:42 +08:00
parent 0ef02dcf4b
commit 3d34e57a4c
5 changed files with 11 additions and 4 deletions

View File

@@ -18,8 +18,8 @@ platform = espressif8266
framework = arduino
monitor_speed = 115200
upload_speed = 115200
upload_port = COM5
monitor_port = COM5
upload_port = COM6
monitor_port = COM6
board_build.flash_mode = dout
build_flags =
-Wno-unused-function

View File

@@ -153,6 +153,10 @@ void sendIrisKitHeartBeat() {
sendRawData(g_upstream_topic.c_str(), (uint8_t*) heartBeatMessage.c_str(), heartBeatMessage.length());
}
void handleIrisKitMessage(const char* data, int length) {
}
// private function definitions
static String buildConnect() {

View File

@@ -145,7 +145,6 @@ void setup() {
}
// TODO: fix the logic without settings loaded
INFOF("Wifi Connected, IRIS server = %s, credential token = %s\n",
iris_server_address, iris_credential_token);
@@ -201,7 +200,6 @@ void factoryReset() {
}
}
// private function defitions
static void wifiReset() {
DEBUGLN("Reset settings");

View File

@@ -106,4 +106,7 @@ static void registerCallback(const char* topic, int qos) {
static void irisAlinkCallback(const char *topic, uint8_t *data, int length) {
INFOF("IRIS downstream message : topic = %s, length = %d, data = %s\n", topic, length, (char*) data);
if (NULL != g_downstream_topic.c_str() && 0 == strcmp(topic, g_downstream_topic.c_str())) {
handleIrisKitMessage((const char*) data, length);
}
}

View File

@@ -51,4 +51,6 @@ void sendIrisKitConnect();
void sendIrisKitHeartBeat();
void handleIrisKitMessage(const char* data, int length);
#endif // IRBABY_IRIS_H