diff options
Diffstat (limited to 'spectro/hidio.c')
-rw-r--r-- | spectro/hidio.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/spectro/hidio.c b/spectro/hidio.c index c930755..2d8649f 100644 --- a/spectro/hidio.c +++ b/spectro/hidio.c @@ -178,7 +178,7 @@ int hid_get_paths(icompaths *p) { pdidd->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA); dinfod.cbSize = sizeof(SP_DEVINFO_DATA); for (i = 0; ; i++) { - instType itype; + devType itype; if (SetupDiEnumDeviceInterfaces(hdinfo, NULL, &HidGuid, i, &did) == 0) { if (GetLastError() == ERROR_NO_MORE_ITEMS) { @@ -269,7 +269,7 @@ int hid_get_paths(icompaths *p) { } #endif /* NT */ -#ifdef __APPLE__ +#ifdef UNIX_APPLE # if defined(USE_NEW_OSX_CODE) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 1060 { CFAllocatorContext alocctx; @@ -308,7 +308,7 @@ int hid_get_paths(icompaths *p) { CFNumberRef vref, pref; /* HID Vendor and Product ID propeties */ CFNumberRef lidpref; /* Location ID properties */ unsigned int vid = 0, pid = 0, lid = 0; - instType itype; + devType itype; IOHIDDeviceRef ioob = values[i]; /* HID object found */ if ((vref = IOHIDDeviceGetProperty(ioob, CFSTR(kIOHIDVendorIDKey))) != NULL) { @@ -376,7 +376,7 @@ int hid_get_paths(icompaths *p) { CFNumberRef vref, pref; /* HID Vendor and Product ID propeties */ CFNumberRef lidpref; /* Location ID properties */ unsigned int vid = 0, pid = 0, lid = 0; - instType itype; + devType itype; if ((ioob = IOIteratorNext(mit)) == 0) break; @@ -426,7 +426,7 @@ int hid_get_paths(icompaths *p) { IOObjectRelease(mit); /* Release the itterator */ } #endif /* __MAC_OS_X_VERSION_MAX_ALLOWED < 1060 */ -#endif /* __APPLE__ */ +#endif /* UNIX_APPLE */ #if defined(UNIX_X11) @@ -483,14 +483,14 @@ int hid_get_paths(icompaths *p) { #endif /* NEVER */ #endif /* UNIX_X11 */ - a1logd(p->log, 8, "icoms_get_paths: returning %d paths and ICOM_OK\n",p->npaths); + a1logd(p->log, 8, "icoms_get_paths: returning %d paths and ICOM_OK\n",p->ndpaths[dtix_combined]); return ICOM_OK; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -#ifdef __APPLE__ +#ifdef UNIX_APPLE /* HID Interrupt callback for OS X */ /* This seems to only get called when the run loop is active. */ @@ -516,7 +516,7 @@ UInt32 size a1logd(p->log, 8, "HID callback has no run loop\n"); } -#endif /* __APPLE__ */ +#endif /* UNIX_APPLE */ /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ @@ -571,7 +571,7 @@ char **pnames /* List of process names to try and kill before opening */ } #endif /* NT */ -#ifdef __APPLE__ +#ifdef UNIX_APPLE # if defined(USE_NEW_OSX_CODE) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 1060 { /* Open the device */ @@ -644,7 +644,7 @@ char **pnames /* List of process names to try and kill before opening */ } } #endif /* __MAC_OS_X_VERSION_MAX_ALLOWED < 1060 */ -#endif /* __APPLE__ */ +#endif /* UNIX_APPLE */ p->is_open = 1; a1logd(p->log, 8, "hid_open_port: HID port is now open\n"); @@ -669,7 +669,7 @@ void hid_close_port(icoms *p) { CloseHandle(p->hidd->fh); #endif /* NT */ -#ifdef __APPLE__ +#ifdef UNIX_APPLE # if defined(USE_NEW_OSX_CODE) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 1060 if (IOHIDDeviceClose(p->hidd->ioob, kIOHIDOptionsTypeNone) != kIOReturnSuccess) { a1loge(p->log, ICOM_SYS, "hid_close_port: closing HID port '%s' failed",p->name); @@ -701,7 +701,7 @@ void hid_close_port(icoms *p) { } p->hidd->device = NULL; #endif /* __MAC_OS_X_VERSION_MAX_ALLOWED < 1060 */ -#endif /* __APPLE__ */ +#endif /* UNIX_APPLE */ p->is_open = 0; a1logd(p->log, 8, "hid_close_port: has been released and closed\n"); @@ -770,7 +770,7 @@ icoms_hid_read(icoms *p, } #endif /* NT */ -#ifdef __APPLE__ +#ifdef UNIX_APPLE # if defined(USE_NEW_OSX_CODE) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 1060 { IOReturn result; @@ -899,7 +899,7 @@ printf("~1 IOHIDDeviceGet returned 0x%x\n",result); } #endif // NEVER #endif /* __MAC_OS_X_VERSION_MAX_ALLOWED < 1060 */ -#endif /* __APPLE__ */ +#endif /* UNIX_APPLE */ if (breadp != NULL) *breadp = bread; @@ -968,7 +968,7 @@ icoms_hid_write(icoms *p, } #endif /* NT */ -#ifdef __APPLE__ +#ifdef UNIX_APPLE # if defined(USE_NEW_OSX_CODE) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 1060 { IOReturn result; @@ -1039,7 +1039,7 @@ printf("~1 IOHIDDeviceSetReportWithCallback returned 0x%x\n",result); } } #endif /* __MAC_OS_X_VERSION_MAX_ALLOWED < 1060 */ -#endif /* __APPLE__ */ +#endif /* UNIX_APPLE */ if (bwrittenp != NULL) *bwrittenp = bwritten; @@ -1101,7 +1101,7 @@ int hid_copy_hid_idevice(icoms *d, icompath *s) { return ICOM_SYS; } #endif -#if defined(__APPLE__) +#if defined(UNIX_APPLE) # if defined(USE_NEW_OSX_CODE) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 1060 d->hidd->ioob = s->hidd->ioob; CFRetain(d->hidd->ioob); @@ -1109,7 +1109,7 @@ int hid_copy_hid_idevice(icoms *d, icompath *s) { d->hidd->ioob = s->hidd->ioob; IOObjectRetain(d->hidd->ioob); #endif /* __MAC_OS_X_VERSION_MAX_ALLOWED < 1060 */ -#endif /* __APPLE__ */ +#endif /* UNIX_APPLE */ #if defined (UNIX_X11) #endif return ICOM_OK; @@ -1124,7 +1124,7 @@ void hid_del_hid_idevice(struct hid_idevice *hidd) { if (hidd->dpath != NULL) free(hidd->dpath); #endif -#if defined(__APPLE__) +#if defined(UNIX_APPLE) # if defined(USE_NEW_OSX_CODE) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 1060 if (hidd->ioob != 0) CFRelease(hidd->ioob); @@ -1132,7 +1132,7 @@ void hid_del_hid_idevice(struct hid_idevice *hidd) { if (hidd->ioob != 0) IOObjectRelease(hidd->ioob); #endif /* __MAC_OS_X_VERSION_MAX_ALLOWED < 1060 */ -#endif /* __APPLE__ */ +#endif /* UNIX_APPLE */ #if defined (UNIX_X11) #endif free(hidd); |