nwztool/scsitools: cleanup and add destination changer tool

Now that we have a nice database of player index, the scsitool becomes more
useful and supports a lot more players. I did some general cleanup of the code,
though eventually it would be nice to really split it into a library and a CLI.
The SCSI vendor command allow to read but also write most NVP nodes. Since there
seems to a demand to change destination and sound pressure settings on device,
I implement this feature in the tool. I do not plan to allow arbitrary NVP
writes because this could easily brick the device. Changing the destination
should be safe, but as usual, use at your own risks.

Change-Id: Iff4e8cc3ac97b965c1df849051c5fd373756cda5
This commit is contained in:
Amaury Pouly 2016-11-11 16:04:15 +01:00
parent c95e30b75d
commit 33856d9ceb
2 changed files with 370 additions and 186 deletions

View file

@ -1,20 +1,16 @@
DEFINES=
CC=gcc
LD=gcc
CFLAGS=-g -std=c99 -W -Wall $(DEFINES)
NWZ_DB_DIR=../database
INCLUDES=-I$(NWZ_DB_DIR)
CFLAGS=-std=c99 -W -Wall $(DEFINES) $(INCLUDES)
LDFLAGS=-lsgutils2
BINS=scsitool
all: $(BINS)
%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $<
scsitool: scsitool.o misc.o para_noise.o
$(LD) -o $@ $^ $(LDFLAGS)
scsitool: scsitool.c misc.c para_noise.c $(NWZ_DB_DIR)/nwz_db.c
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
clean:
rm -fr *.o
veryclean:
rm -rf $(BINS)