{"id":43160,"date":"2023-10-02T05:27:49","date_gmt":"2023-10-01T21:27:49","guid":{"rendered":"https:\/\/www.techphant.cn\/?p=43160"},"modified":"2023-10-02T05:27:49","modified_gmt":"2023-10-01T21:27:49","slug":"fsyfjxcktx","status":"publish","type":"post","link":"https:\/\/www.techphant.cn\/blog\/43160.html","title":{"rendered":"Flutter_libserialport\uff1a\u4f7f\u7528Flutter\u8fdb\u884c\u4e32\u53e3\u901a\u4fe1"},"content":{"rendered":"

  Flutter_libserialport\u662f\u4e00\u4e2a\u4f7f\u7528Flutter\u8fdb\u884c\u4e32\u53e3\u901a\u4fe1\u7684\u5e93\uff0c\u5b83\u53ef\u4ee5\u8ba9\u5f00\u53d1\u8005\u5feb\u901f\u6784\u5efa\u4e32\u53e3\u901a\u4fe1\u5e94\u7528\u7a0b\u5e8f\u3002\u5b83\u652f\u6301\u591a\u79cd\u4e32\u53e3\u63a5\u53e3\uff0c\u6bd4\u5982RS-232\u3001RS-422\u3001RS-485\u7b49\u3002\u5b83\u8fd8\u652f\u6301\u591a\u4e2a\u5e73\u53f0\uff0c\u5305\u62ecWindows\u3001Linux\u3001Mac OS X\u548cAndroid\u7b49\u3002\u672c\u6587\u5c06\u4ecb\u7ecdFlutter_libserialport\u7684\u57fa\u672c\u6982\u5ff5\uff0c\u4ee5\u53ca\u5982\u4f55\u4f7f\u7528\u5b83\u6765\u5b9e\u73b0\u4e32\u53e3\u901a\u4fe1\u3002<\/p>\n

Flutter_libserialport\u7b80\u4ecb<\/h2>\n

  Flutter_libserialport\u662f\u4e00\u4e2a\u7528\u4e8eFlutter\u5e94\u7528\u7a0b\u5e8f\u7684\u4e32\u53e3\u901a\u4fe1\u5e93\uff0c\u5b83\u652f\u6301\u591a\u79cd\u4e32\u53e3\u63a5\u53e3\uff0c\u6bd4\u5982RS-232\u3001RS-422\u3001RS-485\u7b49\u3002\u5b83\u53ef\u4ee5\u8ba9\u5f00\u53d1\u8005\u901a\u8fc7Flutter\u6765\u5b9e\u73b0\u4e32\u53e3\u901a\u4fe1\uff0c\u6bd4\u5982\u53ef\u4ee5\u7528\u5b83\u6765\u63a7\u5236\u4e32\u53e3\u8bbe\u5907\uff0c\u53d1\u9001\u548c\u63a5\u6536\u4e32\u53e3\u6570\u636e\uff0c\u4ee5\u53ca\u5b9e\u73b0\u4e32\u53e3\u8bbe\u5907\u4e4b\u95f4\u7684\u901a\u4fe1\u3002\u5b83\u8fd8\u652f\u6301\u591a\u4e2a\u5e73\u53f0\uff0c\u5305\u62ecWindows\u3001Linux\u3001Mac OS X\u548cAndroid\u7b49\u3002<\/p>\n

Flutter_libserialport\u7684\u5b89\u88c5\u4e0e\u4f7f\u7528<\/h2>\n

  \u5b89\u88c5<\/h3>\n

  \u8981\u5b89\u88c5Flutter_libserialport\uff0c\u9996\u5148\u9700\u8981\u5b89\u88c5Flutter SDK\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u5728pubspec.yaml\u6587\u4ef6\u4e2d\u6dfb\u52a0libserialport\u4f9d\u8d56\uff1a<\/p>\n

dependencies:

  flutter_libserialport: ^0.1.0<\/p><\/code><\/pre>\n

  \u7136\u540e\uff0c\u5728\u7ec8\u7aef\u4e2d\u8fd0\u884cflutter pub get\u547d\u4ee4\uff0c\u5373\u53ef\u5b8c\u6210\u5b89\u88c5\u3002<\/p>\n

  \u4f7f\u7528<\/h3>\n

  \u8981\u4f7f\u7528Flutter_libserialport\uff0c\u9996\u5148\u9700\u8981\u5f15\u5165\u5b83\uff1a<\/p>\n

import 'package:flutter_libserialport\/flutter_libserialport.dart'; <\/code><\/pre>\n

  \u7136\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528SerialPort\u7c7b\u6765\u5b9e\u73b0\u4e32\u53e3\u901a\u4fe1\uff0c\u5b83\u63d0\u4f9b\u4e86\u4e00\u7cfb\u5217\u7684API\uff0c\u53ef\u4ee5\u7528\u6765\u63a7\u5236\u4e32\u53e3\u8bbe\u5907\uff0c\u53d1\u9001\u548c\u63a5\u6536\u4e32\u53e3\u6570\u636e\uff0c\u4ee5\u53ca\u5b9e\u73b0\u4e32\u53e3\u8bbe\u5907\u4e4b\u95f4\u7684\u901a\u4fe1\u3002<\/p>\n

\u603b\u7ed3<\/h2>\n

  \u672c\u6587\u4ecb\u7ecd\u4e86Flutter_libserialport\u7684\u57fa\u672c\u6982\u5ff5\uff0c\u4ee5\u53ca\u5982\u4f55\u4f7f\u7528\u5b83\u6765\u5b9e\u73b0\u4e32\u53e3\u901a\u4fe1\u3002<\/strong>\u5b83\u53ef\u4ee5\u8ba9\u5f00\u53d1\u8005\u901a\u8fc7Flutter\u5feb\u901f\u6784\u5efa\u4e32\u53e3\u901a\u4fe1\u5e94\u7528\u7a0b\u5e8f\uff0c\u652f\u6301\u591a\u79cd\u4e32\u53e3\u63a5\u53e3\uff0c\u6bd4\u5982RS-232\u3001RS-422\u3001RS-485\u7b49\uff0c\u4ee5\u53ca\u591a\u4e2a\u5e73\u53f0\uff0c\u5305\u62ecWindows\u3001Linux\u3001Mac OS X\u548cAndroid\u7b49\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

Flutter_libserialport\u662f\u4e00\u4e2a\u4f7f\u7528Flutter\u8fdb\u884c\u4e32\u53e3\u901a\u4fe1\u7684\u5e93\uff0c\u5b83\u53ef\u4ee5\u8ba9\u5f00\u53d1\u8005\u5feb\u901f\u6784\u5efa\u4e32\u53e3\u901a\u4fe1\u5e94\u7528\u7a0b\u5e8f\u3002\u5b83\u652f\u6301\u591a\u79cd\u4e32\u53e3\u63a5\u53e3\uff0c\u6bd4\u5982RS-232\u3001RS-4<\/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-43160","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\/43160","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=43160"}],"version-history":[{"count":0,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts\/43160\/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=43160"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/categories?post=43160"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/tags?post=43160"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}