Skip to content

Commit 6f37897

Browse files
committed
Remove stale Windows/macOS example/test
1 parent 69dcdc1 commit 6f37897

File tree

2 files changed

+0
-141
lines changed

2 files changed

+0
-141
lines changed

mac/hid.c

Lines changed: 0 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,77 +1196,3 @@ HID_API_EXPORT const wchar_t * HID_API_CALL hid_error(hid_device *dev)
11961196

11971197
return L"hid_error is not implemented yet";
11981198
}
1199-
1200-
1201-
1202-
1203-
1204-
1205-
1206-
#if 0
1207-
static int32_t get_location_id(IOHIDDeviceRef device)
1208-
{
1209-
return get_int_property(device, CFSTR(kIOHIDLocationIDKey));
1210-
}
1211-
1212-
static int32_t get_usage(IOHIDDeviceRef device)
1213-
{
1214-
int32_t res;
1215-
res = get_int_property(device, CFSTR(kIOHIDDeviceUsageKey));
1216-
if (!res)
1217-
res = get_int_property(device, CFSTR(kIOHIDPrimaryUsageKey));
1218-
return res;
1219-
}
1220-
1221-
static int32_t get_usage_page(IOHIDDeviceRef device)
1222-
{
1223-
int32_t res;
1224-
res = get_int_property(device, CFSTR(kIOHIDDeviceUsagePageKey));
1225-
if (!res)
1226-
res = get_int_property(device, CFSTR(kIOHIDPrimaryUsagePageKey));
1227-
return res;
1228-
}
1229-
1230-
static int get_transport(IOHIDDeviceRef device, wchar_t *buf, size_t len)
1231-
{
1232-
return get_string_property(device, CFSTR(kIOHIDTransportKey), buf, len);
1233-
}
1234-
1235-
1236-
int main(void)
1237-
{
1238-
IOHIDManagerRef mgr;
1239-
int i;
1240-
1241-
mgr = IOHIDManagerCreate(kCFAllocatorDefault, kIOHIDOptionsTypeNone);
1242-
IOHIDManagerSetDeviceMatching(mgr, NULL);
1243-
IOHIDManagerOpen(mgr, kIOHIDOptionsTypeNone);
1244-
1245-
CFSetRef device_set = IOHIDManagerCopyDevices(mgr);
1246-
1247-
CFIndex num_devices = CFSetGetCount(device_set);
1248-
IOHIDDeviceRef *device_array = calloc(num_devices, sizeof(IOHIDDeviceRef));
1249-
CFSetGetValues(device_set, (const void **) device_array);
1250-
1251-
for (i = 0; i < num_devices; i++) {
1252-
IOHIDDeviceRef dev = device_array[i];
1253-
printf("Device: %p\n", dev);
1254-
printf(" %04hx %04hx\n", get_vendor_id(dev), get_product_id(dev));
1255-
1256-
wchar_t serial[256], buf[256];
1257-
char cbuf[256];
1258-
get_serial_number(dev, serial, 256);
1259-
1260-
1261-
printf(" Serial: %ls\n", serial);
1262-
printf(" Loc: %ld\n", get_location_id(dev));
1263-
get_transport(dev, buf, 256);
1264-
printf(" Trans: %ls\n", buf);
1265-
make_path(dev, cbuf, 256);
1266-
printf(" Path: %s\n", cbuf);
1267-
1268-
}
1269-
1270-
return 0;
1271-
}
1272-
#endif

windows/hid.c

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,73 +1135,6 @@ HID_API_EXPORT const wchar_t * HID_API_CALL hid_error(hid_device *dev)
11351135
return L"hid_error for global errors is not implemented yet";
11361136
}
11371137

1138-
1139-
/*#define PICPGM*/
1140-
/*#define S11*/
1141-
#define P32
1142-
#ifdef S11
1143-
unsigned short VendorID = 0xa0a0;
1144-
unsigned short ProductID = 0x0001;
1145-
#endif
1146-
1147-
#ifdef P32
1148-
unsigned short VendorID = 0x04d8;
1149-
unsigned short ProductID = 0x3f;
1150-
#endif
1151-
1152-
1153-
#ifdef PICPGM
1154-
unsigned short VendorID = 0x04d8;
1155-
unsigned short ProductID = 0x0033;
1156-
#endif
1157-
1158-
1159-
#if 0
1160-
int __cdecl main(int argc, char* argv[])
1161-
{
1162-
int res;
1163-
unsigned char buf[65];
1164-
1165-
UNREFERENCED_PARAMETER(argc);
1166-
UNREFERENCED_PARAMETER(argv);
1167-
1168-
/* Set up the command buffer. */
1169-
memset(buf,0x00,sizeof(buf));
1170-
buf[0] = 0;
1171-
buf[1] = 0x81;
1172-
1173-
1174-
/* Open the device. */
1175-
int handle = open(VendorID, ProductID, L"12345");
1176-
if (handle < 0)
1177-
printf("unable to open device\n");
1178-
1179-
1180-
/* Toggle LED (cmd 0x80) */
1181-
buf[1] = 0x80;
1182-
res = write(handle, buf, 65);
1183-
if (res < 0)
1184-
printf("Unable to write()\n");
1185-
1186-
/* Request state (cmd 0x81) */
1187-
buf[1] = 0x81;
1188-
write(handle, buf, 65);
1189-
if (res < 0)
1190-
printf("Unable to write() (2)\n");
1191-
1192-
/* Read requested state */
1193-
read(handle, buf, 65);
1194-
if (res < 0)
1195-
printf("Unable to read()\n");
1196-
1197-
/* Print out the returned buffer. */
1198-
for (int i = 0; i < 4; i++)
1199-
printf("buf[%d]: %d\n", i, buf[i]);
1200-
1201-
return 0;
1202-
}
1203-
#endif
1204-
12051138
#ifdef __cplusplus
12061139
} /* extern "C" */
12071140
#endif

0 commit comments

Comments
 (0)