Functions | |
unsigned | fwSpecs_convertHexToDec (string pHex) |
string | fwSpecs_convertDecToHex (unsigned pDec) |
dyn_char | fwSpecs_convertHexToByte (string pHex) |
string | fwSpecs_convertByteToHex (dyn_char pByte) |
unsigned | fwSpecs_convertBinToDec (string pBin) |
string | fwSpecs_convertDecToBin (unsigned pDec) |
bool | fwSpecs_isHex (string pHex) |
bool | fwSpecs_isBin (string pBin) |
dyn_char | fwSpecs_convertStringToByte (string pStr) |
unsigned fwSpecs_convertBinToDec | ( | string | pBin | ) |
This function converts an binary number to the corresponding decimal number.
[in] | pBin | binary number to be converted. |
(...) unsigned result; result = fwSpecs_convertBinToDec("101110101011"); // convert binary number '101110101011' to the corresponding decimal number DebugTN("Decimal: " + (string) result); // output the result of the conversion (...)
string fwSpecs_convertByteToHex | ( | dyn_char | pByte | ) |
This function converts byte(s) to the corresponding hexadecimal number.
[in] | pByte | byte(s) to be converted. |
(...) string result; result = fwSpecs_convertByteToHex(makeDynChar(41, 42, 43)); // convert bytes '41', '42' & '43', to the corresponding hexadecimal number DebugTN("Hexadecimal: " + result); // output the result of the conversion (...)
string fwSpecs_convertDecToBin | ( | unsigned | pDec | ) |
This function converts an decimal number to the corresponding binary number.
[in] | pDec | decimal number to be converted. |
(...) string result; result = fwSpecs_convertDecToBin(1127); // convert decimal number '1127' to the corresponding binary number DebugTN("Binary: " + result); // output the result of the conversion (...)
string fwSpecs_convertDecToHex | ( | unsigned | pDec | ) |
This function converts an decimal number to the corresponding hexadecimal number.
[in] | pDec | decimal number to be converted. |
(...) string result; result = fwSpecs_convertDecToHex(1127); // convert decimal number '1127' to the corresponding hexadecimal number DebugTN("Hexadecimal: " + result); // output the result of the conversion (...)
dyn_char fwSpecs_convertHexToByte | ( | string | pHex | ) |
This function converts an hexadecimal number to the corresponding byte(s).
[in] | pHex | hexadecimal number to be converted. |
(...) dyn_char result; result = fwSpecs_convertHexToByte("24e7d"); // convert hexadecimal number '24e7d' to the corresponding byte(s) DebugTN("Byte(s): " + result); // output the result of the conversion (...)
unsigned fwSpecs_convertHexToDec | ( | string | pHex | ) |
This function converts an hexadecimal number to the corresponding decimal number.
[in] | pHex | hexadecimal number to be converted. |
(...) unsigned result; result = fwSpecs_convertHexToDec("24e7d"); // convert hexadecimal number '24e7d' to the corresponding decimal number DebugTN("Decimal: " + (string) result); // output the result of the conversion (...)
dyn_char fwSpecs_convertStringToByte | ( | string | pStr | ) |
This function converts a string to the corresponding array of ASCII byte(s). Each byte is represented as a char. A byte stream is regularly used as input or output of the fwCcpc framework. (e.g. writing or reading memory blocks) When debugging in the PVSS PARA module you are prompted the ASCII representation of the byte value. The array starts with the most significant byte.
[in] | pStr | string to be converted. |
(...) dyn_char result; result = fwHw_convertStringToByte("this is a test"); // convert to ascii string representation DebugTN("Byte(s): " + result); // output the result of the conversion (...)
bool fwSpecs_isBin | ( | string | pBin | ) |
This function checks if the specified binary number is valid or not.
[in] | pBin | binary number. |
false the number is not a valid binary number.
(...) if (fwSpecs_isBin("1101011101")) // check if the binary number '1101011101' is valid DebugTN("The number is a valid binary number"); else DebugTN("The number is not a valid binary number"); (...)
bool fwSpecs_isHex | ( | string | pHex | ) |
This function checks if the specified hexadecimal number is valid or not.
[in] | pHex | hexadecimal number. |
false the number is not a valid hexadecimal number.
(...) if (fwSpecs_isHex("24e7d")) // check if the hexadecimal number '24e7d' is valid DebugTN("The number is a valid hexadecimal number"); else DebugTN("The number is not a valid hexadecimal number"); (...)