device operations

def cmd_devop(self, args):
        '''device operations'''
        usage = "Usage: devop <read|write> <spi|i2c> name bus address"
        if len(args) < 5:
            print(usage)
            return

        if args[1] == 'spi':
            bustype = mavutil.mavlink.DEVICE_OP_BUSTYPE_SPI
        elif args[1] == 'i2c':
            bustype = mavutil.mavlink.DEVICE_OP_BUSTYPE_I2C
        else:
            print(usage)

        if args[0] == 'read':
            self.devop_read(args[2:], bustype)
        elif args[0] == 'write':
            self.devop_write(args[2:], bustype)
        else:
            print(usage)