Skip to content

Commit

Permalink
coolscan-updater: add minimal README
Browse files Browse the repository at this point in the history
  • Loading branch information
kosma committed Mar 23, 2022
1 parent 9790b76 commit e4b2fe4
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
1 change: 1 addition & 0 deletions coolscan-updater/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,5 @@ fabric.properties

# local
.idea/
*.bin
*.bak
11 changes: 11 additions & 0 deletions coolscan-updater/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# coolscan-updater

This is a minimal updater program for use with USB-based Coolscans.
It is based on a LS-40 USB traffic dump kindly provided by Gleb Shtengel.
Not all traffic is replicated perfectly - just enough to install the update.
SCSI (native or over Firewire) is not supported but shouldn't be too hard to add.

To build, use CLion - or CMake with a MinGW toolchain if you're an expert.

There are no user-friendly files here - instead, look in the Releases section
of this repository for a user-friendly package.
14 changes: 11 additions & 3 deletions coolscan-updater/src/coolscan-updater.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
#include <stdio.h>
#include <unistd.h>
#include <conio.h>

#include "coolscan_command.h"
#include "coolscan_transport.h"
#include "coolscan_updatefile.h"

void press_any_key_to_continue(void)
{
printf("Press any key to continue...\n");
_getch();
}

int main()
{
atexit(press_any_key_to_continue);

printf("******************************************\n");
printf("* Nikon Coolscan Updater by Kosma Moczek *\n");
printf("******************************************\n");
Expand Down Expand Up @@ -50,13 +59,14 @@ int main()
}

// execute firmware update
printf("Installing firmware...\n");
coolscan_command_firmware_update_set(scanner);
coolscan_command_firmware_update_execute(scanner);

// wait for scanner to come back online
int time = 0;
while (true) {
printf("Waiting for the update to install (%ds)...\n", ++time);
printf("Waiting for the scanner to boot (%ds)...\n", ++time);
if (coolscan_command_test_unit_ready(scanner))
break;
else
Expand All @@ -67,8 +77,6 @@ int main()
printf("...scanner says it's a %s\n", coolscan_command_inquiry(scanner));

printf("Firmware update done.\n");

end:
coolscan_scanner_close(scanner);

return 0;
Expand Down

0 comments on commit e4b2fe4

Please sign in to comment.