Parser BHB to JSON: /******************************************************************************************************/ BHBtoJson(BHB, BHBversion, sha1_ref, callback) { - BHBtoJson : ... callback(error, jsonObj); } This function will parse the BHB buffer into a JSON object. /******************************************************************************************************/ - BHBCheckIntegrity : This function will check the integrity of the BHB: corrent length, header and CRC. Input : BHB buffer. Output: - return true if all previous parameters are OK. - return false if one of them are corrupted. BHBCheckIntegrity: function(BHB) { ... return false/true; } /******************************************************************************************************/ - needToClean : This function will check if the input BHB buffer need to be cleaned because of inconvenient parameters. Input : BHB buffer. Output: - return false if no clean is needed. - return true if we need to clean it. needToClean(BHB) { ... return false/true; } /******************************************************************************************************/ - BHBCleaner : This function will clean the previous inconvenient parameters. Input : BHB buffer. Output : BHB buffer Cleaned! BHBCleaner(BHB) { ... return cleanBHB; } /******************************************************************************************************/ - getNotes : Return the notes of the input BHB buffer. /******************************************************************************************************/ - getMcuType : Return the MCU type of the input BHB buffer. (410, 420, 421, 430, 431) /******************************************************************************************************/