def get(self):
        '''
        Get a message off port.  Determine type from box number:
        1 -- string
        2 -- int
        3 -- bool
        '''
        msg, box = Blue.get(self)
        if box == 2:
            out = struct.unpack('i', msg)[0]
        elif box == 3:
            out = not not(ord(msg))
        else:
            out = msg
        return out

        Get a message off port.  Determine type from box number:
        1 -- string
        2 -- int
        3 -- bool
        
recipes/Python/498085_Lego_Mindstorms_Bluetooth/recipe-498085.py