url: http://paste.minad.de/index.php?nid=388
Notizname: Pipes von: - Sprache:

  1. /*Sender*/
  2. char kanal1[] = "/tmp/kanal1";
  3. mkfifo (kanal1, 0777);
  4. if (checkerK1 == 0){
  5. fd = open(kanal1, O_WRONLY);
  6. checkerK1 = 1;
  7. }
  8.  
  9. printf("FormelK1 = %f\n", FormelK1);
  10. double berechnung = (FormelK1 + 1.0) * 32767;
  11. printf("FormelK11 = %f\n", berechnung);
  12. submitK1 = ((unsigned short)berechnung);
  13. printf("Unsigned short submitK1 = %d\n\n", submitK1);
  14. write (fd, &submitK1, sizeof(submitK1));
  15.  
  16. /*Empfänger*/
  17. char kanal1[] = "/tmp/kanal1";
  18. printf("Checker vor start = %d", checkerK1);
  19. if (checkerK1 == 0) {
  20. printf("jau");
  21. fd = open(kanal1, O_RDONLY | O_NONBLOCK);
  22. checkerK1 = 1;
  23.  
  24. }
  25. read(fd, &BufferK1, sizeof(BufferK1));
  26.  
Pastelog:
erstellt 2013.06.13 22:59:38
Hits
940




© 2009-2010 rellig