use constant for scan answer

This commit is contained in:
john30
2016-01-02 12:14:53 +01:00
parent a5ffaf89a2
commit da40d514af
2 changed files with 5 additions and 2 deletions
+4 -1
View File
@@ -33,6 +33,9 @@
using namespace std; using namespace std;
// the string used for answering to a scan request (07h 04h)
#define SCAN_ANSWER ("ebusd.eu;" PACKAGE_NAME ";" SCAN_VERSION ";100")
/** /**
* Return the string corresponding to the @a BusState. * Return the string corresponding to the @a BusState.
* @param state the @a BusState. * @param state the @a BusState.
@@ -630,7 +633,7 @@ result_t BusHandler::handleSymbol()
if (message == NULL || message->isWrite()) if (message == NULL || message->isWrite())
return setState(bs_skip, RESULT_ERR_INVALID_ARG); // don't know this request or definition has wrong direction, deny return setState(bs_skip, RESULT_ERR_INVALID_ARG); // don't know this request or definition has wrong direction, deny
if (message == m_messages->getScanMessage()) { if (message == m_messages->getScanMessage()) {
input.str("ebusd;ebusd;" SCAN_VERSION ";100"); input.str(SCAN_ANSWER);
} }
// build response and store in m_response for sending back to requesting master // build response and store in m_response for sending back to requesting master
+1 -1
View File
@@ -1306,7 +1306,7 @@ DataFieldSet* DataFieldSet::getIdentFields()
manufacturers[0xb5] = "Vaillant"; manufacturers[0xb5] = "Vaillant";
manufacturers[0xc0] = "Toby"; manufacturers[0xc0] = "Toby";
manufacturers[0xc5] = "Weishaupt"; manufacturers[0xc5] = "Weishaupt";
manufacturers[0xfd] = "ebusd"; manufacturers[0xfd] = "ebusd.eu";
vector<SingleDataField*> fields; vector<SingleDataField*> fields;
fields.push_back(new ValueListDataField("MF", "", "", uchDataType, pt_slaveData, 1, 8, manufacturers)); fields.push_back(new ValueListDataField("MF", "", "", uchDataType, pt_slaveData, 1, 8, manufacturers));
fields.push_back(new StringDataField("ID", "", "", stringDataType, pt_slaveData, 5)); fields.push_back(new StringDataField("ID", "", "", stringDataType, pt_slaveData, 5));