diff options
author | Nikias Bassen | 2013-11-19 20:01:55 +0100 |
---|---|---|
committer | Nikias Bassen | 2013-11-19 20:01:55 +0100 |
commit | 054a79d64e55ce7d9874e65814c5a17caa1ca1f0 (patch) | |
tree | c65e45aa558c79533d29eb193362e8263ce8fc41 /tools/irecovery.c | |
parent | f6ee4a8efc3bfad2c2d451e3ad86edaca765ff9f (diff) | |
download | libirecovery-054a79d64e55ce7d9874e65814c5a17caa1ca1f0.tar.gz libirecovery-054a79d64e55ce7d9874e65814c5a17caa1ca1f0.tar.bz2 |
remove irecv_get_* functions and provide general irecv_get_device_info()
Diffstat (limited to 'tools/irecovery.c')
-rw-r--r-- | tools/irecovery.c | 41 |
1 files changed, 14 insertions, 27 deletions
diff --git a/tools/irecovery.c b/tools/irecovery.c index a8c85eb..a14e2b6 100644 --- a/tools/irecovery.c +++ b/tools/irecovery.c @@ -131,33 +131,20 @@ static void parse_command(irecv_client_t client, unsigned char* command, unsigne } } else if (!strcmp(cmd, "/deviceinfo")) { int ret, mode; - unsigned int cpid, bdid; - unsigned long long ecid; - char srnm[12], imei[15]; - - ret = irecv_get_cpid(client, &cpid); - if(ret == IRECV_E_SUCCESS) { - printf("CPID: %d\n", cpid); - } - - ret = irecv_get_bdid(client, &bdid); - if(ret == IRECV_E_SUCCESS) { - printf("BDID: %d\n", bdid); - } - - ret = irecv_get_ecid(client, &ecid); - if(ret == IRECV_E_SUCCESS) { - printf("ECID: " _FMT_lld "\n", ecid); - } - - ret = irecv_get_srnm(client, srnm); - if(ret == IRECV_E_SUCCESS) { - printf("SRNM: %s\n", srnm); - } - - ret = irecv_get_imei(client, imei); - if(ret == IRECV_E_SUCCESS) { - printf("IMEI: %s\n", imei); + const struct irecv_device_info *devinfo = irecv_get_device_info(client); + + if (devinfo) { + printf("CPID: %x\n", devinfo->cpid); + printf("CPRV: %x\n", devinfo->cprv); + printf("BDID: %x\n", devinfo->bdid); + printf("ECID: " _FMT_lld "\n", devinfo->ecid); + printf("CPFM: %x\n", devinfo->cpfm); + printf("SCEP: %x\n", devinfo->scep); + printf("IBFL: %x\n", devinfo->ibfl); + printf("SRNM: %s\n", (devinfo->srnm) ? devinfo->srnm : "N/A"); + printf("IMEI: %s\n", (devinfo->imei) ? devinfo->imei : "N/A"); + } else { + printf("Could not get device info?!\n"); } ret = irecv_get_mode(client, &mode); |