{"id":42300,"date":"2023-10-04T08:30:44","date_gmt":"2023-10-04T00:30:44","guid":{"rendered":"https:\/\/www.techphant.cn\/?p=42300"},"modified":"2023-10-04T08:30:44","modified_gmt":"2023-10-04T00:30:44","slug":"zklxtckml","status":"publish","type":"post","link":"https:\/\/www.techphant.cn\/blog\/42300.html","title":{"rendered":"\u67e5\u770bLinux\u7cfb\u7edf\u4e32\u53e3\u547d\u4ee4"},"content":{"rendered":"

  Linux\u7cfb\u7edf\u63d0\u4f9b\u4e86\u4e00\u7cfb\u5217\u7684\u4e32\u53e3\u547d\u4ee4\uff0c\u53ef\u4ee5\u7528\u6765\u67e5\u770b\u4e32\u53e3\u8bbe\u5907\u7684\u72b6\u6001\uff0c\u914d\u7f6e\u4e32\u53e3\u53c2\u6570\uff0c\u67e5\u770b\u548c\u6e05\u9664\u4e32\u53e3\u7f13\u51b2\u533a\u7b49\uff0c\u672c\u6587\u5c06\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528Linux\u7cfb\u7edf\u7684\u4e32\u53e3\u547d\u4ee4\u6765\u67e5\u770b\u4e32\u53e3\u8bbe\u5907\u3002<\/p>\n

\u67e5\u770b\u4e32\u53e3\u8bbe\u5907<\/h2>\n

  \u8981\u67e5\u770bLinux\u7cfb\u7edf\u4e2d\u53ef\u7528\u7684\u4e32\u53e3\u8bbe\u5907\uff0c\u53ef\u4ee5\u4f7f\u7528\u201cls \/dev\/ttyS*\u201d\u547d\u4ee4\uff0c\u8be5\u547d\u4ee4\u4f1a\u5217\u51fa\u6240\u6709\u53ef\u7528\u7684\u4e32\u53e3\u8bbe\u5907\uff0c\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n

  [root@localhost]# ls \/dev\/ttyS*<\/p>

  \/dev\/ttyS0 \/dev\/ttyS1 \/dev\/ttyS2 \/dev\/ttyS3<\/p><\/pre>\n

  \u4ece\u4e0a\u9762\u7684\u8f93\u51fa\u7ed3\u679c\u4e2d\u53ef\u4ee5\u770b\u5230\uff0cLinux\u7cfb\u7edf\u4e2d\u67094\u4e2a\u53ef\u7528\u7684\u4e32\u53e3\u8bbe\u5907\uff0c\u5206\u522b\u662fttyS0\u3001ttyS1\u3001ttyS2\u548cttyS3\u3002<\/p>\n

\u67e5\u770b\u4e32\u53e3\u53c2\u6570<\/h2>\n

  \u8981\u67e5\u770b\u4e32\u53e3\u8bbe\u5907\u7684\u53c2\u6570\uff0c\u53ef\u4ee5\u4f7f\u7528\u201cstty -F \/dev\/ttyS0\u201d\u547d\u4ee4\uff0c\u8be5\u547d\u4ee4\u4f1a\u663e\u793a\u4e32\u53e3\u8bbe\u5907\u7684\u6ce2\u7279\u7387\u3001\u6570\u636e\u4f4d\u3001\u505c\u6b62\u4f4d\u7b49\u53c2\u6570\uff0c\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n

  [root@localhost]# stty -F \/dev\/ttyS0<\/p>

  speed 115200 baud; line = 0;<\/p>

  min = 1; time = 0;<\/p>

  -brkint -icrnl -imaxbel<\/p>

  -opost -onlcr<\/p>

  -isig -icanon -echo<\/p><\/pre>\n

  \u4ece\u4e0a\u9762\u7684\u8f93\u51fa\u7ed3\u679c\u4e2d\u53ef\u4ee5\u770b\u5230\uff0cttyS0\u4e32\u53e3\u7684\u6ce2\u7279\u7387\u4e3a115200\uff0c\u6570\u636e\u4f4d\u4e3a8\u4f4d\uff0c\u505c\u6b62\u4f4d\u4e3a1\u4f4d\uff0c\u65e0\u6821\u9a8c\u4f4d\u3002<\/p>\n

\u6e05\u9664\u4e32\u53e3\u7f13\u51b2\u533a<\/h2>\n

  \u8981\u6e05\u9664\u4e32\u53e3\u7f13\u51b2\u533a\uff0c\u53ef\u4ee5\u4f7f\u7528\u201cstty -F \/dev\/ttyS0 -clocal\u201d\u547d\u4ee4\uff0c\u8be5\u547d\u4ee4\u4f1a\u6e05\u9664\u4e32\u53e3\u7f13\u51b2\u533a\uff0c\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n

  [root@localhost]# stty -F \/dev\/ttyS0 -clocal<\/p><\/pre>\n

  \u4ece\u4e0a\u9762\u7684\u8f93\u51fa\u7ed3\u679c\u4e2d\u53ef\u4ee5\u770b\u5230\uff0c\u4f7f\u7528\u201cstty -F \/dev\/ttyS0 -clocal\u201d\u547d\u4ee4\u53ef\u4ee5\u6e05\u9664\u4e32\u53e3\u7f13\u51b2\u533a\u3002<\/p>\n

\u603b\u7ed3<\/h2>\n

  \u672c\u6587\u4ecb\u7ecd\u4e86\u5982\u4f55\u4f7f\u7528Linux\u7cfb\u7edf\u7684\u4e32\u53e3\u547d\u4ee4\u6765\u67e5\u770b\u4e32\u53e3\u8bbe\u5907\uff0c\u67e5\u770b\u4e32\u53e3\u53c2\u6570\uff0c\u4ee5\u53ca\u6e05\u9664\u4e32\u53e3\u7f13\u51b2\u533a\u3002<\/strong>\u901a\u8fc7\u4e0a\u8ff0\u64cd\u4f5c\uff0c\u53ef\u4ee5\u66f4\u597d\u5730\u4e86\u89e3Linux\u7cfb\u7edf\u7684\u4e32\u53e3\u547d\u4ee4\uff0c\u4ece\u800c\u66f4\u597d\u5730\u7ba1\u7406\u4e32\u53e3\u8bbe\u5907\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

Linux\u7cfb\u7edf\u63d0\u4f9b\u4e86\u4e00\u7cfb\u5217\u7684\u4e32\u53e3\u547d\u4ee4\uff0c\u53ef\u4ee5\u7528\u6765\u67e5\u770b\u4e32\u53e3\u8bbe\u5907\u7684\u72b6\u6001\uff0c\u914d\u7f6e\u4e32\u53e3\u53c2\u6570\uff0c\u67e5\u770b\u548c\u6e05\u9664\u4e32\u53e3\u7f13\u51b2\u533a\u7b49\uff0c\u672c\u6587\u5c06\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528Linux\u7cfb\u7edf\u7684\u4e32\u53e3\u547d\u4ee4\u6765\u67e5\u770b\u4e32\u53e3\u8bbe\u5907\u3002<\/p>\n","protected":false},"author":1,"featured_media":4132,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-global-header-display":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","footnotes":""},"categories":[36],"tags":[69],"class_list":["post-42300","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-cktx"],"_links":{"self":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts\/42300","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/comments?post=42300"}],"version-history":[{"count":0,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts\/42300\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/media\/4132"}],"wp:attachment":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/media?parent=42300"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/categories?post=42300"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/tags?post=42300"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}