async def update_firmware(request):
    """
    This handler accepts a POST request with Content-Type: multipart/form-data
    and a file field in the body named "hex". The file should be a valid HEX
    image to be flashed to the LPC1769. The received file is flashed using
    lpc21isp, and then deleted and a success code is returned.
    """
    log.debug('Update Firmware request received')
    data = await request.post()
    try:
        res = await install_smoothie_firmware(data['hex'], request.loop)
        status = 200
    except Exception as e:
        log.exception("Exception during firmware update:")
        res = {'message': 'Exception {} raised by update of {}: {}'.format(
                type(e), data, e.__traceback__)}
        status = 500
    return web.json_response(res, status=status)
async def update_firmware ( request ) : log . debug ( 'Update Firmware request received' ) data = await request . post ( ) try : res = await install_smoothie_firmware ( data [ 'hex' ] , request . loop ) status = 200 except Exception as e : log . exception ( "Exception during firmware update:" ) res = { 'message' : 'Exception {} raised by update of {}: {}' . format ( type ( e ) , data , e . __traceback__ ) } status = 500 return web . json_response ( res , status = status )
This handler accepts a POST request with Content-Type: multipart/form-data
    and a file field in the body named "hex". The file should be a valid HEX
    image to be flashed to the LPC1769. The received file is flashed using
    lpc21isp, and then deleted and a success code is returned.