Пример #1
0
    def is_response(self):
        """Return True if this is a response PDU, False otherwise"""

        import command
        if command.get_command_code(self.command) & 0x80000000:
            return True

        return False
Пример #2
0
    def is_response(self):
        """Return True if this is a response PDU, False otherwise"""

        import command
        if command.get_command_code(self.command) & 0x80000000:
            return True

        return False
Пример #3
0
    def generate(self):
        """Generate raw PDU"""
       
        body = self.generate_params()
        
        self._length = len(body) + 16

        import command
        
        command_code = command.get_command_code(self.command)

        header = struct.pack(">LLLL", self._length, command_code,
                             self.status, self.sequence)

        return header + body
Пример #4
0
    def generate(self):
        """Generate raw PDU"""

        body = self.generate_params()

        self._length = len(body) + 16

        import command

        command_code = command.get_command_code(self.command)

        header = struct.pack(">LLLL", self._length, command_code, self.status,
                             self.sequence)

        return header + body