Added ESP console logger as serial interface

This commit is contained in:
2024-03-23 12:32:14 +01:00
parent 55c3ebbbe4
commit ec05cfd9b6
7 changed files with 296 additions and 77 deletions
+90
View File
@@ -0,0 +1,90 @@
// --------------------------------------------------------------------------------------------------------------------
/// \file esplog.cpp
/// \brief Description
// --------------------------------------------------------------------------------------------------------------------
//
// vbchaos software design
//
// --------------------------------------------------------------------------------------------------------------------
/// $Revision: $
/// $Author: $
/// $Date: $
// (c) 2023 vbchaos
// --------------------------------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------------
// Include files
// --------------------------------------------------------------------------------------------------------------------
#include "esplog.h"
#include "esp_log.h"
// --------------------------------------------------------------------------------------------------------------------
// Constant and macro definitions
// --------------------------------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------------
// Type definitions
// --------------------------------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------------
// File-scope variables
// --------------------------------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------------
// Function declarations
// --------------------------------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------------
// Function definitions
// --------------------------------------------------------------------------------------------------------------------
esplog::esplog()
{
this->status = CLOSED;
}
esplog::~esplog()
{
}
FunctionStatus esplog::write(uint8_t deviceAddress, uint8_t registerAddress, uint8_t* buffer, uint32_t length)
{
FunctionStatus returnValue = FUNCTION_STATUS_OK;
if (status == OPEN)
{
ESP_LOGI("", "%s", buffer);
}
else
{
returnValue = FUNCTION_STATUS_NOT_OPEN;
}
return returnValue;
}
FunctionStatus esplog::read(uint8_t deviceAddress, uint8_t registerAddress, uint8_t* buffer, uint32_t length, uint32_t* actualLength)
{
FunctionStatus returnValue = FUNCTION_STATUS_OK;
if (status == OPEN)
{
// Do Stuff
}
else
{
returnValue = FUNCTION_STATUS_NOT_OPEN;
}
return returnValue;
}