Loading ...
Sorry, an error occurred while loading the content.

USB-UIRT and openslug

Expand Messages
  • Martin Gingras
    Hi, I am trying to get USB-UIRT to work with openslug. It get detected and assigned to /dev/ttyUSB0. I do have some C code that can write to the device and
    Message 1 of 1 , Aug 23, 2006
    • 0 Attachment
      Hi,

      I am trying to get USB-UIRT to work with openslug. It get detected
      and assigned to /dev/ttyUSB0. I do have some C code that can write to
      the device and work correctly on any PC:

      such as:

      char ir[] = {0x36,0x6b,0x41,0x01,0x08,0x00,0x65,0x81,0x6a,0x80,0xb5,0x15,0x16,0x15,0x16,0x15,0x16,0x15,0x41,0x15,0x16,0x15,0x16,0x15,0x16,0x15,0x41,0x15,0x16,0x15,0x16,0x15,0x40,0x15,0x17,0x15,0x16,0x15,0x16,0x15,0x16,0x15,0x17,0x15,0x16,0x15,0x16,0x15,0x40,0x15,0x41,0x15,0x16,0x15,0x16,0x15,0x16,0x15,0x17,0x15,0x16,0x15,0x40,0x15,0x16,0x15,0x17,0x15,0x16,0x15,0x16,0x15,0x16,0x15,0x41,0x15,0x16,0x15,0x40,0x15,0x16,0x15,0x41,0x15,0x16,0x15,0x16,0x15,0x16,0x15,0x41,0x15,0x16,0x15,0x40,0x15,0x40,0x15,0x17,0x15,0x16,0x15,0x16,0x15,0x16,0x15,0x16,0x15,0x68};

      char r[5];
      int w;
      w = write(fd, ir, sizeof(ir));
      printf("sent signal, write returned %d.\n", w);
      sleep(1);
      w = read(fd, r, 1);
      if (w == 1)
      {
      printf("usb-uirt returned 0x%x.\n", r[0]);
      }
      else
      {
      printf("tried to read one byte, read returned %d.\n", w);
      }


      when I run the code on the NSLU2, write work but according to strace,
      it hang to a read call like:
      write(1, "sent signal, write returned 109."..., 33sent signal, write
      returned 109.
      ) = 33
      rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
      rt_sigaction(SIGCHLD, NULL, {SIG_DFL}, 8) = 0
      rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
      nanosleep({1, 0}, {1, 0}) = 0
      read(3, <unfinished ...>


      anyone know why is it hanging or has any prior experience with
      USb-UIRT on the NSLU2?


      thanx a lot for your help


      Martin Gingras Ing.
    Your message has been successfully submitted and would be delivered to recipients shortly.