From d022c58e61e46e84a7a367849511e49a5391f9f0 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 28 Apr 2015 14:15:05 -0400 Subject: [PATCH] Fix parsing of 6bit ascii The 6 bit ascii decode was not correctly assembling the third character in every chunk. It was incorrectly masking away the most significant bit before shifting. Correct the mask to only mask the appropriate bits. Change-Id: Ib55ce934d2834d53879e64cc44bcf12bef0eef1c --- pyghmi/ipmi/fru.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyghmi/ipmi/fru.py b/pyghmi/ipmi/fru.py index be7f9fbc..9823b837 100644 --- a/pyghmi/ipmi/fru.py +++ b/pyghmi/ipmi/fru.py @@ -85,7 +85,7 @@ def unpack6bitascii(inputdata): currchar = (currchunk[0] & 0b11000000) >> 6 currchar |= (currchunk[1] & 0b1111) << 2 result += chr(0x20 + currchar) - currchar = (currchunk[1] & 0b1111000) >> 4 + currchar = (currchunk[1] & 0b11110000) >> 4 currchar |= (currchunk[2] & 0b11) << 4 result += chr(0x20 + currchar) currchar = (currchunk[2] & 0b11111100) >> 2