{"id":60756,"date":"2023-10-28T19:56:33","date_gmt":"2023-10-28T11:56:33","guid":{"rendered":"https:\/\/www.techphant.cn\/?p=60756"},"modified":"2023-10-28T19:56:33","modified_gmt":"2023-10-28T11:56:33","slug":"lckrlj","status":"publish","type":"post","link":"https:\/\/www.techphant.cn\/blog\/60756.html","title":{"rendered":"Linux\u4e32\u53e3\u8f6f\u8fde\u63a5"},"content":{"rendered":"
Linux\u4e32\u53e3\u8f6f\u8fde\u63a5\u662f\u4e00\u79cd\u53ef\u4ee5\u5728Linux\u7cfb\u7edf\u4e2d\u5efa\u7acb\u4e32\u53e3\u901a\u4fe1\u8fde\u63a5\u7684\u65b9\u6cd5\uff0c\u5b83\u80fd\u591f\u5e2e\u52a9\u5f00\u53d1\u8005\u66f4\u52a0\u4fbf\u6377\u7684\u4f7f\u7528\u4e32\u53e3\u6765\u5b8c\u6210\u76f8\u5173\u7684\u901a\u4fe1\u4efb\u52a1\u3002\u672c\u6587\u5c06\u8be6\u7ec6\u4ecb\u7ecdLinux\u4e32\u53e3\u8f6f\u8fde\u63a5\u7684\u57fa\u672c\u539f\u7406\u3001\u5b9e\u73b0\u65b9\u6cd5\u4ee5\u53ca\u5e94\u7528\u573a\u666f\u3002<\/p>\n
\u4e32\u53e3\u8f6f\u8fde\u63a5\u662f\u4e00\u79cd\u57fa\u4e8e\u8f6f\u4ef6\u5b9e\u73b0\u7684\u4e32\u53e3\u901a\u4fe1\u65b9\u5f0f\uff0c\u5b83\u53ef\u4ee5\u5728Linux\u7cfb\u7edf\u4e2d\u5efa\u7acb\u4e32\u53e3\u8fde\u63a5\uff0c\u4ece\u800c\u5b9e\u73b0\u4e32\u53e3\u901a\u4fe1\u3002\u4e32\u53e3\u8f6f\u8fde\u63a5\u7684\u57fa\u672c\u539f\u7406\u662f\uff1aLinux\u7cfb\u7edf\u4e2d\u7684\u4e32\u53e3\u8bbe\u5907\u4f1a\u88ab\u62bd\u8c61\u6210\u4e00\u4e2a\u6587\u4ef6\uff0c\u901a\u8fc7\u5bf9\u8be5\u6587\u4ef6\u7684\u8bfb\u5199\u64cd\u4f5c\uff0c\u5c31\u53ef\u4ee5\u5b9e\u73b0\u4e32\u53e3\u7684\u901a\u4fe1\u3002<\/p>\n
\u8981\u5b9e\u73b0Linux\u4e32\u53e3\u8f6f\u8fde\u63a5\uff0c\u9996\u5148\u9700\u8981\u786e\u5b9a\u4e32\u53e3\u8bbe\u5907\u7684\u8bbe\u5907\u6587\u4ef6\uff0c\u4e00\u822c\u60c5\u51b5\u4e0b\uff0c\u8be5\u6587\u4ef6\u4f4d\u4e8e\/dev\/ttyS0\u6216\/dev\/ttyUSB0\uff0c\u53ef\u4ee5\u4f7f\u7528ls -l\u67e5\u770b\u6587\u4ef6\u7684\u6743\u9650\uff0c\u53ea\u6709root\u7528\u6237\u624d\u6709\u6743\u9650\u8bbf\u95ee\u4e32\u53e3\u6587\u4ef6\u3002\u63a5\u4e0b\u6765\uff0c\u53ef\u4ee5\u4f7f\u7528open()\u51fd\u6570\u6253\u5f00\u4e32\u53e3\u6587\u4ef6\uff0c\u5e76\u4f7f\u7528ioctl()\u51fd\u6570\u8bbe\u7f6e\u4e32\u53e3\u7684\u53c2\u6570\uff0c\u6bd4\u5982\u6ce2\u7279\u7387\u3001\u6570\u636e\u4f4d\u3001\u505c\u6b62\u4f4d\u7b49\u3002\u6700\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528read()\u548cwrite()\u51fd\u6570\u6765\u5b9e\u73b0\u4e32\u53e3\u7684\u8bfb\u5199\u64cd\u4f5c\uff0c\u4ece\u800c\u5b9e\u73b0\u4e32\u53e3\u901a\u4fe1\u3002<\/p>\n
Linux\u4e32\u53e3\u8f6f\u8fde\u63a5\u7684\u5e94\u7528\u573a\u666f\u975e\u5e38\u5e7f\u6cdb\uff0c\u5b83\u53ef\u4ee5\u7528\u4e8e\u5b9e\u73b0\u4e32\u53e3\u4e0e\u5916\u8bbe\u7684\u901a\u4fe1\uff0c\u6bd4\u5982\u4e0eGPS\u6a21\u5757\u3001GSM\u6a21\u5757\u7b49\u5916\u8bbe\u7684\u901a\u4fe1\uff0c\u4e5f\u53ef\u4ee5\u7528\u4e8e\u5b9e\u73b0\u4e32\u53e3\u4e0e\u4e32\u53e3\u4e4b\u95f4\u7684\u901a\u4fe1\uff0c\u8fd9\u5728\u8bbe\u5907\u4e4b\u95f4\u7684\u6570\u636e\u4f20\u8f93\u4e2d\u975e\u5e38\u6709\u7528\u3002\u6b64\u5916\uff0cLinux\u4e32\u53e3\u8f6f\u8fde\u63a5\u8fd8\u53ef\u4ee5\u7528\u4e8e\u5b9e\u73b0\u4e32\u53e3\u8c03\u8bd5\uff0c\u5728\u8f6f\u4ef6\u5f00\u53d1\u8fc7\u7a0b\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u4e32\u53e3\u8f6f\u8fde\u63a5\u6765\u8c03\u8bd5\u8f6f\u4ef6\uff0c\u4ece\u800c\u66f4\u52a0\u65b9\u4fbf\u5feb\u6377\u7684\u8c03\u8bd5\u8f6f\u4ef6\u3002<\/p>\n
\u672c\u6587\u4ecb\u7ecd\u4e86Linux\u4e32\u53e3\u8f6f\u8fde\u63a5\u7684\u57fa\u672c\u539f\u7406\u3001\u5b9e\u73b0\u65b9\u6cd5\u4ee5\u53ca\u5e94\u7528\u573a\u666f\uff0cLinux\u4e32\u53e3\u8f6f\u8fde\u63a5\u7684\u4f18\u52bf\u5728\u4e8e\u53ef\u4ee5\u66f4\u52a0\u4fbf\u6377\u7684\u5728Linux\u7cfb\u7edf\u4e2d\u5efa\u7acb\u4e32\u53e3\u8fde\u63a5\uff0c\u4ece\u800c\u5b9e\u73b0\u4e32\u53e3\u901a\u4fe1\uff0c\u5728\u8f6f\u4ef6\u5f00\u53d1\u8fc7\u7a0b\u4e2d\u4e5f\u53ef\u4ee5\u4f7f\u7528\u4e32\u53e3\u8f6f\u8fde\u63a5\u6765\u8c03\u8bd5\u8f6f\u4ef6\uff0c\u53ef\u8c13\u662f\u4e00\u79cd\u975e\u5e38\u5b9e\u7528\u7684\u6280\u672f\u3002<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":" Linux\u4e32\u53e3\u8f6f\u8fde\u63a5\u662f\u4e00\u79cd\u53ef\u4ee5\u5728Linux\u7cfb\u7edf\u4e2d\u5efa\u7acb\u4e32\u53e3\u901a\u4fe1\u8fde\u63a5\u7684\u65b9\u6cd5\uff0c\u5b83\u80fd\u591f\u5e2e\u52a9\u5f00\u53d1\u8005\u66f4\u52a0\u4fbf\u6377\u7684\u4f7f\u7528\u4e32\u53e3\u6765\u5b8c\u6210\u76f8\u5173\u7684\u901a\u4fe1\u4efb\u52a1\u3002\u672c\u6587\u5c06\u8be6\u7ec6\u4ecb\u7ecdLinux\u4e32\u53e3\u8f6f\u8fde\u63a5\u7684\u57fa\u672c\u539f<\/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-60756","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\/60756","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=60756"}],"version-history":[{"count":0,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts\/60756\/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=60756"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/categories?post=60756"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/tags?post=60756"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}