summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
0d298df)
When we signed the .ini file for our windows 'driver', IDs 28 and 2c
hadn't been assigned to EasyMega and EasyMotor, so that file has
generic 'AltusMetrum28' and 'AltusMetrum2c' instead. Updating that
file is 'hard', so just map the names in the driver instead.
Signed-off-by: Keith Packard <keithp@keithp.com>
+static struct {
+ char *windows;
+ char *real;
+} name_map[] = {
+ { .windows = "AltusMetrum28", .real = "EasyMega" },
+ { .windows = "AltusMetrum2c", .real = "EasyMotor" },
+ { 0, 0 },
+};
+
PUBLIC int
altos_list_next(struct altos_list *list, struct altos_device *device)
{
PUBLIC int
altos_list_next(struct altos_list *list, struct altos_device *device)
{
DWORD friendlyname_len;
char instanceid[1024];
DWORD instanceid_len;
DWORD friendlyname_len;
char instanceid[1024];
DWORD instanceid_len;
dev_info_data.cbSize = sizeof (SP_DEVINFO_DATA);
while(SetupDiEnumDeviceInfo(list->dev_info, list->index,
dev_info_data.cbSize = sizeof (SP_DEVINFO_DATA);
while(SetupDiEnumDeviceInfo(list->dev_info, list->index,
altos_set_last_windows_error();
continue;
}
altos_set_last_windows_error();
continue;
}
+ for (i = 0; name_map[i].windows; i++)
+ if (!strcmp(name_map[i].windows, friendlyname)) {
+ strcpy(friendlyname, name_map[i].real);
+ break;
+ }
+
device->vendor = vid;
device->product = pid;
device->serial = serial;
device->vendor = vid;
device->product = pid;
device->serial = serial;