OpenDTU-old/include
Bernhard Kirchen c7098b6c42
Fix: thread-safety and dynamic memory for MessageOutput (#567)
this commit re-introduces the changes from #418, which were effectively
reverted with d49481097 (merge commit introducing TaskScheduler).

these adjustments are important to guarantee unmangled log messages and
more importantly, to guarantee that all messages from a particular
component are printed to the web console, which most people use to copy
messages from when reporting issues.

* use dynamic memory to allow handling of arbitrary message lenghts.
* keep a message buffer for every task so no task ever mangles the
  message of another task.
* every complete line is written to the serial console and moved to
  a line buffer for sending them through the websocket.
* the websocket is always fed complete lines.
* make sure to feed only as many lines as possible to the websocket
  handler, so that no lines are dropped.
* lock all MessageOutput state against concurrent access.
* respect HardwareSerial buffer size: the MessageOutput class buffers
  whole lines of output printed by any task in order to avoid mangling
  of text. that means we hand over full lines to the HardwareSerial
  instance, which might be too much in one call to write(buffer, size).
  we now check the return value of write(buffer, size) and call the
  function again with the part of the message that could not yet be
  written by HardwareSerial.
2023-12-30 16:45:56 +01:00
..
Battery.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
BatteryStats.h Feature: JK BMS: export (more) data to live view and MQTT (#549) 2023-12-15 10:59:07 +01:00
Configuration.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
Datastore.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
defaults.h Merge remote-tracking branch 'tbnobody/OpenDTU/master' into development 2023-12-27 13:11:25 +01:00
Display_Graphic_Diagram.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
Display_Graphic.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
helper.h Change License to GPLv2 as the RF24 lib uses GPL-2.0-only 2022-07-15 18:05:58 +02:00
HttpPowerMeter.h fix: #438 2023-09-18 17:56:22 +02:00
Huawei_can.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
InverterSettings.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
JkBmsController.h Support for Jikong JK BMS using serial connection (#319) 2023-08-31 16:21:32 +02:00
JkBmsDataPoints.h Feature: JK BMS: export (more) data to live view and MQTT (#549) 2023-12-15 10:59:07 +01:00
JkBmsSerialMessage.h Support for Jikong JK BMS using serial connection (#319) 2023-08-31 16:21:32 +02:00
Led_Single.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
MessageOutput.h Fix: thread-safety and dynamic memory for MessageOutput (#567) 2023-12-30 16:45:56 +01:00
MqttHandleDtu.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
MqttHandleHass.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
MqttHandleHuawei.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
MqttHandleInverter.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
MqttHandleInverterTotal.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
MqttHandlePowerLimiter.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
MqttHandlePylontechHass.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
MqttHandleVedirect.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
MqttHandleVedirectHass.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
MqttSettings.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
NetworkSettings.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
NtpSettings.h Cleanup includes 2022-12-14 22:13:03 +01:00
PinMapping.h Merge remote-tracking branch 'tbnobody/OpenDTU/master' into development 2023-12-27 13:11:25 +01:00
PowerLimiter.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
PowerMeter.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
PylontechCanReceiver.h Support for Jikong JK BMS using serial connection (#319) 2023-08-31 16:21:32 +02:00
README Initial commit 2022-04-09 11:05:14 +02:00
Scheduler.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
SunPosition.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
Utils.h Move different restart calls into one method 2023-08-25 12:58:53 +02:00
VictronMppt.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
VictronSmartShunt.h Integration of Victron SmartShunt via VE.Direct (#452) 2023-09-22 17:24:57 +02:00
WebApi_battery.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
WebApi_config.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
WebApi_device.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
WebApi_devinfo.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
WebApi_dtu.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
WebApi_errors.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
WebApi_eventlog.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
WebApi_firmware.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
WebApi_gridprofile.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
WebApi_Huawei.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
WebApi_inverter.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
WebApi_limit.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
WebApi_maintenance.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
WebApi_mqtt.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
WebApi_network.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
WebApi_ntp.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
WebApi_power.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
WebApi_powerlimiter.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
WebApi_powermeter.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
WebApi_prometheus.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
WebApi_security.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
WebApi_sysstatus.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
WebApi_vedirect.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
WebApi_webapp.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
WebApi_ws_battery.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
WebApi_ws_console.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
WebApi_ws_Huawei.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
WebApi_ws_live.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
WebApi_ws_vedirect_live.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00
WebApi.h merge V23.12.16 (#556) 2023-12-27 11:49:57 +01:00

This directory is intended for project header files.

A header file is a file containing C declarations and macro definitions
to be shared between several project source files. You request the use of a
header file in your project source file (C, C++, etc) located in `src` folder
by including it, with the C preprocessing directive `#include'.

```src/main.c

#include "header.h"

int main (void)
{
 ...
}
```

Including a header file produces the same results as copying the header file
into each source file that needs it. Such copying would be time-consuming
and error-prone. With a header file, the related declarations appear
in only one place. If they need to be changed, they can be changed in one
place, and programs that include the header file will automatically use the
new version when next recompiled. The header file eliminates the labor of
finding and changing all the copies as well as the risk that a failure to
find one copy will result in inconsistencies within a program.

In C, the usual convention is to give header files names that end with `.h'.
It is most portable to use only letters, digits, dashes, and underscores in
header file names, and at most one dot.

Read more about using header files in official GCC documentation:

* Include Syntax
* Include Operation
* Once-Only Headers
* Computed Includes

https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html