From 3097239ce65c2eca659671c23dbacbefc398b9e7 Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Fri, 28 Oct 2016 23:27:29 +0200 Subject: nwztools/plattools: add device list This list can map from model id to device name. It was automatically extracted from Sony's tools. In the future, we will probably generate it from a clean database containing more useful information. Change-Id: Ibe580edf25b60bf0bf4aef4a06f40dddd19c5404 --- utils/nwztools/plattools/nwz_lib.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'utils/nwztools/plattools/nwz_lib.c') diff --git a/utils/nwztools/plattools/nwz_lib.c b/utils/nwztools/plattools/nwz_lib.c index 4ea1edee19..ebfe488a7d 100644 --- a/utils/nwztools/plattools/nwz_lib.c +++ b/utils/nwztools/plattools/nwz_lib.c @@ -20,6 +20,16 @@ ****************************************************************************/ #include "nwz_lib.h" +extern struct nwz_dev_info_t g_nwz_dev_list[]; + +const char *nwz_get_model_name(unsigned long model_id) +{ + for(int i = 0; g_nwz_dev_list[i].name; i++) + if(g_nwz_dev_list[i].model_id == model_id) + return g_nwz_dev_list[i].name; + return NULL; +} + void nwz_run(const char *file, const char *args[], bool wait) { pid_t child_pid = fork(); -- cgit v1.2.3