def get(self):
        '''
        Return payload, payload
        
        Get next message from NXT, return un-molested payload i.e. bytes.
        Use get_int() for integers and get_bool() for booleans
        '''
        sz = self.s.read(2)
        payload = None
        box = None
        if len(sz) == 2:
            sz = struct.unpack('h', sz)[0]
            # print 'sz', sz
            if 0 < sz < 1000:
                msg = self.s.read(sz)
                # print 'msg', msg
                dat = msg[:4]
                # for c in dat:
                #     print ord(c)
                # print struct.unpack('h', msg[:2])
                box = ord(dat[2]) + 1
                payload = msg[4:-1]
        return payload, box

        Return payload, payload
        
        Get next message from NXT, return un-molested payload i.e. bytes.
        Use get_int() for integers and get_bool() for booleans
        
recipes/Python/498085_Lego_Mindstorms_Bluetooth/recipe-498085.py