hex to int wip

This commit is contained in:
2021-02-25 15:53:28 +01:00
parent 5d24627c91
commit 4c09e973be
5 changed files with 37 additions and 4 deletions

2
etl

Submodule etl updated: 1ac3b77ef4...ae06e64177

2
fsfw

Submodule fsfw updated: e994d81e18...7d0916a44e

View File

@ -184,6 +184,19 @@ std::string SyrlinksHkHandler::convertIntToHexString(uint16_t intValue) {
return stream.str();
}
uint8_t SyrlinksHkHandler::convertHexStringToUint8(char* twoChars) {
uint8_t value;
std::string hexString(twoChars, 2);
std::stringstream stream;
stream << std::hex << hexString;
stream >> value;
return value;
}
uint16_t convertHexStringToUint16(char* fourChars) {
}
ReturnValue_t SyrlinksHkHandler::parseReplyStatus(const char* status) {
switch (*status) {
case '0':

View File

@ -80,12 +80,32 @@ private:
/**
* @brief This function converts an uint16_t into its hexadecimal string representation.
*
* @param The value to convert.
* @param intValue The value to convert.
*
* @return An std::string object containing the hex representation of intValue.
*/
std::string convertIntToHexString(uint16_t intValue);
/**
* @brief This function converts a hex number represented by to chars to an 8-bit integer.
*
* @param twoChars Pointer to the two characters representing the hex value.
*
* @details E.g. when twoChars points to an array with the two characters "A5" then the function
* will return 0xA5.
* @return The converted integer.
*/
uint8_t convertHexStringToUint8(char* twoChars);
/**
* @brief This function converts a hex number represented by 4 chars to an uint16_t.
*
* @param Pointer to the fourCharacters representing the 16-bit integer.
*
* @return The uint16_t result.
*/
uint16_t convertHexStringToUint16(char* fourChars);
/**
* @brief This function parses the status reply
* @param status Pointer to the status information.

2
tmtc

Submodule tmtc updated: 50c6752b32...1d5fe4ebc7