{"id":41252,"date":"2023-10-04T02:57:40","date_gmt":"2023-10-03T18:57:40","guid":{"rendered":"https:\/\/www.techphant.cn\/?p=41252"},"modified":"2023-10-04T02:57:40","modified_gmt":"2023-10-03T18:57:40","slug":"lckmljhsl","status":"publish","type":"post","link":"https:\/\/www.techphant.cn\/blog\/41252.html","title":{"rendered":"Linux \u4e32\u53e3\u547d\u4ee4\u4ea4\u4e92\u5b9e\u4f8b"},"content":{"rendered":"

  Linux \u4e32\u53e3\u547d\u4ee4\u4ea4\u4e92\u5b9e\u4f8b\u662f\u4e00\u79cd\u7528\u4e8e\u8fde\u63a5\u8ba1\u7b97\u673a\u548c\u5916\u90e8\u8bbe\u5907\u7684\u6280\u672f\uff0c\u5176\u4e2d\u53ef\u4ee5\u4f7f\u7528 Linux \u547d\u4ee4\u884c\u6765\u63a7\u5236\u548c\u7ba1\u7406\u5916\u90e8\u8bbe\u5907\u3002\u8be5\u6280\u672f\u53ef\u4ee5\u7528\u4e8e\u8fde\u63a5\u548c\u63a7\u5236\u590d\u6742\u7684\u8bbe\u5907\uff0c\u4f8b\u5982\u6253\u5370\u673a\uff0c\u7f51\u7edc\u8bbe\u5907\uff0c\u4eea\u5668\uff0c\u7b49\u7b49\uff0c\u53ef\u4ee5\u5b9e\u73b0\u81ea\u52a8\u5316\u63a7\u5236\u3002\u672c\u6587\u5c06\u4ecb\u7ecd Linux \u4e32\u53e3\u547d\u4ee4\u4ea4\u4e92\u5b9e\u4f8b\u7684\u57fa\u672c\u539f\u7406\uff0c\u5e76\u901a\u8fc7\u5b9e\u4f8b\u6765\u8bf4\u660e\u5982\u4f55\u4f7f\u7528 Linux \u4e32\u53e3\u547d\u4ee4\u6765\u63a7\u5236\u5916\u90e8\u8bbe\u5907\u3002<\/p>\n

Linux \u4e32\u53e3\u547d\u4ee4\u4ea4\u4e92\u5b9e\u4f8b\u7684\u57fa\u672c\u539f\u7406<\/h2>\n

  Linux \u4e32\u53e3\u547d\u4ee4\u4ea4\u4e92\u5b9e\u4f8b\u662f\u4e00\u79cd\u57fa\u4e8e\u4e32\u53e3\u901a\u4fe1\u7684\u6280\u672f\uff0c\u5b83\u4f7f\u7528 Linux \u547d\u4ee4\u884c\u6765\u63a7\u5236\u548c\u7ba1\u7406\u5916\u90e8\u8bbe\u5907\u3002\u4e32\u53e3\u901a\u4fe1\u662f\u4e00\u79cd\u53cc\u5411\u901a\u4fe1\uff0c\u5b83\u4f7f\u7528\u4e24\u4e2a\u8fde\u63a5\u5230\u8ba1\u7b97\u673a\u7684\u7aef\u53e3\u6765\u8fdb\u884c\u901a\u4fe1\u3002\u4e00\u4e2a\u7aef\u53e3\u7528\u4e8e\u53d1\u9001\u6570\u636e\uff0c\u53e6\u4e00\u4e2a\u7aef\u53e3\u7528\u4e8e\u63a5\u6536\u6570\u636e\u3002\u4e32\u53e3\u901a\u4fe1\u53ef\u4ee5\u7528\u6765\u4f20\u8f93\u6587\u672c\uff0c\u4e8c\u8fdb\u5236\u6570\u636e\uff0c\u56fe\u50cf\u7b49\u6570\u636e\u3002<\/p>\n

  Linux \u4e32\u53e3\u547d\u4ee4\u4ea4\u4e92\u5b9e\u4f8b\u4f7f\u7528\u4e32\u53e3\u901a\u4fe1\u6765\u63a7\u5236\u548c\u7ba1\u7406\u5916\u90e8\u8bbe\u5907\u3002\u5b83\u4f7f\u7528 Linux \u547d\u4ee4\u884c\u6765\u53d1\u9001\u548c\u63a5\u6536\u6570\u636e\uff0c\u4ee5\u5b9e\u73b0\u81ea\u52a8\u5316\u63a7\u5236\u3002Linux \u4e32\u53e3\u547d\u4ee4\u4ea4\u4e92\u5b9e\u4f8b\u53ef\u4ee5\u7528\u6765\u63a7\u5236\u548c\u7ba1\u7406\u590d\u6742\u7684\u8bbe\u5907\uff0c\u4f8b\u5982\u6253\u5370\u673a\uff0c\u7f51\u7edc\u8bbe\u5907\uff0c\u4eea\u5668\u7b49\u3002<\/p>\n

\u4f7f\u7528 Linux \u4e32\u53e3\u547d\u4ee4\u4ea4\u4e92\u5b9e\u4f8b<\/h2>\n

  \u8bbe\u7f6e\u4e32\u53e3\u53c2\u6570<\/h3>\n

  \u9996\u5148\uff0c\u9700\u8981\u8bbe\u7f6e\u4e32\u53e3\u53c2\u6570\uff0c\u4ee5\u4fbf\u4e32\u53e3\u901a\u4fe1\u53ef\u4ee5\u6b63\u5e38\u5de5\u4f5c\u3002\u53ef\u4ee5\u4f7f\u7528 Linux \u547d\u4ee4\u884c\u5de5\u5177 stty \u6765\u8bbe\u7f6e\u4e32\u53e3\u53c2\u6570\u3002stty \u547d\u4ee4\u7684\u683c\u5f0f\u5982\u4e0b\uff1a<\/p>\n

  stty -F \/dev\/ttyS0 speed 9600<\/code><\/p>\n

  \u5176\u4e2d\uff0c-F \u8868\u793a\u4e32\u53e3\u8bbe\u5907\u6587\u4ef6\uff0cspeed \u8868\u793a\u6ce2\u7279\u7387\uff0c9600 \u8868\u793a 9600 bps\u3002<\/p>\n

  \u53d1\u9001\u6570\u636e<\/h3>\n

  \u4f7f\u7528 Linux \u547d\u4ee4\u884c\u5de5\u5177 echo \u53ef\u4ee5\u53d1\u9001\u6570\u636e\u5230\u4e32\u53e3\u3002echo \u547d\u4ee4\u7684\u683c\u5f0f\u5982\u4e0b\uff1a<\/p>\n

  echo \"Hello World!\" > \/dev\/ttyS0<\/code><\/p>\n

  \u5176\u4e2d\uff0cHello World! \u662f\u8981\u53d1\u9001\u7684\u6570\u636e\uff0c\/dev\/ttyS0 \u662f\u4e32\u53e3\u8bbe\u5907\u6587\u4ef6\u3002<\/p>\n

  \u63a5\u6536\u6570\u636e<\/h3>\n

  \u4f7f\u7528 Linux \u547d\u4ee4\u884c\u5de5\u5177 cat \u53ef\u4ee5\u4ece\u4e32\u53e3\u63a5\u6536\u6570\u636e\u3002cat \u547d\u4ee4\u7684\u683c\u5f0f\u5982\u4e0b\uff1a<\/p>\n

  cat \/dev\/ttyS0<\/code><\/p>\n

  \u5176\u4e2d\uff0c\/dev\/ttyS0 \u662f\u4e32\u53e3\u8bbe\u5907\u6587\u4ef6\u3002<\/p>\n

\u603b\u7ed3<\/h2>\n

  \u672c\u6587\u4ecb\u7ecd\u4e86 Linux \u4e32\u53e3\u547d\u4ee4\u4ea4\u4e92\u5b9e\u4f8b\u7684\u57fa\u672c\u539f\u7406\uff0c\u5e76\u901a\u8fc7\u5b9e\u4f8b\u6765\u8bf4\u660e\u5982\u4f55\u4f7f\u7528 Linux \u4e32\u53e3\u547d\u4ee4\u6765\u63a7\u5236\u5916\u90e8\u8bbe\u5907\u3002<\/strong>Linux \u4e32\u53e3\u547d\u4ee4\u4ea4\u4e92\u5b9e\u4f8b\u53ef\u4ee5\u7528\u6765\u63a7\u5236\u548c\u7ba1\u7406\u590d\u6742\u7684\u8bbe\u5907\uff0c\u4f8b\u5982\u6253\u5370\u673a\uff0c\u7f51\u7edc\u8bbe\u5907\uff0c\u4eea\u5668\u7b49\u3002\u4f7f\u7528 Linux \u4e32\u53e3\u547d\u4ee4\u4ea4\u4e92\u5b9e\u4f8b\uff0c\u53ef\u4ee5\u5b9e\u73b0\u81ea\u52a8\u5316\u63a7\u5236\uff0c\u4ece\u800c\u63d0\u9ad8\u5de5\u4f5c\u6548\u7387\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

Linux\u4e32\u53e3\u547d\u4ee4\u4ea4\u4e92\u5b9e\u4f8b\u662f\u4e00\u79cd\u7528\u4e8e\u8fde\u63a5\u8ba1\u7b97\u673a\u548c\u5916\u90e8\u8bbe\u5907\u7684\u6280\u672f\uff0c\u5176\u4e2d\u53ef\u4ee5\u4f7f\u7528Linux\u547d\u4ee4\u884c\u6765\u63a7\u5236\u548c\u7ba1\u7406\u5916\u90e8\u8bbe\u5907\u3002\u8be5\u6280\u672f\u53ef\u4ee5\u7528\u4e8e\u8fde\u63a5\u548c\u63a7\u5236\u590d\u6742\u7684\u8bbe\u5907\uff0c\u4f8b\u5982\u6253\u5370\u673a\uff0c\u7f51<\/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-41252","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\/41252","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=41252"}],"version-history":[{"count":0,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts\/41252\/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=41252"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/categories?post=41252"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/tags?post=41252"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}