diff options
| author | 2021-03-19 00:08:21 +0100 | |
|---|---|---|
| committer | 2021-06-13 02:01:11 +0200 | |
| commit | 2efd3adbe498e02ee53cee092b71a0c88ee53231 (patch) | |
| tree | 45bda1aabc068699e8a166c3858572130c66b427 | |
| parent | c3e1048f25c5bca7cea5b05b480013d1b3a3d89b (diff) | |
| download | libirecovery-2efd3adbe498e02ee53cee092b71a0c88ee53231.tar.gz libirecovery-2efd3adbe498e02ee53cee092b71a0c88ee53231.tar.bz2 | |
irecovery: Output product, model and marketing name for device information
| -rw-r--r-- | tools/irecovery.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/irecovery.c b/tools/irecovery.c index 244f961..392f912 100644 --- a/tools/irecovery.c +++ b/tools/irecovery.c | |||
| @@ -135,6 +135,7 @@ static void print_hex(unsigned char *buf, size_t len) | |||
| 135 | static void print_device_info(irecv_client_t client) | 135 | static void print_device_info(irecv_client_t client) |
| 136 | { | 136 | { |
| 137 | int ret, mode; | 137 | int ret, mode; |
| 138 | irecv_device_t device = NULL; | ||
| 138 | const struct irecv_device_info *devinfo = irecv_get_device_info(client); | 139 | const struct irecv_device_info *devinfo = irecv_get_device_info(client); |
| 139 | if (devinfo) { | 140 | if (devinfo) { |
| 140 | printf("CPID: 0x%04x\n", devinfo->cpid); | 141 | printf("CPID: 0x%04x\n", devinfo->cpid); |
| @@ -177,6 +178,13 @@ static void print_device_info(irecv_client_t client) | |||
| 177 | if (ret == IRECV_E_SUCCESS) { | 178 | if (ret == IRECV_E_SUCCESS) { |
| 178 | printf("MODE: %s\n", mode_to_str(mode)); | 179 | printf("MODE: %s\n", mode_to_str(mode)); |
| 179 | } | 180 | } |
| 181 | |||
| 182 | irecv_devices_get_device_by_client(client, &device); | ||
| 183 | if (device) { | ||
| 184 | printf("PRODUCT: %s\n", device->product_type); | ||
| 185 | printf("MODEL: %s\n", device->hardware_model); | ||
| 186 | printf("NAME: %s\n", device->display_name); | ||
| 187 | } | ||
| 180 | } | 188 | } |
| 181 | 189 | ||
| 182 | static void print_devices() { | 190 | static void print_devices() { |
