pass address type instead of address to Message::create

This commit is contained in:
john30
2015-03-08 14:02:33 +01:00
parent 2faab3f3b4
commit 491b107635
2 changed files with 6 additions and 6 deletions
+4 -5
View File
@@ -165,9 +165,9 @@ void printErrorPos(vector<string>::iterator begin, const vector<string>::iterato
result_t DataField::create(vector<string>::iterator& it, result_t DataField::create(vector<string>::iterator& it,
const vector<string>::iterator end, const vector<string>::iterator end,
DataFieldTemplates* templates, DataFieldTemplates* templates, DataField*& returnField,
DataField*& returnField, const bool isWriteMessage, const bool isWriteMessage,
const unsigned char dstAddress) const bool isTemplate, const bool isBroadcastOrMasterDestination)
{ {
vector<SingleDataField*> fields; vector<SingleDataField*> fields;
string firstName, firstComment; string firstName, firstComment;
@@ -179,7 +179,6 @@ result_t DataField::create(vector<string>::iterator& it,
string unit, comment; string unit, comment;
PartType partType; PartType partType;
int divisor = 0; int divisor = 0;
const bool isTemplate = dstAddress == SYN;
bool hasPartStr = false; bool hasPartStr = false;
string token; string token;
@@ -199,7 +198,7 @@ result_t DataField::create(vector<string>::iterator& it,
result = RESULT_ERR_MISSING_TYPE; result = RESULT_ERR_MISSING_TYPE;
break; break;
} }
if (dstAddress == BROADCAST || isMaster(dstAddress) if (isBroadcastOrMasterDestination
|| (isWriteMessage && !hasPartStr) || (isWriteMessage && !hasPartStr)
|| strcasecmp(partStr, "M") == 0) { // master data || strcasecmp(partStr, "M") == 0) { // master data
partType = pt_masterData; partType = pt_masterData;
+2 -1
View File
@@ -160,7 +160,8 @@ public:
*/ */
static result_t create(vector<string>::iterator& it, const vector<string>::iterator end, static result_t create(vector<string>::iterator& it, const vector<string>::iterator end,
DataFieldTemplates* templates, DataField*& returnField, DataFieldTemplates* templates, DataField*& returnField,
const bool isWriteMessage=false, const unsigned char dstAddress=SYN); const bool isWriteMessage=false,
const bool isTemplate=true, const bool isBroadcastOrMasterDestination=false);
/** /**
* Dump the @a string optionally embedded in @a TEXT_SEPARATOR to the output. * Dump the @a string optionally embedded in @a TEXT_SEPARATOR to the output.