{"id":206,"date":"2011-09-04T04:15:52","date_gmt":"2011-09-04T02:15:52","guid":{"rendered":"http:\/\/www.instruyete.org\/?p=206"},"modified":"2011-09-04T04:15:52","modified_gmt":"2011-09-04T02:15:52","slug":"stty-a-devttys","status":"publish","type":"post","link":"https:\/\/www.instruyete.org\/?p=206","title":{"rendered":"stty -a < \/dev\/ttyS...."},"content":{"rendered":"<p>h\u00e4ngt? Ebenso der Befehl<\/p>\n<p>echo &#8222;hallo&#8220; > \/dev\/ttyS&#8230;<\/p>\n<p>?? Dann ist wahrscheinlich die <em>Data Carrier Detect Line<\/em> (DCD) auf High, so dass diese beiden Kommandos auf ewig warten bis die DCD auf Low schaltet.<\/p>\n<p>Umgehen kann man das bei dem ersten Befehl mit<\/p>\n<p><code>stty -a -F \/dev\/ttyS...<\/code><\/p>\n<p>Dieser benutzt beim open den <strong>O_NDELAY<\/strong> Flag, welcher gleichbedeutend zum <strong>O_NONBLOCKING<\/strong> ist.<br \/>\nPrinzipiell sollte man aber bei der <strong>termios<\/strong> Struktur das <strong>c_cflag<\/strong> <strong>CLOCAL<\/strong> setzen, welches die Modem Status Lines ignoriert. Wird dieses Flag nicht gesetzt und schreibt die termios Struktur mittels <strong>tcsetattr<\/strong> an die serielle Schnittstelle zur\u00fcck, hat DCD high und obiges Problem tritt auf.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>h\u00e4ngt? Ebenso der Befehl echo &#8222;hallo&#8220; > \/dev\/ttyS&#8230; ?? Dann ist wahrscheinlich die Data Carrier Detect Line (DCD) auf High, so dass diese beiden Kommandos auf ewig warten bis die DCD auf Low schaltet. Umgehen kann man das bei dem ersten Befehl mit stty -a -F \/dev\/ttyS&#8230; Dieser benutzt beim open den O_NDELAY Flag, welcher &hellip; <a href=\"https:\/\/www.instruyete.org\/?p=206\" class=\"more-link\"><span class=\"screen-reader-text\">stty -a < \/dev\/ttyS....<\/span> weiterlesen<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,10,11,7],"tags":[],"class_list":["post-206","post","type-post","status-publish","format-standard","hentry","category-linux","category-macos","category-solaris","category-unix"],"_links":{"self":[{"href":"https:\/\/www.instruyete.org\/index.php?rest_route=\/wp\/v2\/posts\/206","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.instruyete.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.instruyete.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.instruyete.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.instruyete.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=206"}],"version-history":[{"count":0,"href":"https:\/\/www.instruyete.org\/index.php?rest_route=\/wp\/v2\/posts\/206\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.instruyete.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=206"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.instruyete.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=206"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.instruyete.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=206"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}