Original project changes: rename lawricel format to lawicel (openvehicles#728)

This commit is contained in:
Carsten Schmiemann 2022-10-03 12:29:40 +02:00
parent b5e18a4c0f
commit e6f2a6b992
2 changed files with 21 additions and 21 deletions

View File

@ -25,44 +25,44 @@
*/ */
#include "ovms_log.h" #include "ovms_log.h"
static const char *TAG = "canformat-lawricel"; static const char *TAG = "canformat-lawicel";
#include <errno.h> #include <errno.h>
#include "pcp.h" #include "pcp.h"
#include "canformat_lawricel.h" #include "canformat_lawicel.h"
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
// Initialisation and Registration // Initialisation and Registration
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
class OvmsCanFormatLawricelInit class OvmsCanFormatLawicelInit
{ {
public: OvmsCanFormatLawricelInit(); public: OvmsCanFormatLawicelInit();
} MyOvmsCanFormatLawricelTInit __attribute__ ((init_priority (4505))); } MyOvmsCanFormatLawicelTInit __attribute__ ((init_priority (4505)));
OvmsCanFormatLawricelInit::OvmsCanFormatLawricelInit() OvmsCanFormatLawicelInit::OvmsCanFormatLawicelInit()
{ {
ESP_LOGI(TAG, "Registering CAN Format: LAWRICEL (4505)"); ESP_LOGI(TAG, "Registering CAN Format: LAWICEL (4505)");
MyCanFormatFactory.RegisterCanFormat<canformat_lawricel>("lawricel"); MyCanFormatFactory.RegisterCanFormat<canformat_lawicel>("lawicel");
} }
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
// Base GVRET implementation (utility) // Base GVRET implementation (utility)
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
canformat_lawricel::canformat_lawricel(const char* type) canformat_lawicel::canformat_lawicel(const char* type)
: canformat(type) : canformat(type)
{ {
} }
canformat_lawricel::~canformat_lawricel() canformat_lawicel::~canformat_lawicel()
{ {
} }
std::string canformat_lawricel::get(CAN_log_message_t* message) std::string canformat_lawicel::get(CAN_log_message_t* message)
{ {
char buf[CANFORMAT_LAWRICEL_MAXLEN]; char buf[CANFORMAT_LAWICEL_MAXLEN];
if ((message->type != CAN_LogFrame_RX)&& if ((message->type != CAN_LogFrame_RX)&&
(message->type != CAN_LogFrame_TX)) (message->type != CAN_LogFrame_TX))
@ -87,12 +87,12 @@ std::string canformat_lawricel::get(CAN_log_message_t* message)
return std::string(buf); return std::string(buf);
} }
std::string canformat_lawricel::getheader(struct timeval *time) std::string canformat_lawicel::getheader(struct timeval *time)
{ {
return std::string(""); return std::string("");
} }
size_t canformat_lawricel::put(CAN_log_message_t* message, uint8_t *buffer, size_t len, bool* hasmore, canlogconnection* clc) size_t canformat_lawicel::put(CAN_log_message_t* message, uint8_t *buffer, size_t len, bool* hasmore, canlogconnection* clc)
{ {
if (m_buf.FreeSpace()==0) SetServeDiscarding(true); // Buffer full, so discard from now on if (m_buf.FreeSpace()==0) SetServeDiscarding(true); // Buffer full, so discard from now on
if (IsServeDiscarding()) return len; // Quick return if discarding if (IsServeDiscarding()) return len; // Quick return if discarding

View File

@ -24,18 +24,18 @@
; THE SOFTWARE. ; THE SOFTWARE.
*/ */
#ifndef __CANFORMAT_LAWRICEL_H__ #ifndef __CANFORMAT_LAWICEL_H__
#define __CANFORMAT_LAWRICEL_H__ #define __CANFORMAT_LAWICEL_H__
#include "canformat.h" #include "canformat.h"
#define CANFORMAT_LAWRICEL_MAXLEN 48 #define CANFORMAT_LAWICEL_MAXLEN 48
class canformat_lawricel : public canformat class canformat_lawicel : public canformat
{ {
public: public:
canformat_lawricel(const char* type); canformat_lawicel(const char* type);
virtual ~canformat_lawricel(); virtual ~canformat_lawicel();
public: public:
virtual std::string get(CAN_log_message_t* message); virtual std::string get(CAN_log_message_t* message);
@ -43,4 +43,4 @@ class canformat_lawricel : public canformat
virtual size_t put(CAN_log_message_t* message, uint8_t *buffer, size_t len, bool* hasmore, canlogconnection* clc=NULL); virtual size_t put(CAN_log_message_t* message, uint8_t *buffer, size_t len, bool* hasmore, canlogconnection* clc=NULL);
}; };
#endif // __CANFORMAT_LAWRICEL_H__ #endif // __CANFORMAT_LAWICEL_H__