                 cb(error, mtu, receive_capacity, checksum)
 
         send_data: ( data ) ->
-            data_char.write data, false, (error)->
-                if error
-                    cb( error )
+            queued_data.push data
+            send_function()
 
         register_progress_callback: ( cb ) ->
             progress_callback = cb
 
         unregister_progress_callback: ->
-            progress_callback = ->
+            progress_callback = default_progress_callback
     }
 
     new FlashMemory( flash_cb, start_address, data, address_size, page_size, page_buffers, cb )

                    control_point_char.on 'data', (data, is_notification)->
                        control_point_callback( data, is_notification )

                    progress_char.on 'data,', (data, is_notification)->
                        progress_callback( data, is_notification )

                    control_point_char.notify true, (error)->

control_point_callback = (data, is_notification)->
    raise "Unexpected control point notification"

default_progress_callback = ->
    raise "Unexpected progress notification"

progress_callback      = default_progress_callback

scan_devices = (mac, cb)->
    devices = {}
