                     raise "invalid progress PDU size #{data.length}"
 
                 progress( data.readUInt32LE(0), data.readUInt16LE(4), data.readUInt8(6) )
+
+        flush: ( callback )->
+            execute OPC_FLUSH, callback
 
         unregister_progress_callback: ->
             progress_callback = default_progress_callback

            expected_size 9
            cb(null, data.readUInt8(0), data.readUInt32LE(1), data.readUInt32LE(5))
        when OPC_START_FLASH
            expected_size 9
            cb(null, data.readUInt8(0), data.readUInt32LE(1), data.readUInt32LE(5))
        when OPC_STOP_FLASH, OPC_FLUSH
            expected_size 0
            cb(null)
        else
            cb("invalid response code #{response_code}; expected #{opcode}")



    flash_cb = {
        start_flash: ( start_address, cb ) ->
            execute OPC_START_FLASH, new Buffer( start_address ), (error, mtu, checksum)->
                console.log "flash started. mtu: #{mtu}; checksum: #{checksum}" if VERBOSE
                cb(error, mtu, checksum)

        send_data: ( data ) ->
            queued_data.push data
