Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: WidgetDB.cpp
- Revision:
- 1:67f91b0caa95
- Parent:
- 0:6a368cae1bdb
- Child:
- 2:5a7b822b54d7
--- a/WidgetDB.cpp Sat Aug 23 20:16:59 2014 +0000 +++ b/WidgetDB.cpp Wed Aug 27 20:29:53 2014 +0000 @@ -59,7 +59,7 @@ // lookup a widget and return its description char *WidgetDB::lookupWidgetDescription(int rfid) { WidgetEntry *entry = this->lookup(rfid); - if (entry != NULL) return entry->name; + if (entry != NULL) return entry->description; return NULL; } @@ -69,11 +69,17 @@ memset((void *)&(this->m_db[FIRST_WIDGET]),0,sizeof(WidgetEntry)); this->m_db[FIRST_WIDGET].rfid = FIRST_WIDGET_RFID; strncpy(this->m_db[FIRST_WIDGET].name,FIRST_WIDGET_NAME,min(strlen(FIRST_WIDGET_NAME),MAX_NAME_LENGTH)); - strncpy(this->m_db[FIRST_WIDGET].name,FIRST_WIDGET_DESCRIPTION,min(strlen(FIRST_WIDGET_DESCRIPTION),MAX_DESCRIPTION_LENGTH)); + strncpy(this->m_db[FIRST_WIDGET].description,FIRST_WIDGET_DESCRIPTION,min(strlen(FIRST_WIDGET_DESCRIPTION),MAX_DESCRIPTION_LENGTH)); // Second Widget memset((void *)&(this->m_db[SECOND_WIDGET]),0,sizeof(WidgetEntry)); this->m_db[SECOND_WIDGET].rfid = SECOND_WIDGET_RFID; strncpy(this->m_db[SECOND_WIDGET].name,SECOND_WIDGET_NAME,min(strlen(SECOND_WIDGET_NAME),MAX_NAME_LENGTH)); - strncpy(this->m_db[SECOND_WIDGET].name,SECOND_WIDGET_DESCRIPTION,min(strlen(SECOND_WIDGET_DESCRIPTION),MAX_DESCRIPTION_LENGTH)); + strncpy(this->m_db[SECOND_WIDGET].description,SECOND_WIDGET_DESCRIPTION,min(strlen(SECOND_WIDGET_DESCRIPTION),MAX_DESCRIPTION_LENGTH)); + + // Third Widget + memset((void *)&(this->m_db[THIRD_WIDGET]),0,sizeof(WidgetEntry)); + this->m_db[THIRD_WIDGET].rfid = THIRD_WIDGET_RFID; + strncpy(this->m_db[THIRD_WIDGET].name,THIRD_WIDGET_NAME,min(strlen(THIRD_WIDGET_NAME),MAX_NAME_LENGTH)); + strncpy(this->m_db[THIRD_WIDGET].description,THIRD_WIDGET_DESCRIPTION,min(strlen(THIRD_WIDGET_DESCRIPTION),MAX_DESCRIPTION_LENGTH)); } \ No newline at end of file