Skip to content

Commit 9e6be62

Browse files
committed
Add device info printing
1 parent fed53c3 commit 9e6be62

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

Source/OnixSource.cpp

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,21 @@ void OnixSource::updateSettings(OwnedArray<ContinuousChannel>* continuousChannel
8686
oni_get_opt(ctx, ONI_OPT_DEVICETABLE, devices, &devices_sz);
8787

8888
// print device info
89-
for (size_t i = 0; i < num_devs; i++) {
90-
if (devices[i].id != ONIX_NULL) {
91-
92-
LOGD("Device ", i, " ID: ", devices[i].id);
89+
for (size_t dev_idx = 0; dev_idx < num_devs; dev_idx++) {
90+
if (devices[dev_idx].id != ONIX_NULL) {
91+
92+
const char* dev_str = onix_device_str(devices[dev_idx].id);
93+
94+
printf("%02zd |%05zd: 0x%02x.0x%02x\t|%d\t|%d\t|%u\t|%u\t|%s\n",
95+
dev_idx,
96+
devices[dev_idx].idx,
97+
(uint8_t)(devices[dev_idx].idx >> 8),
98+
(uint8_t)devices[dev_idx].idx,
99+
devices[dev_idx].id,
100+
devices[dev_idx].version,
101+
devices[dev_idx].read_size,
102+
devices[dev_idx].write_size,
103+
dev_str);
93104
}
94105
}
95106
}

0 commit comments

Comments
 (0)