91 lines
2.9 KiB
C++
91 lines
2.9 KiB
C++
// --------------------------------------------------------------------------------------------------------------------
|
|
/// \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;
|
|
}
|