{"id":65127,"date":"2025-05-03T12:24:04","date_gmt":"2025-05-03T04:24:04","guid":{"rendered":"https:\/\/fwq.ai\/blog\/65127\/"},"modified":"2025-05-03T12:24:04","modified_gmt":"2025-05-03T04:24:04","slug":"%e5%ae%89%e5%8d%93%e4%b8%b2%e5%8f%a3%e9%80%9a%e4%bf%a1%e6%8e%a5%e6%94%b6%e6%95%b0%e6%8d%ae%e6%97%b6%e6%9c%89%e6%97%b6%e6%97%a0%ef%bc%8c%e5%a6%82%e4%bd%95%e8%a7%a3%e5%86%b3%ef%bc%9f-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/65127\/","title":{"rendered":"\u5b89\u5353\u4e32\u53e3\u901a\u4fe1\u63a5\u6536\u6570\u636e\u65f6\u6709\u65f6\u65e0\uff0c\u5982\u4f55\u89e3\u51b3\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173116046935123.jpg\" class=\"aligncenter\" title=\"\u5b89\u5353\u4e32\u53e3\u901a\u4fe1\u63a5\u6536\u6570\u636e\u65f6\u6709\u65f6\u65e0\uff0c\u5982\u4f55\u89e3\u51b3\uff1f\u63d2\u56fe\" alt=\"\u5b89\u5353\u4e32\u53e3\u901a\u4fe1\u63a5\u6536\u6570\u636e\u65f6\u6709\u65f6\u65e0\uff0c\u5982\u4f55\u89e3\u51b3\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u4e32\u53e3\u901a\u4fe1\u63a5\u6536\u6570\u636e\u7684\u96be\u9898<\/strong><\/p>\n<p>\u5728\u5b89\u5353\u5f00\u53d1\u4e2d\uff0c\u4f7f\u7528\u4e32\u53e3\u901a\u4fe1\u65f6\uff0c\u63a5\u6536\u6570\u636e\u53ef\u80fd\u5b58\u5728\u65f6\u6709\u65f6\u65e0\u7684\u95ee\u9898\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u5e38\u89c1\u573a\u666f\uff1a<\/p>\n<p>\u5728\u53d1\u9001\u6307\u4ee4\u540e\uff0condatareceive \u51fd\u6570\u6709\u65f6\u6ca1\u6709\u6536\u5230\u6570\u636e\uff0c\u5bfc\u81f4 mnactivity.setgaszero3 \u4e3a null\u3002\u5c3d\u7ba1\u7b2c\u4e09\u65b9\u4e32\u53e3\u5de5\u5177\u53ef\u4ee5\u6b63\u5e38\u63a5\u6536\u6570\u636e\uff0c\u4f46\u5b89\u5353\u5e94\u7528\u7a0b\u5e8f\u5374\u5e76\u975e\u603b\u662f\u5982\u6b64\u3002\u8fd9\u53ef\u80fd\u662f\u7531\u4e8e\u4ee5\u4e0b\u539f\u56e0\u9020\u6210\u7684\uff1a<\/p>\n<p><strong>\u7f13\u51b2\u533a\u5ef6\u8fdf\u95ee\u9898<\/strong><\/p>\n<p>\u4e32\u53e3\u901a\u4fe1\u6d89\u53ca\u7f13\u51b2\u533a\uff0c\u6570\u636e\u5728\u5230\u8fbe\u5e94\u7528\u7a0b\u5e8f\u4e4b\u524d\u4f1a\u5b58\u50a8\u5728\u5176\u4e2d\u3002\u5f53\u6570\u636e\u91cf\u8f83\u5927\u6216\u4f20\u8f93\u901f\u5ea6\u8f83\u6162\u65f6\uff0c\u7f13\u51b2\u533a\u53ef\u80fd\u65e0\u6cd5\u7acb\u5373\u83b7\u53d6\u6570\u636e\u3002\u8fd9\u4f1a\u5bfc\u81f4 ondatareceive \u51fd\u6570\u6709\u65f6\u65e0\u6cd5\u6536\u5230\u6570\u636e\u3002<\/p>\n<p><strong>\u89e3\u51b3\u65b9\u6848\uff1a\u52a0\u5165\u5ef6\u65f6<\/strong><\/p>\n<p>\u4e3a\u4e86\u89e3\u51b3\u7f13\u51b2\u533a\u5ef6\u8fdf\u95ee\u9898\uff0c\u5728 ondatareceive \u51fd\u6570\u4e2d\u52a0\u5165\u5ef6\u65f6\u53ef\u4ee5\u63d0\u4f9b\u5145\u8db3\u7684\u65f6\u95f4\u8ba9\u7f13\u51b2\u533a\u586b\u5145\u6570\u636e\u3002\u4f8b\u5982\uff1a<\/p>\n<pre>@Override\npublic void onDataReceive(byte[] bytes, int i) {\n    if (bytes != null &amp;&amp; bytes.length != 0) {\n        try {\n            Thread.sleep(100);  \/\/ \u52a0\u5165 100 \u6beb\u79d2\u5ef6\u65f6\n        } catch (InterruptedException e) {\n            e.printStackTrace();\n        }\n        if (bytes[0] == 1 &amp;&amp; bytes[1] == 3) {\n            MainActivity.setGaszero = bytes;\n        }\n    }\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u5176\u4ed6\u53ef\u80fd\u7684\u539f\u56e0<\/strong><\/p>\n<p>\u9664\u4e86\u7f13\u51b2\u533a\u5ef6\u8fdf\u4e4b\u5916\uff0c\u8fd8\u6709\u5176\u4ed6\u53ef\u80fd\u7684\u539f\u56e0\u5bfc\u81f4 ondatareceive \u51fd\u6570\u65e0\u6cd5\u6536\u5230\u6570\u636e\uff0c\u4f8b\u5982\uff1a<\/p>\n<ul>\n<li>\u4e32\u53e3\u914d\u7f6e\u9519\u8bef<\/li>\n<li>\u6570\u636e\u683c\u5f0f\u4e0d\u5339\u914d<\/li>\n<li>\u901a\u4fe1\u901f\u7387\u8fc7\u9ad8\u6216\u8fc7\u4f4e<\/li>\n<\/ul>\n<p>\u4ed4\u7ec6\u68c0\u67e5\u8fd9\u4e9b\u56e0\u7d20\u53ef\u4ee5\u5e2e\u52a9\u8bca\u65ad\u548c\u89e3\u51b3\u95ee\u9898\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5b89\u5353\u4e32\u53e3\u901a\u4fe1\u63a5\u6536\u6570\u636e\u65f6\u6709\u65f6\u65e0\uff0c\u5982\u4f55\u89e3\u51b3\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8IDCBABY\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e32\u53e3\u901a\u4fe1\u63a5\u6536\u6570\u636e\u7684\u96be\u9898 \u5728\u5b89\u5353\u5f00\u53d1\u4e2d\uff0c\u4f7f\u7528\u4e32\u53e3\u901a\u4fe1\u65f6\uff0c\u63a5\u6536\u6570\u636e\u53ef\u80fd\u5b58\u5728\u65f6\u6709\u65f6\u65e0\u7684\u95ee\u9898\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u5e38\u89c1\u573a\u666f\uff1a \u5728\u53d1\u9001\u6307\u4ee4\u540e\uff0condatareceive \u51fd\u6570\u6709\u65f6\u6ca1\u6709\u6536\u5230\u6570\u636e\uff0c\u5bfc\u81f4 mnactivity.setgaszero3 \u4e3a null\u3002\u5c3d\u7ba1\u7b2c\u4e09\u65b9\u4e32\u53e3\u5de5\u5177\u53ef\u4ee5\u6b63\u5e38\u63a5\u6536\u6570\u636e\uff0c\u4f46\u5b89\u5353\u5e94\u7528\u7a0b\u5e8f\u5374\u5e76\u975e\u603b\u662f\u5982\u6b64\u3002\u8fd9\u53ef\u80fd\u662f\u7531\u4e8e\u4ee5\u4e0b\u539f\u56e0\u9020\u6210\u7684\uff1a \u7f13\u51b2\u533a\u5ef6\u8fdf\u95ee\u9898 \u4e32\u53e3\u901a\u4fe1\u6d89\u53ca\u7f13\u51b2\u533a\uff0c\u6570\u636e\u5728\u5230\u8fbe\u5e94\u7528\u7a0b\u5e8f\u4e4b\u524d\u4f1a\u5b58\u50a8\u5728\u5176\u4e2d\u3002\u5f53\u6570\u636e\u91cf\u8f83\u5927\u6216\u4f20\u8f93\u901f\u5ea6\u8f83\u6162\u65f6\uff0c\u7f13\u51b2\u533a\u53ef\u80fd\u65e0\u6cd5\u7acb\u5373\u83b7\u53d6\u6570\u636e\u3002\u8fd9\u4f1a\u5bfc\u81f4 ondatareceive \u51fd\u6570\u6709\u65f6\u65e0\u6cd5\u6536\u5230\u6570\u636e\u3002 \u89e3\u51b3\u65b9\u6848\uff1a\u52a0\u5165\u5ef6\u65f6 \u4e3a\u4e86\u89e3\u51b3\u7f13\u51b2\u533a\u5ef6\u8fdf\u95ee\u9898\uff0c\u5728 ondatareceive \u51fd\u6570\u4e2d\u52a0\u5165\u5ef6\u65f6\u53ef\u4ee5\u63d0\u4f9b\u5145\u8db3\u7684\u65f6\u95f4\u8ba9\u7f13\u51b2\u533a\u586b\u5145\u6570\u636e\u3002\u4f8b\u5982\uff1a @Override public void onDataReceive(byte[] bytes, int i) { if (bytes != null &amp;&amp; bytes.length != 0) { try { Thread.sleep(100); \/\/ \u52a0\u5165 100 \u6beb\u79d2\u5ef6\u65f6 } catch (InterruptedException e) { e.printStackTrace(); } if (bytes[0] == 1 &amp;&amp; bytes[1] == 3) { [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-65127","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/65127","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=65127"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/65127\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=65127"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=65127"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=65127"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}