diff --git a/lib/shared/sdk/usbboot/index.js b/lib/shared/sdk/usbboot/index.js index 02fab743..3f1708e6 100644 --- a/lib/shared/sdk/usbboot/index.js +++ b/lib/shared/sdk/usbboot/index.js @@ -245,20 +245,20 @@ const startFileServer = (device, endpoint, files) => { }, (error) => { debug(`Got ${error.message} when reading a command, assuming everything is done`) return { - command: protocol.FILE_MESSAGE_COMMAND_DONE + command: protocol.FILE_MESSAGE_COMMANDS.DONE } }) .then((fileMessage) => { debug(`Received message: ${fileMessage.command} -> ${fileMessage.fileName}`) - if (fileMessage.command === protocol.FILE_MESSAGE_COMMAND_DONE) { + if (fileMessage.command === protocol.FILE_MESSAGE_COMMANDS.DONE) { debug('Done') return Bluebird.resolve() } return Bluebird.try(() => { - if (fileMessage.command === protocol.FILE_MESSAGE_COMMAND_GET_FILE_SIZE) { + if (fileMessage.command === protocol.FILE_MESSAGE_COMMANDS.GET_FILE_SIZE) { debug(`Getting the size of ${fileMessage.fileName}`) const fileSize = _.get(files, [ fileMessage.fileName, 'length' ]) @@ -272,7 +272,7 @@ const startFileServer = (device, endpoint, files) => { return protocol.sendBufferSize(device, fileSize) } - if (fileMessage.command === protocol.FILE_MESSAGE_COMMAND_READ_FILE) { + if (fileMessage.command === protocol.FILE_MESSAGE_COMMANDS.READ_FILE) { debug(`Reading ${fileMessage.fileName}`) const fileBuffer = _.get(files, [ fileMessage.fileName ])