Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions src/LibTeleinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,13 @@ Input : Pointer to the label name
pointer to the value where we fill data
Output : pointer to the value where we filled data NULL is not found
====================================================================== */
char * TInfo::valueGet(char * name, char * value)
String TInfo::valueGet(String name)
{
char *Cname = const_cast<char*>(name.c_str());
return String(TInfo::valueGet(Cname));
}

char * TInfo::valueGet(char * name)
{
// Get our linked list
ValueList * me = &_valueslist;
Expand All @@ -469,10 +475,8 @@ char * TInfo::valueGet(char * name, char * value)
if (me->value) {
// Check back checksum
if (me->checksum == calcChecksum(me->name, me->value)) {
// copy to dest buffer
uint8_t lgvalue = strlen(me->value);
strncpy(value, me->value , lgvalue + 1 );
return ( value );
// return value
return ( me->value );
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/LibTeleinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ class TInfo
ValueList * addCustomValue(char * name, char * value, uint8_t * flags);
ValueList * getList(void);
uint8_t valuesDump(void);
char * valueGet(char * name, char * value);
char * valueGet(char * name);
String valueGet(String name);
char * valueGet_P(const char * name, char * value);
bool listDelete();
void clearStats();
Expand Down