[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

ioctl ger konstiga värden



Hej

Jag sitter och jobbar med en Rs485 driver till ett projekt.
Men jag har stött på några mindre problem.

När jag läser LSR och MCR med hjälp av ioctl så får jag
värden som inte kan stämma. Följande kod används.

main(){
        int fd, ret, val;

        fd=open("/dev/ttyS0", O_NOCTTY);

        ret=ioctl(fd, TIOCMGET, &val);

        printf("Ret: %d, Val: %d", ret, val);

        close(fd);
}

Värdena som skrivs ut på skärmen är helt fel. Att ioctl
lyckas vet jag då ret=0, men värdet jag får på MCR kan inte
stämma, brukar vara 38 och då skulle bitar i registret
vara höga som man normalt inte skall användas.

--
mvh
   Martin Bertilsson Haagen
  ______________________________________________________________________

   E-mail: sslug@sslug
   Phone: 0707/671717
  ______________________________________________________________________
  If the box says "Windows 95 or better", it should run on Linux, right?




 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:07 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *