write to a device
763476
def devop_write(self, args, bustype):
        ''''''
        usage = "Usage: devop write <spi|i2c> name bus address regstart count <bytes>"
        if len(args) < 5:
            print(usage)
            return
        name = args[0]
        bus = int(args[1],base=0)
        address = int(args[2],base=0)
        reg = int(args[3],base=0)
        count = int(args[4],base=0)
        args = args[5:]
        if len(args) < count:
            print(usage)
            return
        bytes = [0]*128
        for i in range(count):
            bytes[i] = int(args[i],base=0)
        self.master.mav.device_op_write_send(self.target_system,
                                             self.target_component,
                                             self.request_id,
                                             bustype,
                                             bus,
                                             address,
                                             name,
                                             reg,
                                             count,
                                             bytes)
        self.request_id += 1
1280758
def __interact_writen(self, fd, data):
        '''
        '''

        while data != b'' and self.isalive():
            n = os.write(fd, data)
            data = data[n:]
252493
static void writeIoDevice(IoDevice ioDevice, BufferedWriter writer, int priority) throws
            IOException {
        writer.write(XML_START_TAG);
        XMLUtils.writeXmlAttribute(VENDOR_ID, ioDevice.getVendorId(), writer);
        XMLUtils.writeXmlAttribute(PRODUCT_ID, ioDevice.getProductId(), writer);
        XMLUtils.writeXmlAttribute(DEVICE_ID, ioDevice.getDeviceId(), writer);

        String name = ioDevice.getName();
        if (name != null) {
            XMLUtils.writeXmlAttribute(NAME, name, writer);
        }

        String vendorName = ioDevice.getVendorName();
        if (vendorName != null) {
            XMLUtils.writeXmlAttribute(VENDOR_NAME, vendorName, writer);
        }

        if (priority != INVALID_PRIORITY) {
            XMLUtils.writeXmlAttribute(PRIORITY, priority, writer);
        }
        writer.write(XMLUtils.ELEMENT_END);
    }
51336
def _send(self, value, mode):
        """"""
        # Wait, if compatibility mode is enabled
        if self.compat_mode:
            self._wait()

        # Choose instruction or data mode
        GPIO.output(self.pins.rs, mode)

        # If the RW pin is used, set it to low in order to write.
        if self.pins.rw is not None:
            GPIO.output(self.pins.rw, 0)

        # Write data out in chunks of 4 or 8 bit
        if self.data_bus_mode == c.LCD_8BITMODE:
            self._write8bits(value)
        else:
            self._write4bits(value >> 4)
            self._write4bits(value)

        # Record the time for the tail-end of the last send event
        if self.compat_mode:
            self.last_send_event = now()
1098235
def write(self, out):
        """"""
        out.write_string(self.address, len(self.address))
107746
def write_display(self):
        """"""
        for i, value in enumerate(self.buffer):
            self._device.write8(i, value)
814993
def send(self, data):
        

        if self._device:
            if isinstance(data, str):
                data = str.encode(data)

            # Hack to support unicode under Python 2.x
            if sys.version_info < (3,):
                if isinstance(data, unicode):
                    data = bytes(data)

            self._device.write(data)
615110
def write(self, ulBuffer, pSrc, unBytes):
        """"""

        fn = self.function_table.write
        result = fn(ulBuffer, pSrc, unBytes)
        return result
519107
def write_data(self, data):
        
        with open(self.path, "w") as writer:
            writer.write(data)
785467
def write(self, pkt):
		
		self.setRTS(self.DD_WRITE)
		self.flushInput()
		# prep data array for transmition
		pkt = bytearray(pkt)
		pkt = bytes(pkt)

		num = self.serial.write(pkt)
		# self.serial.flush()
		# print('wrote {} of len(pkt) = {}'.format(num, len(pkt)))
		return num
1104690
def write_and_return(
        command, ack, serial_connection, timeout=DEFAULT_WRITE_TIMEOUT):
    ''''''
    clear_buffer(serial_connection)
    with serial_with_temp_timeout(
            serial_connection, timeout) as device_connection:
        response = _write_to_device_and_return(command, ack, device_connection)
    return response
944699
def dump(device, args=None):
    '''
    
    '''
    cmd = 'blockdev --getro --getsz --getss --getpbsz --getiomin --getioopt --getalignoff ' \
          '--getmaxsect --getsize --getsize64 --getra --getfra {0}'.format(device)
    ret = {}
    opts = [c[2:] for c in cmd.split() if c.startswith('--')]
    out = __salt__['cmd.run_all'](cmd, python_shell=False)
    if out['retcode'] == 0:
        lines = [line for line in out['stdout'].splitlines() if line]
        count = 0
        for line in lines:
            ret[opts[count]] = line
            count = count+1
        if args:
            temp_ret = {}
            for arg in args:
                temp_ret[arg] = ret[arg]
            return temp_ret
        else:
            return ret
    else:
        return False
711132
def write(self, buf, url):
        """"""
        (store_name, path) = self._split_url(url)
        adapter = self._create_adapter(store_name)
        with adapter.open(path, 'wb') as f:
            f.write(buf.encode())
1325432
function (device, data){
        message=util.format ("#-%d Action Devid:[%s] Name:[%s] Cmd:[%s] Lat:%d Lon:%d Speed=%d\n", count++, device.devid, device.name, data.cmd, data.lat, data.lon, data.sog);
        socket.write (message);
    }
834918
def write_data(self, buf):
        
        data = ''.join(map(chr, buf))
        size = len(data)
        if hidapi.hid_write(self.device, ctypes.c_char_p(data), size) != size:
            raise IOError(
                'pywws.device_ctypes_hidapi.USBDevice.write_data failed')
        return True
364818
def write(self, offset, value):
		
		if(not self.mode & 0b10):
			raise ReadOnlyError("Device is Read-Only")
		if(offset >= self.size):
			raise AddressError("Offset({}) not in address space({})".format(offset, self.size))
		self.repr_[offset].setvalue(value)
493022
def write_wdata(self, address, register, value):
        
        warnings.warn("write_wdata() is deprecated and will be removed in future versions replace with write_word_data()", DeprecationWarning)
        LOGGER.debug("Writing word data %s to register %s on device %s",
            bin(value), hex(register), hex(address))
        return self.driver.write_word_data(address, register, value)