Advertisement
Zy0d0x

Untitled

Sep 20th, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. GNU nano 4.3 test.c
  2. #include "cm108.h"
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5.  
  6. /**
  7. * Very simple tool to test the cm108 ptt circuit.
  8. *
  9. * If it works, it should press the PTT button for
  10. * one second and then release it.
  11. */
  12. int main(int argc, char** argv) {
  13. const char *path;
  14. path = cm108_find_device();
  15.  
  16. if(!path) {
  17. printf("No device found. Sorry.\n");
  18. return 1;
  19. }
  20.  
  21. printf("Found device %s\n", path);
  22. int fd = cm108_open(path);
  23.  
  24. if(fd == -1) {
  25. printf("\nCould not open device! Have you installed the udev rules?\n");
  26. printf("You can retry as root.\n");
  27. exit(3);
  28. }
  29.  
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement