Skip to content

Commit

Permalink
Fixed init value for remote variables
Browse files Browse the repository at this point in the history
  • Loading branch information
grodansparadis committed Jan 8, 2024
1 parent d078c8c commit a8c273a
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/vscp/common/mdf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,13 @@ CMDF_Value::~CMDF_Value()
CMDF_RemoteVariable::CMDF_RemoteVariable()
: CMDF_Object(mdf_type_remotevar)
{
m_strDefault.clear();
m_type = remote_variable_type_unknown;
m_page = 0;
m_offset = 0;
m_bitpos = 0;
m_size = 0;
m_access = MDF_REG_ACCESS_READ_WRITE;
m_strDefault = "UNDEF";
m_type = remote_variable_type_unknown;
m_page = 0;
m_offset = 0;
m_bitpos = 0;
m_size = 0;
m_access = MDF_REG_ACCESS_READ_WRITE;

m_bgcolor = 0xffffff;
m_fgcolor = 0x000000;
Expand All @@ -167,13 +167,13 @@ CMDF_RemoteVariable::~CMDF_RemoteVariable()
void
CMDF_RemoteVariable::clearStorage(void)
{
m_strDefault.clear();
m_type = remote_variable_type_unknown;
m_page = 0;
m_offset = 0;
m_bitpos = 0;
m_size = 0;
m_access = MDF_REG_ACCESS_READ_WRITE;
m_strDefault = "UNDEF";
m_type = remote_variable_type_unknown;
m_page = 0;
m_offset = 0;
m_bitpos = 0;
m_size = 0;
m_access = MDF_REG_ACCESS_READ_WRITE;

m_bgcolor = 0xffffff;
m_fgcolor = 0x000000;
Expand Down Expand Up @@ -6320,7 +6320,7 @@ CMDF::parseMDF_JSON(const std::string &path)
spdlog::debug("Parse-JSON: Remote variable default set to {}.", prvar->m_strDefault);
}
else {
prvar->m_strDefault = "";
prvar->m_strDefault = "UNDEF";
spdlog::debug("Parse-JSON: No remote variable default defined (set to empty).");
}

Expand Down Expand Up @@ -7730,7 +7730,7 @@ CMDF::getRemoteVariable(uint32_t offset, uint16_t page)
std::deque<CMDF_RemoteVariable *>::iterator iter;
for (iter = m_list_remotevar.begin(); iter != m_list_remotevar.end(); ++iter) {
CMDF_RemoteVariable *pvar = *iter;
if ((nullptr != pvar) && (page == pvar->getPage()) && (offset == pvar->getOffset()) ) {
if ((nullptr != pvar) && (page == pvar->getPage()) && (offset == pvar->getOffset())) {
return pvar;
}
}
Expand Down

0 comments on commit a8c273a

Please sign in to comment.