{"id":63163,"date":"2023-10-31T00:02:14","date_gmt":"2023-10-30T16:02:14","guid":{"rendered":"https:\/\/www.techphant.cn\/?p=63163"},"modified":"2023-10-31T00:02:14","modified_gmt":"2023-10-30T16:02:14","slug":"sysszckcs","status":"publish","type":"post","link":"https:\/\/www.techphant.cn\/blog\/63163.html","title":{"rendered":"\u4f7f\u7528stty\u8bbe\u7f6e\u4e32\u53e3\u53c2\u6570"},"content":{"rendered":"

  \u4e32\u53e3\u662f\u8ba1\u7b97\u673a\u7cfb\u7edf\u4e2d\u6700\u5e38\u7528\u7684\u5916\u90e8\u8bbe\u5907\u63a5\u53e3\uff0c\u5b83\u80fd\u591f\u5c06\u8ba1\u7b97\u673a\u548c\u5916\u90e8\u7535\u5b50\u8bbe\u5907\u8fde\u63a5\u8d77\u6765\uff0c\u5b9e\u73b0\u6570\u636e\u7684\u4f20\u8f93\u3002\u4f7f\u7528stty\u547d\u4ee4\u53ef\u4ee5\u8bbe\u7f6e\u4e32\u53e3\u7684\u53c2\u6570\uff0c\u4ece\u800c\u63a7\u5236\u4e32\u53e3\u7684\u901a\u4fe1\u8fc7\u7a0b\u3002\u672c\u6587\u5c06\u4ecb\u7ecdstty\u547d\u4ee4\u7684\u57fa\u672c\u7528\u6cd5\uff0c\u5e76\u5177\u4f53\u8bb2\u89e3\u5982\u4f55\u4f7f\u7528stty\u8bbe\u7f6e\u4e32\u53e3\u53c2\u6570\u3002<\/p>\n

stty\u547d\u4ee4\u7684\u57fa\u672c\u7528\u6cd5<\/h2>\n

  stty\u547d\u4ee4\u662f\u4e00\u4e2a\u7528\u4e8e\u8bbe\u7f6e\u548c\u62a5\u544a\u7ec8\u7aef\u7279\u6027\u7684\u5de5\u5177\uff0c\u5b83\u53ef\u4ee5\u7528\u6765\u8bbe\u7f6e\u4e32\u53e3\u7684\u53c2\u6570\uff0c\u4e5f\u53ef\u4ee5\u7528\u6765\u83b7\u53d6\u4e32\u53e3\u7684\u53c2\u6570\u3002\u5176\u57fa\u672c\u7528\u6cd5\u5982\u4e0b\uff1a<\/p>\n

  stty [-a|g] [\u9009\u9879]<\/p>\n

  \u5176\u4e2d\uff0c-a\u8868\u793a\u8bbe\u7f6e\u4e32\u53e3\u53c2\u6570\uff0c-g\u8868\u793a\u62a5\u544a\u4e32\u53e3\u53c2\u6570\uff0c\u9009\u9879\u7528\u4e8e\u6307\u5b9a\u5177\u4f53\u7684\u53c2\u6570\uff0c\u6bd4\u5982\u901f\u7387\u3001\u6570\u636e\u4f4d\u3001\u505c\u6b62\u4f4d\u7b49\u3002<\/p>\n

\u4f7f\u7528stty\u8bbe\u7f6e\u4e32\u53e3\u53c2\u6570<\/h2>\n

  \u8981\u4f7f\u7528stty\u8bbe\u7f6e\u4e32\u53e3\u53c2\u6570\uff0c\u9996\u5148\u9700\u8981\u786e\u5b9a\u4e32\u53e3\u7684\u8bbe\u5907\u6587\u4ef6\uff0c\u4e00\u822c\u6765\u8bf4\uff0c\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u4e32\u53e3\u7684\u8bbe\u5907\u6587\u4ef6\u4e3a\/dev\/ttyS0\uff0c\/dev\/ttyS1\u7b49\u3002\u7136\u540e\u4f7f\u7528stty\u547d\u4ee4\u8bbe\u7f6e\u4e32\u53e3\u53c2\u6570\uff0c\u4f8b\u5982\uff1a<\/p>\n

  stty -F \/dev\/ttyS0 9600 cs8 cstopb -cread -parenb -clocal<\/p>\n

  \u5176\u4e2d\uff0c-F\u6307\u5b9a\u4e32\u53e3\u8bbe\u5907\u6587\u4ef6\uff0c9600\u8868\u793a\u6ce2\u7279\u7387\u4e3a9600\uff0ccs8\u8868\u793a\u6570\u636e\u4f4d\u4e3a8\u4f4d\uff0ccstopb\u8868\u793a\u505c\u6b62\u4f4d\u4e3a1\u4f4d\uff0c-cread\u8868\u793a\u5173\u95ed\u81ea\u52a8\u63a5\u6536\uff0c-parenb\u8868\u793a\u5173\u95ed\u5947\u5076\u6821\u9a8c\uff0c-clocal\u8868\u793a\u5173\u95ed\u8c03\u5236\u89e3\u8c03\u5668\u63a7\u5236\u3002<\/p>\n

\u603b\u7ed3<\/h2>\n

  \u672c\u6587\u4ecb\u7ecd\u4e86stty\u547d\u4ee4\u7684\u57fa\u672c\u7528\u6cd5\uff0c\u4ee5\u53ca\u5982\u4f55\u4f7f\u7528stty\u8bbe\u7f6e\u4e32\u53e3\u53c2\u6570\u3002<\/strong>\u4f7f\u7528stty\u8bbe\u7f6e\u4e32\u53e3\u53c2\u6570\u53ef\u4ee5\u63a7\u5236\u4e32\u53e3\u7684\u901a\u4fe1\u8fc7\u7a0b\uff0c\u4ece\u800c\u5b9e\u73b0\u4e0e\u5916\u90e8\u7535\u5b50\u8bbe\u5907\u4e4b\u95f4\u7684\u6570\u636e\u4f20\u8f93\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u4e32\u53e3\u662f\u8ba1\u7b97\u673a\u7cfb\u7edf\u4e2d\u6700\u5e38\u7528\u7684\u5916\u90e8\u8bbe\u5907\u63a5\u53e3\uff0c\u5b83\u80fd\u591f\u5c06\u8ba1\u7b97\u673a\u548c\u5916\u90e8\u7535\u5b50\u8bbe\u5907\u8fde\u63a5\u8d77\u6765\uff0c\u5b9e\u73b0\u6570\u636e\u7684\u4f20\u8f93\u3002\u4f7f\u7528stty\u547d\u4ee4\u53ef\u4ee5\u8bbe\u7f6e\u4e32\u53e3\u7684\u53c2\u6570\uff0c\u4ece\u800c\u63a7\u5236\u4e32\u53e3\u7684\u901a\u4fe1\u8fc7\u7a0b\u3002\u672c\u6587\u5c06\u4ecb\u7ecdstt<\/p>\n","protected":false},"author":1,"featured_media":1839,"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-63163","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\/63163","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=63163"}],"version-history":[{"count":0,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts\/63163\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/media\/1839"}],"wp:attachment":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/media?parent=63163"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/categories?post=63163"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/tags?post=63163"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}