2023-11-15 21:10:42 +08:00
|
|
|
// Copyright (c) 2023 Cesanta Software Limited
|
|
|
|
// All rights reserved
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "mongoose.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef MQTT_DASHBOARD
|
|
|
|
#define MQTT_DASHBOARD 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define DEVICE_ID_LEN 10
|
2023-08-22 17:13:04 +08:00
|
|
|
#define MQTT_KEEP_ALIVE_INTERVAL 60
|
2023-11-15 21:10:42 +08:00
|
|
|
#define MQTT_SERVER_URL "mqtt://broker.hivemq.com:1883"
|
2023-08-22 17:13:04 +08:00
|
|
|
#define MQTT_ROOT_TOPIC "topic_mg_device"
|
2023-11-15 21:10:42 +08:00
|
|
|
|
|
|
|
extern char *g_url;
|
|
|
|
extern char *g_device_id;
|
|
|
|
extern char *g_root_topic;
|
|
|
|
|
|
|
|
void web_init(struct mg_mgr *mgr);
|
|
|
|
void web_destroy();
|
|
|
|
|
2023-08-22 17:13:04 +08:00
|
|
|
void hal_gpio_write(int pin, bool status);
|
|
|
|
bool hal_gpio_read(int pin);
|
2023-12-06 17:27:00 +08:00
|
|
|
|
2023-11-15 21:10:42 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|