Skip to content
Snippets Groups Projects
Commit 45c99ff9 authored by Legy (Beini)'s avatar Legy (Beini) Committed by Jens Nolte
Browse files

Move qthing includes to their own dir and clean up

parent 87b6589e
No related branches found
No related tags found
1 merge request!16Merge dev branch into master
Showing
with 108 additions and 33 deletions
......@@ -10,4 +10,4 @@ sdkconfig.old
# This directory contains user-specific environment configurations
/environments/*
# Ignore symlink to current environment
/qthing/environment.h
/qthing/include/environment.h
......@@ -17,9 +17,9 @@ function link_environment {
else
TARGET="../$1"
fi
echo "Linking qthing/environment.h to $TARGET"
ln -snf "$TARGET" "qthing/environment.h"
touch --no-create "qthing/environment.h"
echo "Linking qthing/include/environment.h to $TARGET"
ln -snf "$TARGET" "qthing/include/environment.h"
touch --no-create "qthing/include/environment.h"
}
if [[ -z "$1" ]]; then
......
......@@ -6,8 +6,7 @@ idf_component_register(
"system"
INCLUDE_DIRS
"."
"network"
"include"
REQUIRES
ESP32-Digital-RGB-LED-Drivers
......
#include <qthing.hpp>
#include "qthing_legacy.hpp"
#include <cmath>
namespace qthing {
......
#include <qthing.hpp>
#include "qthing_legacy.hpp"
#include "event.hpp"
namespace qthing {
......
#ifndef DEVICE_H
#define DEVICE_H
#pragma once
void device_main();
#endif
\ No newline at end of file
#ifndef EVENT_H
#define EVENT_H
#pragma once
#include <qthing.hpp>
#include "qthing_legacy.hpp"
#include <string>
#include <functional>
namespace qthing {
#ifndef QTHING_HIDE_PRIVATE_API
using string_callback_t = std::function<void(const std::string&)>;
void set_oled_log_callback(string_callback_t callback);
......@@ -18,6 +19,6 @@ void update_eth_connection_status(connection_status_t status);
void update_mqtt_connection_status(connection_status_t status);
}
#endif
}
#pragma once
#include "qthing.hpp"
#include "qthing_legacy.hpp"
#include <stdint.h>
#include <string>
......@@ -10,8 +10,12 @@
namespace qthing {
#ifndef QTHING_HIDE_PRIVATE_API
void gpio_init_input(gpio_num_t gpio_num);
void gpio_init_output(gpio_num_t gpio_num, uint32_t level);
void pulse_relay(gpio_num_t gpio_off);
#endif
}
......@@ -7,4 +7,4 @@
#include "esp32_digital_led_lib.h"
#include <qthing.hpp>
#include "qthing_legacy.hpp"
......@@ -13,6 +13,8 @@
namespace qthing {
#ifndef QTHING_HIDE_PRIVATE_API
namespace measured {
typedef struct {
......@@ -55,4 +57,7 @@ namespace qthing {
void mqtt(const std::vector<qthing::measured::sensor_data_t>& data);
}
}
#endif
}
#ifndef MQTT_H
#define MQTT_H
#pragma once
#include <qthing.hpp>
#include "qthing_legacy.hpp"
#include <string>
#include <functional>
namespace qthing {
void mqtt_client_start();
#ifndef QTHING_HIDE_PRIVATE_API
}
void mqtt_client_start();
#endif
}
// Include as extern "C"
#ifndef MQTT_C_H
#define MQTT_C_H
#pragma once
#include "mqtt_client.h"
#ifndef QTHING_HIDE_PRIVATE_API
esp_mqtt_client_handle_t mqtt_client_start_c(mqtt_event_callback_t mqtt_event_handler);
#endif
\ No newline at end of file
#endif
#ifndef MQTT_COMMON_H
#define MQTT_COMMON_H
#pragma once
#include "environment.h"
#include "device_config.h"
......@@ -20,5 +19,3 @@
#define OTA_PROGRESS_TOPIC DEVICE_NAMESPACE "ota/progress"
#define OTA_STATE_TOPIC DEVICE_NAMESPACE "ota/state"
#define OTA_ERROR_TOPIC DEVICE_NAMESPACE "ota/error"
#endif
#ifndef MQTT_OTA_H
#define MQTT_OTA_H
#include <qthing.hpp>
#pragma once
#include "qthing_legacy.hpp"
namespace qthing {
#ifndef QTHING_HIDE_PRIVATE_API
void handle_ota_message(const multipart_message_t& message);
void add_ota_event_callback(ota_event_callback_t handler);
}
#endif
}
#pragma once
namespace qthing {
void enable_wifi();
connection_status_t get_wifi_connection_status();
void add_wifi_connection_status_callback(connection_status_callback_t callback);
void add_combined_mqtt_connection_status_callback(connection_status_callback_t handler);
void enable_ethernet_lan8720();
connection_status_t get_eth_connection_status();
void add_eth_connection_status_callback(connection_status_callback_t callback);
connection_status_t get_network_connection_status();
void add_network_connection_status_callback(connection_status_callback_t callback);
#ifndef QTHING_HIDE_PRIVATE_API
void start_network_clients();
void initialize_network();
#endif
}
#ifndef QTHING_HIDE_PRIVATE_API
#include "Arduino.h"
const uint8_t wifi_connected_symbol[] PROGMEM = {
......@@ -101,3 +103,4 @@ const uint8_t other_symbol[] PROGMEM = {
B00000000
};
#endif
#pragma once
#include <string>
#include <sstream>
#ifndef QTHING_HIDE_PRIVATE_API
template <typename T>
std::string to_string(T value)
{
......@@ -8,3 +12,5 @@ std::string to_string(T value)
os << value ;
return os.str() ;
}
#endif
......@@ -2,7 +2,6 @@
namespace qthing {
void start_network_clients();
void initialize_network();
void power_managment_max_power();
}
#pragma once
#define QTHING_HIDE_PRIVATE_API
#include "qthing_legacy.hpp"
#include "network.hpp"
#include "power.hpp"
#include "util.hpp"
#undef QTHING_HIDE_PRIVATE_API
#pragma once
#define QTHING_HIDE_PRIVATE_API
#include "qthing_legacy.hpp"
#include "network.hpp"
#include "power.hpp"
#include "util.hpp"
#undef QTHING_HIDE_PRIVATE_API
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment