LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-21-2014, 03:30 AM   #1
WoldemarShiPa
LQ Newbie
 
Registered: Apr 2014
Posts: 11

Rep: Reputation: Disabled
Stopping /dev/ttyUSB0


Hello. I have USB-to-CAN converter detected as ttyUSB0. I use only library provided by manufacturer to operate device. But it seems this library doesn't close port properly, because I still can cat port data after execution its close() func. So, I should to re-plug USB cable to stop device and then I'm able to open port second time. Is there any way to stop port? Thanks
 
Old 04-21-2014, 08:08 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 14,929

Rep: Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520
Welcome to LinuxQuestions.

What are you trying to accomplish? Are you trying to prevent writing to the device from out side your program?

Device files i.e. /dev/ttyUSB0 are opened and closed for reading and writing just like any other file.
 
Old 04-22-2014, 02:41 AM   #3
WoldemarShiPa
LQ Newbie
 
Registered: Apr 2014
Posts: 11

Original Poster
Rep: Reputation: Disabled
I have demo program for converter provided by manufacturer. When I quit demo program, port is still opened, I can cat data from it. When I try to run demo program second time it can't establish connection. Demo program uses its own library. It seems like library close() function is wrong. So, I'm looking for way to close port.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
/dev/ttyUSB0 permissions joegumbo Slackware 6 03-11-2013 06:23 PM
ttyUSB0 not showing up in /dev nikgra Linux - Server 1 08-20-2010 07:43 PM
[SOLVED] How to define /dev/ttyUSB0? MrCode Linux - General 3 04-04-2010 05:39 PM
/dev/ttyUSB0 and permissions mrsolo Linux - Software 1 11-14-2004 04:24 PM
/dev/ttyUSB0 js72 Linux - Networking 1 01-05-2003 07:02 AM


All times are GMT -5. The time now is 05:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration