The usbmuxd library (Windows & Linux).
In libusbmuxd.c, usbmuxd_get_device_list, add a check for product_id != 0, e.g., in the Windows version (Linux should be very similar):
Code:
got_device_list:
// explicitly close connection
UNLOCK;
socket_close(sfd);
// create copy of device info entries from collection
newlist = (usbmuxd_device_info_t*)malloc(sizeof(usbmuxd_device_info_t) * (collection_count(&tmpdevs) + 1));
dev_cnt = 0;
FOREACH(usbmuxd_device_info_t *di, &tmpdevs, usbmuxd_device_info_t *) {
/* Devices connected by WIFI or USB may be reported. Ignore any without a valid USB product_id, i.e., WIFI connected. */
if (di && di->product_id != 0) {
memcpy(&newlist[dev_cnt], di, sizeof(usbmuxd_device_info_t));
free(di);
dev_cnt++;
}
} ENDFOREACH
collection_free(&tmpdevs);
I did investigate changing the Python code instead, but that is a lot more complex to do, mainly because (as I recall) the product_id is not propagated back up into the Python code, so it would have probably meant changing the libimobiledevice API.