Skip to content

Commit 3724f76

Browse files
committed
camtest prints device serial
Signed-off-by: Benn Snyder <[email protected]>
1 parent a8a17ae commit 3724f76

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

examples/camtest.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include <signal.h>
2727
#include <stdbool.h>
2828
#include <stdio.h>
29+
#include <stdlib.h>
2930
#include <string.h>
3031
#include "libfreenect.h"
3132

@@ -92,6 +93,12 @@ int main(int argc, char** argv)
9293
return ret;
9394
}
9495

96+
{
97+
char* serial = freenect_get_device_serial(fn_dev);
98+
if (serial) printf("Found device with serial %s\n", serial);
99+
free(serial);
100+
}
101+
95102
// Set depth and video modes.
96103
ret = freenect_set_depth_mode(fn_dev, freenect_find_depth_mode(FREENECT_RESOLUTION_MEDIUM, FREENECT_DEPTH_MM));
97104
if (ret < 0)

0 commit comments

Comments
 (0)