{"id":124450,"date":"2020-06-09T15:04:02","date_gmt":"2020-06-09T07:04:02","guid":{"rendered":"http:\/\/4563.org\/?p=124450"},"modified":"2020-06-09T15:04:02","modified_gmt":"2020-06-09T07:04:02","slug":"%e6%9c%89%e5%86%99-c-%e8%af%ad%e8%a8%80%e7%9a%84%e5%a4%a7%e4%bd%ac%e5%8f%af%e4%bb%a5%e5%b8%ae%e5%bf%99%e6%8a%8a%e8%bf%99%e4%b8%aa%e5%87%bd%e6%95%b0%e8%bd%ac%e6%88%90-java-%e7%9a%84%e5%ae%9e%e7%8e%b0","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=124450","title":{"rendered":"\u6709\u5199 C \u8bed\u8a00\u7684\u5927\u4f6c\u53ef\u4ee5\u5e2e\u5fd9\u628a\u8fd9\u4e2a\u51fd\u6570\u8f6c\u6210 Java \u7684\u5b9e\u73b0\u5417"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u6709\u5199 C \u8bed\u8a00\u7684\u5927\u4f6c\u53ef\u4ee5\u5e2e\u5fd9\u628a\u8fd9\u4e2a\u51fd\u6570\u8f6c\u6210 Java \u7684\u5b9e\u73b0\u5417               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ivancai <\/span>  <span><i><\/i> 5<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\">                        WORD ModbusCRC(BYTE * pData, BYTE len)<br \/>{<br \/>BYTE byCRCHi = 0xff;<br \/>BYTE byCRCLo = 0xff;<br \/>BYTE byIdx;<br \/>WORD crc;<br \/>while(len&#8211;)<br \/>{<br \/>byIdx = byCRCHi ^* pData++;<br \/>byCRCHi = byCRCLo ^ gabyCRCHi[byIdx];<br \/>byCRCLo = gabyCRCLo[byIdx];<br \/>}<br \/>crc = byCRCHi;<br \/>crc &lt;&lt;= 8;<br \/>crc += byCRCLo;<br \/>return crc;<br \/>}<br \/>BYTE gabyCRCHi[] =<br \/>{<br \/>0x00,0xc1,0x81,0x40,0x01,0xc0,0x80,0x41,0x01,0xc0,<br \/>0x80,0x41,0x00,0xc1,0x81,0x40,0x01,0xc0,0x80,0x41,<br \/>0x00,0xc1,0x81,0x40,0x00,0xc1,0x81,0x40,0x01,0xc0,<br \/>0x80,0x41,0x01,0xc0,0x80,0x41,0x00,0xc1,0x81,0x40,<br \/>0x00,0xc1,0x81,0x40,0x01,0xc0,0x80,0x41,0x00,0xc1,<br \/>0x81,0x40,0x01,0xc0,0x80,0x41,0x01,0xc0,0x80,0x41,<br \/>0x00,0xc1,0x81,0x40,0x01,0xc0,0x80,0x41,0x00,0xc1,<br \/>0x81,0x40,0x00,0xc1,0x81,0x40,0x01,0xc0,0x80,0x41,<br \/>0x00,0xc1,0x81,0x40,0x01,0xc0,0x80,0x41,0x01,0xc0,<br \/>0x80,0x41,0x00,0xc1,0x81,0x40,0x00,0xc1,0x81,0x40,<br \/>0x01,0xc0,0x80,0x41,0x01,0xc0,0x80,0x41,0x00,0xc1,<br \/>0x81,0x40,0x01,0xc0,0x80,0x41,0x00,0xc1,0x81,0x40,<br \/>0x00,0xc1,0x81,0x40,0x01,0xc0,0x80,0x41,0x01,0xc0,<br \/>0x80,0x41,0x00,0xc1,0x81,0x40,0x00,0xc1,0x81,0x40,<br \/>0x01,0xc0,0x80,0x41,0x00,0xc1,0x81,0x40,0x01,0xc0,<br \/>0x80,0x41,0x01,0xc0,0x80,0x41,0x00,0xc1,0x81,0x40,<br \/>0x00,0xc1,0x81,0x40,0x01,0xc0,0x80,0x41,0x01,0xc0,<br \/>0x80,0x41,0x00,0xc1,0x81,0x40,0x01,0xc0,0x80,0x41,<br \/>0x00,0xc1,0x81,0x40,0x00,0xc1,0x81,0x40,0x01,0xc0,<br \/>0x80,0x41,0x00,0xc1,0x81,0x40,0x01,0xc0,0x80,0x41,<br \/>0x01,0xc0,0x80,0x41,0x00,0xc1,0x81,0x40,0x01,0xc0,<br \/>0x80,0x41,0x00,0xc1,0x81,0x40,0x00,0xc1,0x81,0x40,<br \/>0x01,0xc0,0x80,0x41,0x01,0xc0,0x80,0x41,0x00,0xc1,<br \/>0x81,0x40,0x00,0xc1,0x81,0x40,0x01,0xc0,0x80,0x41,<br \/>0x00,0xc1,0x81,0x40,0x01,0xc0,0x80,0x41,0x01,0xc0,<br \/>0x80,0x41,0x00,0xc1,0x81,0x40<\/p>\n<p>};<\/p>\n<p>BYTE gabyCRCLo[] =<br \/>{<br \/>0x00,0xc0,0xc1,0x01,0xc3,0x03,0x02,0xc2,0xc6,0x06,<br \/>0x07,0xc7,0x05,0xc5,0xc4,0x04,0xcc,0x0c,0x0d,0xcd,<br \/>0x0f,0xcf,0xce,0x0e,0x0a,0xca,0xcb,0x0b,0xc9,0x09,<br \/>0x08,0xc8,0xd8,0x18,0x19,0xd9,0x1b,0xdb,0xda,0x1a,<br \/>0x1e,0xde,0xdf,0x1f,0xdd,0x1d,0x1c,0xdc,0x14,0xd4,<br \/>0xd5,0x15,0xd7,0x17,0x16,0xd6,0xd2,0x12,0x13,0xd3,<br \/>0x11,0xd1,0xd0,0x10,0xf0,0x30,0x31,0xf1,0x33,0xf3,<br \/>0xf2,0x32,0x36,0xf6,0xf7,0x37,0xf5,0x35,0x34,0xf4,<br \/>0x3c,0xfc,0xfd,0x3d,0xff,0x3f,0x3e,0xfe,0xfa,0x3a,<br \/>0x3b,0xfb,0x39,0xf9,0xf8,0x38,0x28,0xe8,0xe9,0x29,<br \/>0xeb,0x2b,0x2a,0xea,0xee,0x2e,0x2f,0xef,0x2d,0xed,<br \/>0xec,0x2c,0xe4,0x24,0x25,0xe5,0x27,0xe7,0xe6,0x26,<br \/>0x22,0xe2,0xe3,0x23,0xe1,0x21,0x20,0xe0,0xa0,0x60,<br \/>0x61,0xa1,0x63,0xa3,0xa2,0x62,0x66,0xa6,0xa7,0x67,<br \/>0xa5,0x65,0x64,0xa4,0x6c,0xac,0xad,0x6d,0xaf,0x6f,<br \/>0x6e,0xae,0xaa,0x6a,0x6b,0xab,0x69,0xa9,0xa8,0x68,<br \/>0x78,0xb8,0xb9,0x79,0xbb,0x7b,0x7a,0xba,0xbe,0x7e,<br \/>0x7f,0xbf,0x7d,0xbd,0xbc,0x7c,0xb4,0x74,0x75,0xb5,<br \/>0x77,0xb7,0xb6,0x76,0x72,0xb2,0xb3,0x73,0xb1,0x71,<br \/>0x70,0xb0,0x50,0x90,0x91,0x51,0x93,0x53,0x52,0x92,<br \/>0x96,0x56,0x57,0x97,0x55,0x95,0x94,0x54,0x9c,0x5c,<br \/>0x5d,0x9d,0x5f,0x9f,0x9e,0x5e,0x5a,0x9a,0x9b,0x5b,<br \/>0x99,0x59,0x58,0x98,0x88,0x48,0x49,0x89,0x4b,0x8b,<br \/>0x8a,0x4a,0x4e,0x8e,0x8f,0x4f,0x8d,0x4d,0x4c,0x8c,<br \/>0x44,0x84,0x85,0x45,0x87,0x47,0x46,0x86,0x82,0x42,<br \/>0x43,0x83,0x41,0x81,0x80,0x40<br \/>};     <\/p>\n<div>\u4e13\u5fc3\u81f4\u5fd7\u7684\u6574\u7406\u4e1c\u897f\u53ef\u4ee5\u8ba9\u5fc3\u60c5\u53d8\u597d<\/a><\/h6>\n<h6>\u4e0b\u4e00\u7bc7\uff1aiOS \u5982\u4f55\u4f7f\u7528 Google \u8054\u7cfb\u4eba<\/h6>\n<\/div><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>9<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"2166232\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : zhujian198 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             github \u641c\u7d22\u4e0b\u5c31\u6709\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2166233\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : justin2018 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             ![SEuARj8]( <img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/06\/20200627_5ef7b93251050.jpg\" rel=\"noreferrer\" alt=\"\u6709\u5199 C \u8bed\u8a00\u7684\u5927\u4f6c\u53ef\u4ee5\u5e2e\u5fd9\u628a\u8fd9\u4e2a\u51fd\u6570\u8f6c\u6210 Java \u7684\u5b9e\u73b0\u5417\">)                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2166234\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Harv <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u7ed9\u4f60\u51e0\u4e2a\u5173\u952e\u8bcd\u4f60\u53bb\u641c\u4e0b\uff1aCRC16 MODBUS \u6807\u51c6 \u67e5\u8868\u6cd5 java \u5b9e\u73b0                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2166235\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : xdtr <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u67e5\u8868\u6cd5\u8ba1\u7b97 crc \u561b\u3002\u51fd\u6570\u53c2\u6570\u91cc*pData \u662f\u9700\u8981\u8ba1\u7b97 crc \u7684\u6570\u7ec4\uff0clen \u662f\u6570\u7ec4\u957f\u5ea6\u3002<br \/>* pData++ \u662f\u8bf4\u4ece pData \u53d6\u6570\u636e\u5e76\u5c06\u4e0b\u6807\u524d\u8fdb\u4e00\u4e2a\u5b57\u8282\u3002<br \/>\u5176\u4ed6\u7684\u5c31\u6ca1\u5565\u597d\u8bf4\u7684\u5566\uff0c\u67e5\u8868\u540e\u5f02\u6216\u8fd0\u7b97\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2166236\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : waruqi <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6211\u89c9\u5f97\u4f60\u8fd9\u5f97\u95ee java \u5927\u4f6c~                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2166237\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : oneisall8955 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             JAVA CRC \u7b97\u6cd5\u5b9e\u73b0\uff1f\u770b\u8fd9\u4e2a\u8868\u5f88\u719f\u6089\u7684\u611f\u89c9\uff0c\u4ee5\u524d\u5b9e\u4e60\u65f6\u5019\u7528\u8fc7\uff0c\u8c8c\u4f3c\u7528\u4e8e\u6821\u9a8c\u6570\u636e\u5b8c\u6574\u6027                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2166238\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : ivancai <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8c22\u8c22\u5404\u4f4d\uff0c\u89e3\u51b3\u4e86\uff01                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2166239\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : shawndev <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e4b\u524d\u4e00\u6837\u7684\u4ee3\u7801\uff0c\u9700\u6c42\u662f java \u91cd\u5199\u5230 c \u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2166240\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : jimmyismagic <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u53ef\u4ee5\u7528 jni \u554a\uff0c\u8fd8\u5feb                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u6709\u5199 C \u8bed\u8a00\u7684\u5927\u4f6c\u53ef\u4ee5\u5e2e\u5fd9\u628a\u8fd9\u4e2a&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/124450"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=124450"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/124450\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=124450"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=124450"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=124450"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}