{"id":31600,"date":"2023-09-17T16:57:16","date_gmt":"2023-09-17T08:57:16","guid":{"rendered":"https:\/\/www.techphant.cn\/?p=31600"},"modified":"2023-09-17T16:57:16","modified_gmt":"2023-09-17T08:57:16","slug":"ckzrhsljtdgnhyf","status":"publish","type":"post","link":"https:\/\/www.techphant.cn\/blog\/31600.html","title":{"rendered":"\u4e32\u53e3\u4e2dreadall\u51fd\u6570\uff1a\u4e86\u89e3\u5b83\u7684\u529f\u80fd\u548c\u7528\u6cd5"},"content":{"rendered":"
\u4e32\u53e3\u4e2dreadall\u51fd\u6570\u662f\u4e00\u79cd\u7528\u4e8e\u4ece\u4e32\u53e3\u4e2d\u8bfb\u53d6\u6570\u636e\u7684\u65b9\u6cd5\uff0c\u5b83\u53ef\u4ee5\u5e2e\u52a9\u7528\u6237\u5feb\u901f\u83b7\u53d6\u4e32\u53e3\u4e0a\u53ef\u7528\u7684\u6570\u636e\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u4e32\u53e3\u4e2dreadall\u51fd\u6570\u7684\u529f\u80fd\u548c\u7528\u6cd5\uff0c\u4ee5\u4fbf\u5e2e\u52a9\u8bfb\u8005\u66f4\u597d\u5730\u4e86\u89e3\u548c\u5229\u7528\u8fd9\u4e00\u51fd\u6570\u3002<\/p>\n
readall\u51fd\u6570\u7684\u4e3b\u8981\u529f\u80fd\u662f\u4ece\u4e32\u53e3\u4e2d\u8bfb\u53d6\u6570\u636e\uff0c\u5b83\u53ef\u4ee5\u8bfb\u53d6\u4e32\u53e3\u4e0a\u7684\u6240\u6709\u6570\u636e\uff0c\u5e76\u5c06\u5176\u5b58\u50a8\u5230\u7f13\u51b2\u533a\u4e2d\u3002readall\u51fd\u6570\u8fd8\u53ef\u4ee5\u8bbe\u7f6e\u4e00\u4e2a\u8d85\u65f6\u65f6\u95f4\uff0c\u4ee5\u9632\u6b62\u51fd\u6570\u4e00\u76f4\u963b\u585e\uff0c\u4ece\u800c\u5f71\u54cd\u7cfb\u7edf\u7684\u6027\u80fd\u3002<\/p>\n
readall\u51fd\u6570\u7684\u539f\u7406\u662f\uff0c\u5f53\u7528\u6237\u8c03\u7528readall\u51fd\u6570\u65f6\uff0c\u51fd\u6570\u4f1a\u4ece\u4e32\u53e3\u4e2d\u8bfb\u53d6\u6307\u5b9a\u6570\u91cf\u7684\u6570\u636e\uff0c\u5e76\u5c06\u5176\u5b58\u50a8\u5230\u7f13\u51b2\u533a\u4e2d\u3002\u5f53\u7f13\u51b2\u533a\u4e2d\u7684\u6570\u636e\u91cf\u8fbe\u5230\u6307\u5b9a\u7684\u9608\u503c\u65f6\uff0c\u51fd\u6570\u4f1a\u505c\u6b62\u8bfb\u53d6\uff0c\u5e76\u5c06\u7f13\u51b2\u533a\u4e2d\u7684\u6570\u636e\u8fd4\u56de\u7ed9\u7528\u6237\u3002<\/p>\n
readall\u51fd\u6570\u7684\u7528\u6cd5\u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u8c03\u7528readall\u51fd\u6570\uff0c\u5e76\u4f20\u5165\u4e32\u53e3\u7684\u53e5\u67c4\u548c\u8981\u8bfb\u53d6\u7684\u6570\u636e\u91cf\uff0c\u5373\u53ef\u4ece\u4e32\u53e3\u4e2d\u8bfb\u53d6\u6570\u636e\u3002\u4f8b\u5982\uff1a<\/p>\n
char *data; int len;<\/p>
\/\/ \u8bfb\u53d6\u4e32\u53e3\u4e2d\u7684\u6570\u636e<\/p>
len = readall(serial_handle, data, 1024);<\/p>
\/\/ \u5c06\u6570\u636e\u5904\u7406\u540e\u8f93\u51fa<\/p>
for (int i = 0; i < len; i++)<\/p>
printf(\"%02x \", data[i]);<\/p><\/code><\/pre>\n
readall\u51fd\u6570\u7684\u4f18\u70b9<\/h2>\n
readall\u51fd\u6570\u5177\u6709\u8bfb\u53d6\u901f\u5ea6\u5feb\u3001\u4f7f\u7528\u7b80\u5355\u3001\u53ef\u4ee5\u8bbe\u7f6e\u8d85\u65f6\u65f6\u95f4\u7b49\u4f18\u70b9\uff0c\u56e0\u6b64\u53ef\u4ee5\u6709\u6548\u63d0\u9ad8\u7cfb\u7edf\u7684\u8bfb\u53d6\u6548\u7387\u3002<\/p>\n
\u8bfb\u53d6\u901f\u5ea6\u5feb<\/h3>\n
readall\u51fd\u6570\u53ef\u4ee5\u4ece\u4e32\u53e3\u4e2d\u5feb\u901f\u8bfb\u53d6\u6570\u636e\uff0c\u56e0\u6b64\u53ef\u4ee5\u6709\u6548\u63d0\u9ad8\u7cfb\u7edf\u7684\u8bfb\u53d6\u6548\u7387\u3002<\/p>\n
\u4f7f\u7528\u7b80\u5355<\/h3>\n
readall\u51fd\u6570\u7684\u4f7f\u7528\u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u8c03\u7528\u51fd\u6570\uff0c\u5e76\u4f20\u5165\u4e32\u53e3\u53e5\u67c4\u548c\u8981\u8bfb\u53d6\u7684\u6570\u636e\u91cf\uff0c\u5373\u53ef\u4ece\u4e32\u53e3\u4e2d\u8bfb\u53d6\u6570\u636e\u3002<\/p>\n
\u53ef\u4ee5\u8bbe\u7f6e\u8d85\u65f6\u65f6\u95f4<\/h3>\n
readall\u51fd\u6570\u53ef\u4ee5\u8bbe\u7f6e\u4e00\u4e2a\u8d85\u65f6\u65f6\u95f4\uff0c\u4ee5\u9632\u6b62\u51fd\u6570\u4e00\u76f4\u963b\u585e\uff0c\u4ece\u800c\u5f71\u54cd\u7cfb\u7edf\u7684\u6027\u80fd\u3002<\/p>\n
\u603b\u7ed3<\/h2>\n
\u672c\u6587\u4ecb\u7ecd\u4e86\u4e32\u53e3\u4e2dreadall\u51fd\u6570\u7684\u529f\u80fd\u548c\u7528\u6cd5\uff0c\u4ee5\u53ca\u5b83\u7684\u4f18\u70b9\u3002<\/strong>readall\u51fd\u6570\u53ef\u4ee5\u4ece\u4e32\u53e3\u4e2d\u5feb\u901f\u8bfb\u53d6\u6570\u636e\uff0c\u4f7f\u7528\u7b80\u5355\uff0c\u8fd8\u53ef\u4ee5\u8bbe\u7f6e\u8d85\u65f6\u65f6\u95f4\uff0c\u4ece\u800c\u6709\u6548\u63d0\u9ad8\u7cfb\u7edf\u7684\u8bfb\u53d6\u6548\u7387\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u4e32\u53e3\u4e2dreadall\u51fd\u6570\u662f\u4e00\u79cd\u7528\u4e8e\u4ece\u4e32\u53e3\u4e2d\u8bfb\u53d6\u6570\u636e\u7684\u65b9\u6cd5\uff0c\u5b83\u53ef\u4ee5\u5e2e\u52a9\u7528\u6237\u5feb\u901f\u83b7\u53d6\u4e32\u53e3\u4e0a\u53ef\u7528\u7684\u6570\u636e\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u4e32\u53e3\u4e2dreadall\u51fd\u6570\u7684\u529f\u80fd\u548c\u7528\u6cd5\uff0c\u4ee5\u4fbf\u5e2e\u52a9\u8bfb\u8005\u66f4\u597d\u5730\u4e86\u89e3\u548c<\/p>\n","protected":false},"author":1,"featured_media":3671,"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-31600","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\/31600","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=31600"}],"version-history":[{"count":0,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts\/31600\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/media\/3671"}],"wp:attachment":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/media?parent=31600"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/categories?post=31600"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/tags?post=31600"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}