parameters: (self, device, offset, txdata)
return_statement: return
docstring: Write a block (IPMI command) to the output file
docstring_summary: Write a block (IPMI command) to the output file
docstring_tokens: Write a block ( IPMI command ) to the output file
function: def bl_write(self, device, offset, txdata):
          """ Write a block (IPMI command) to the output file """
          count = len(txdata)
  
          if count > self.BW_BL_WRITE_MAX:
              raise Exception("bad len %d > %d" %
                              (count, self.BW_BL_WRITE_MAX))
  
          if device != self.BW_DEV_FLASH:
              raise Exception("bad device %d" % device)
  
          txar = [self.BW_BL_CMD_WRITE, device,
                  offset & 0xff, (offset >> 8) & 0xff,
                  (offset >> 16) & 0xff, (offset >> 24) & 0xff,
                  count & 0xff, (count >> 8) & 0xff]
  
          for data in txdata:
              txar.append(data)
  
          if self.ofile:
              tx_buf = array('B', self.BW_BL_CMD_HDR)
  
              for elem in txar:
                  tx_buf.append(elem)
  
              self.ofile.write(struct.pack('H', len(tx_buf)))
              self.ofile.write(tx_buf)
          return
function_tokens: def bl_write ( self , device , offset , txdata ) : count = len ( txdata ) if count > self . BW_BL_WRITE_MAX : raise Exception ( "bad len %d > %d" % ( count , self . BW_BL_WRITE_MAX ) ) if device != self . BW_DEV_FLASH : raise Exception ( "bad device %d" % device ) txar = [ self . BW_BL_CMD_WRITE , device , offset & 0xff , ( offset >> 8 ) & 0xff , ( offset >> 16 ) & 0xff , ( offset >> 24 ) & 0xff , count & 0xff , ( count >> 8 ) & 0xff ] for data in txdata : txar . append ( data ) if self . ofile : tx_buf = array ( 'B' , self . BW_BL_CMD_HDR ) for elem in txar : tx_buf . append ( elem ) self . ofile . write ( struct . pack ( 'H' , len ( tx_buf ) ) ) self . ofile . write ( tx_buf ) return