}
// Decodes a diameter message coming from a datablock
-void decodeDataBlock(const anna::DataBlock &db/*, unsigned int & detectedApplicationId*/) throw() {
+bool decodeDataBlock(const anna::DataBlock &db/*, unsigned int & detectedApplicationId*/) throw() {
try {
G_codecMsg.clear();
G_codecMsg.decode(db);
} catch(RuntimeException &ex) {
std::cerr << ex.asString() << std::endl << std::endl;
//_exit(ex.asString());
+ return false;
}
+
+ return true;
}
//-------------------------------------------------------------------
_exit("Error reading hex file provided");
// Decode datablock:
- decodeDataBlock(db_aux);
+ if (decodeDataBlock(db_aux)) {
- // Write conversion:
- std::string outputFile = entry + ".as.xml";
- std::ofstream out(outputFile.c_str(), std::ifstream::out);
- out << G_codecMsg.asXMLString();
- out.close();
+ // Write conversion:
+ std::string outputFile = entry + ".as.xml";
+ std::ofstream out(outputFile.c_str(), std::ifstream::out);
+ out << G_codecMsg.asXMLString();
+ out.close();
- anyHexConverted = true;
+ anyHexConverted = true;
+ }
}
}