30
RevertRawByteOrder(RawBytes)
{
RawSize = sizeof(RawBytes);
RevertRaw = RawBytes;
RevertRaw[RawSize - 1] = GetNBits(RawBytes, 0, 8);
for(index = 1; index < RawSize; index++)
{
RevertRaw[RawSize - index - 1] = NextNBits(8);
}
# for(index = 0; index < RawSize; index++)
# {
# Test = FormatEx ( "Data: 0x%02X RevertedData: %02X \n", RawBytes[index],
RevertRaw[index]);
# ReportText(Test);
# }
return RevertRaw;
}
########################################################################
# This function returns high dword of SAS address. #
########################################################################
GetSASAddressHi(SASAddress)
{
return GetNBits(SASAddress, 32, 32);
}
########################################################################
# This function returns low dword of SAS address. #
########################################################################
GetSASAddressLo(SASAddress)
{
return GetNBits(SASAddress, 0, 32);
}
########################################################################
# This function Format raw bytes to string. #
########################################################################
FormatRawBytes(RawBytes)
{
for(index = 0; index < sizeof(RawBytes); index++)
{
if(RawBytes[index] <= 0x0F)
{
ByteFormat = FormatEx("0%X", RawBytes[index]);
}
else
{
ByteFormat = FormatEx("%2X", RawBytes[index]);
}
RawFormat = ByteFormat + RawFormat;
# ReportText(RawFormat);
}
return RawFormat;
}
Comentarios a estos manuales