{"id":11643,"date":"2024-07-17T13:29:52","date_gmt":"2024-07-17T05:29:52","guid":{"rendered":"https:\/\/www.tosunai.com\/?p=11643"},"modified":"2024-07-17T14:51:43","modified_gmt":"2024-07-17T06:51:43","slug":"tsmaster-rpc-programming-guide-and-instructions","status":"publish","type":"post","link":"https:\/\/www.tosunai.com\/tsmaster-rpc-programming-guide-and-instructions\/","title":{"rendered":"\u5e72\u8d27\u5206\u4eab | TSMaster RPC \u57fa\u7840\u5165\u95e8\uff1a\u7f16\u7a0b\u6307\u5bfc\u548c\u4f7f\u7528\u8bf4\u660e"},"content":{"rendered":"\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t

\u4ecb\u7ecdRPC\u6a21\u5757\u524d\uff0c\u6211\u4eec\u5148\u6d45\u804a\u4e00\u4e0bRPC\u7684\u76f8\u5173\u8bf4\u660e\uff0c\u4ee5\u53ca\u5728\u4ec0\u4e48\u6837\u7684\u60c5\u51b5\u4e0b\u9700\u8981\u4e86\u89e3\u672c\u6587 \u3002<\/p>

  1. RPC \u8bf4\u660e
    <\/strong>\u8fdc\u7a0b\u8fc7\u7a0b\u8c03\u7528\uff08RPC, Remote Procedure Call\uff09\u662f\u4e00\u79cd\u7f51\u7edc\u901a\u4fe1\u534f\u8bae\uff0c\u4f7f\u5f97\u7a0b\u5e8f\u53ef\u4ee5\u8c03\u7528\u53e6\u4e00\u53f0\u8ba1\u7b97\u673a\u4e0a\u7684\u7a0b\u5e8f\u6216\u670d\u52a1\uff0c\u5c31\u50cf\u8c03\u7528\u672c\u5730\u7684\u7a0b\u5e8f\u4e00\u6837\u3002RPC \u7684\u4e3b\u8981\u76ee\u7684\u662f\u7b80\u5316\u5206\u5e03\u5f0f\u8ba1\u7b97\uff0c\u4f7f\u5f97\u5f00\u53d1\u8005\u65e0\u9700\u5173\u6ce8\u5e95\u5c42\u7684\u7f51\u7edc\u901a\u4fe1\u7ec6\u8282\u3002

    <\/li>
  2. \u4ec0\u4e48\u60c5\u51b5\u4e0b\u9700\u8981\u4e86\u89e3\u6b64\u6587\u7ae0\uff1f
    <\/strong>\u7528\u6237\u57fa\u4e8e TSMaster \u5f00\u53d1\u4e86\u5bf9\u5e94\u7684\u5e94\u7528\u5de5\u7a0b\uff0c\u60f3\u5728\u5916\u90e8\u7a0b\u5e8f\u4e2d\u81ea\u52a8\u5316\u63a7\u5236TSMaster\uff0c\u53ef\u4ee5\u67e5\u9605\u6b64\u6587\u7ae0\u3002\uff08\u5907\u6ce8\uff1a\u9664\u4e86 RPC\uff0cTSMaster\u8fd8\u63d0\u4f9b\u4e86\u57fa\u4e8eCOM\u7684\u63a5\u53e3\uff0c\u6709\u9700\u6c42\u53ef\u53e6\u884c\u67e5\u9605\u76f8\u5173\u6587\u7ae0\u3002\uff09<\/span>

    \u672c\u6587\u9002\u7528\u7a0b\u63a7\u6a21\u5f0f\uff1aTSMaster1 \u63a7\u5236 TSMaster2\uff0c\u6216\u8005\u5176\u4ed6\u8fdb\u7a0b\u63a7\u5236 TSMaster \u8fdb\u7a0b\uff08\u4f7f\u7528 TSMaster.dll\uff09\u9002\u7528\u4e8e\u8bed\u8a00:C++ \u3001Python\u3001 C#\u7b49\u8bed\u8a00\u3002<\/li><\/ol><\/section><\/section><\/section><\/section>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t
    \n\t\t\t\t\t
    \n\t\t
    \n\t\t\t\t
    \n\t\t\t\t
    \n\t\t\t
    \u672c\u6587\u76ee\u5f55<\/h6>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
    \n\t\t\t\t
    \n\t\t\t\t\t
    \n\t\t\t
    \n\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t
    \n\t\t\t
    \n\t\t\t\t<\/path><\/svg>\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t
    \n\t\t\t\t\t
    \n\t\t
    \n\t\t\t\t
    \n\t\t\t\t
    \n\t\t\t

    01 | RPC\u7684\u57fa\u672c\u6982\u5ff5<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
    \n\t\t\t\t
    \n\t\t\t\t\t\t\t

    \u5ba2\u6237\u7aef\u548c\u670d\u52a1\u5668\uff1a<\/strong><\/p>

    \u5ba2\u6237\u7aef\uff1a\u53d1\u8d77 RPC \u8bf7\u6c42\u7684\u7a0b\u5e8f\u3002<\/p>

    \u670d\u52a1\u5668\uff1a\u63a5\u6536 RPC \u8bf7\u6c42\u5e76\u6267\u884c\u76f8\u5e94\u8fc7\u7a0b\u7684\u7a0b\u5e8f\u3002<\/p>

    \u00a0<\/p>

    \u4ee3\u7406:<\/strong><\/p>

    \u5ba2\u6237\u7aef\u4ee3\u7406\uff1a\u5c01\u88c5\u8bf7\u6c42\u5e76\u5c06\u5176\u53d1\u9001\u5230\u670d\u52a1\u5668\u3002<\/p>

    \u670d\u52a1\u5668\u4ee3\u7406\uff1a\u63a5\u6536\u8bf7\u6c42\uff0c\u89e3\u5305\u5e76\u8c03\u7528\u672c\u5730\u8fc7\u7a0b\uff0c\u4e4b\u540e\u5c06\u7ed3\u679c\u8fd4\u56de\u7ed9\u5ba2\u6237\u7aef\u4ee3\u7406\u3002<\/p>

    \u00a0<\/p>

    \u901a\u4fe1\u673a\u5236:<\/strong><\/p>

    \u4f20\u8f93\u534f\u8bae\uff1a\u5e95\u5c42\u4f7f\u7528\u7684\u534f\u8bae\uff0c\u6bd4\u5982 TCP\u3001UDP\u3002<\/p>

    \u6570\u636e\u5e8f\u5217\u5316\uff1a\u5c06\u6570\u636e\u7ed3\u6784\u6216\u5bf9\u8c61\u8f6c\u6362\u6210\u53ef\u4ee5\u4f20\u8f93\u7684\u683c\u5f0f\uff0c\u6bd4\u5982 JSON\u3001XML\u3001Protocol\u00a0Buffers\u3002<\/p>

    \u00a0<\/p>

    RPC \u5de5\u4f5c\u6d41\u7a0b:<\/strong><\/p>

    • \u5ba2\u6237\u7aef\u8c03\u7528\u672c\u5730\u4ee3\u7406\u65b9\u6cd5\uff1a\u5ba2\u6237\u7aef\u8c03\u7528\u4e00\u4e2a\u770b\u4f3c\u672c\u5730\u7684\u65b9\u6cd5\uff0c\u4f46\u5b9e\u9645\u4e0a\u8fd9\u4e2a\u65b9\u6cd5\u7531\u5ba2\u6237\u7aef\u4ee3\u7406\u8d1f\u8d23\u5904\u7406\uff1b<\/li>
    • \u5ba2\u6237\u7aef\u4ee3\u7406\u5e8f\u5217\u5316\u8bf7\u6c42\uff1a\u5c06\u65b9\u6cd5\u540d\u3001\u53c2\u6570\u7b49\u4fe1\u606f\u6253\u5305\u6210\u6d88\u606f\uff1b<\/li>
    • \u6d88\u606f\u4f20\u8f93\uff1a\u5ba2\u6237\u7aef\u4ee3\u7406\u5c06\u6d88\u606f\u901a\u8fc7\u7f51\u7edc\u4f20\u8f93\u5230\u670d\u52a1\u5668\uff1b<\/li>
    • \u670d\u52a1\u5668\u4ee3\u7406\u89e3\u5305\u8bf7\u6c42\uff1a\u63a5\u6536\u5230\u6d88\u606f\u540e\uff0c\u670d\u52a1\u5668\u4ee3\u7406\u89e3\u5305\u6d88\u606f\u5e76\u8c03\u7528\u5b9e\u9645\u7684\u672c\u5730\u65b9\u6cd5\uff1b<\/li>
    • \u6267\u884c\u65b9\u6cd5\u5e76\u751f\u6210\u54cd\u5e94\uff1a\u672c\u5730\u65b9\u6cd5\u6267\u884c\u5b8c\u6bd5\u540e\uff0c\u751f\u6210\u54cd\u5e94\u7ed3\u679c\uff1b<\/li>
    • \u670d\u52a1\u5668\u4ee3\u7406\u6253\u5305\u54cd\u5e94\uff1a\u670d\u52a1\u5668\u4ee3\u7406\u5c06\u7ed3\u679c\u6253\u5305\u6210\u6d88\u606f\u5e76\u901a\u8fc7\u7f51\u7edc\u53d1\u9001\u56de\u5ba2\u6237\u7aef\uff1b<\/li>
    • \u5ba2\u6237\u7aef\u4ee3\u7406\u89e3\u5305\u54cd\u5e94\uff1a\u5ba2\u6237\u7aef\u4ee3\u7406\u63a5\u6536\u5230\u54cd\u5e94\u6d88\u606f\u540e\uff0c\u89e3\u5305\u5e76\u5c06\u7ed3\u679c\u8fd4\u56de\u7ed9\u5ba2\u6237\u7aef\u3002<\/li><\/ul>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t
      \n\t\t\t\t\t
      \n\t\t
      \n\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t

      02\u3001TSMaster RPC \u5e94\u7528\n\n<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t\t\t\t\t

      1\uff5cRPC \u529f\u80fd<\/h3>

      \u57fa\u4e8e TSMaster \u7684 RPC \u673a\u5236\uff0c\u7528\u6237\u53ef\u4ee5\u5728 TSMaster \u4e0a\u4f4d\u673a\u73af\u5883\u4e2d\u642d\u5efa\u5b8c\u6574\u7684\u5de5\u7a0b\uff0c\u6db5\u76d6\u4ece\u6d4b\u8bd5\u7528\u4f8b\u5f00\u53d1\u5230\u7a0b\u63a7\u8bbe\u5907\u7ba1\u7406\u3001\u603b\u7ebf\u901a\u8baf\u914d\u7f6e\u4ee5\u53ca\u63a7\u5236\u677f\u5361\u64cd\u4f5c\u7b49\u4e00\u7cfb\u5217\u6d41\u7a0b\u3002\u901a\u8fc7\u8fd9\u4e00\u673a\u5236\uff0c\u7528\u6237\u80fd\u591f\u9ad8\u6548\u5730\u5728\u5ba2\u6237\u7aef\u8fdc\u7a0b\u63a7\u5236 TSMaster \u670d\u52a1\u5668\uff0c\u5b9e\u73b0\u5bf9\u7cfb\u7edf\u53d8\u91cf\u3001CAN \u4fe1\u53f7\u3001LIN \u4fe1\u53f7\u3001FlexRay \u4fe1\u53f7\u4ee5\u53ca\u4ee5\u592a\u7f51\uff08ETH\uff09\u4fe1\u53f7\u7b49\u7684\u8bfb\u5199\u64cd\u4f5c\u3002\u6b64\u5916\uff0c\u7528\u6237\u8fd8\u53ef\u4ee5\u8c03\u7528 TSMaster \u670d\u52a1\u5668\u4e0a\u5b9a\u4e49\u7684\u5404\u79cd\u51fd\u6570<\/span><\/strong>\uff0c\u8fdb\u4e00\u6b65\u6269\u5c55\u548c\u5b9a\u5236\u7cfb\u7edf\u529f\u80fd\u3002<\/p>

      \u00a0<\/p>

      \u8fd9\u79cd\u96c6\u6210\u5316\u7684\u89e3\u51b3\u65b9\u6848\u4f7f\u5f97\u5de5\u7a0b\u7ba1\u7406\u548c\u81ea\u52a8\u5316\u6d4b\u8bd5\u66f4\u52a0\u4fbf\u6377\u548c\u9ad8\u6548\u3002\u7528\u6237\u65e0\u9700\u5728\u591a\u4e2a\u5e73\u53f0\u4e4b\u95f4\u5207\u6362\uff0c\u5373\u53ef\u5b8c\u6210\u5305\u62ec\u786c\u4ef6\u914d\u7f6e\u3001\u4fe1\u53f7\u76d1\u63a7\u3001\u6570\u636e\u91c7\u96c6\u548c\u6d4b\u8bd5\u6267\u884c\u7b49\u590d\u6742\u4efb\u52a1\u3002\u901a\u8fc7TSMaster \u7684 RPC \u673a\u5236\uff0c\u7528\u6237\u5728\u5ba2\u6237\u7aef\u5373\u53ef\u5b9e\u73b0\u5bf9\u670d\u52a1\u5668\u7684\u8fdc\u7a0b\u7a0b\u63a7\uff0c\u7b80\u5316\u4e86\u64cd\u4f5c\u6d41\u7a0b\uff0c\u63d0\u9ad8\u4e86\u6d4b\u8bd5\u548c\u5f00\u53d1\u6548\u7387\uff0c\u786e\u4fdd\u4e86\u7cfb\u7edf\u7684\u7a33\u5b9a\u6027\u548c\u53ef\u9760\u6027\u3002<\/p>


      TSMaster \u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u63a5\u53e3\u548c\u4e30\u5bcc\u7684\u529f\u80fd\u6a21\u5757\uff0c\u7528\u6237\u53ef\u4ee5\u6839\u636e\u9700\u6c42\u7075\u6d3b\u7ec4\u5408\u4f7f\u7528\uff0c\u5b9e\u73b0\u5bf9\u5404\u79cd\u4fe1\u53f7\u548c\u8bbe\u5907\u7684\u7cbe\u7ec6\u63a7\u5236\u548c\u7ba1\u7406\u3002\u8fd9\u79cd\u67b6\u6784\u4e0d\u4ec5\u9002\u7528\u4e8e\u7814\u53d1\u6d4b\u8bd5\u9636\u6bb5\uff0c\u4e5f\u9002\u7528\u4e8e\u751f\u4ea7\u73af\u5883\u4e2d\u7684\u5b9e\u65f6\u76d1\u63a7\u548c\u6545\u969c\u8bca\u65ad\uff0c\u6781\u5927\u63d0\u5347\u4e86\u5de5\u7a0b\u9879\u76ee\u7684\u6574\u4f53\u8d28\u91cf\u548c\u6548\u7387\u3002<\/p>

      \u00a0<\/p>

      \u4e0d\u4ec5\u5982\u6b64\uff0cTSMaster \u7684 RPC \u673a\u5236\u652f\u6301\u591a\u79cd\u62d3\u6251\u7ed3\u6784\uff0c\u4e0d\u4ec5\u53ef\u4ee5\u5b9e\u73b0\u5ba2\u6237\u7aef\u4e0e\u670d\u52a1\u5668\u4e4b\u95f4\u7684\u4e00\u5bf9\u4e00\u901a\u4fe1\uff0c\u8fd8\u80fd\u591f\u5b9e\u73b0\u4ee5\u4e0b\u590d\u6742\u7684\u901a\u4fe1\u62d3\u6251\uff1a<\/p>

      \u00a0<\/p>

      1. \u4e00\u5bf9\u591a (One-to-Many)\uff1a<\/span><\/strong>\u5355\u4e2a\u5ba2\u6237\u7aef\u53ef\u4ee5\u540c\u65f6\u63a7\u5236\u591a\u4e2a TSMaster \u670d\u52a1\u5668\uff0c\u9002\u7528\u4e8e\u9700\u8981\u540c\u65f6\u7ba1\u7406\u591a\u4e2a\u6d4b\u8bd5\u73af\u5883\u6216\u8bbe\u5907\u7684\u60c5\u51b5\u3002<\/li>
      2. \u591a\u5bf9\u4e00 (Many-to-One)\uff1a<\/strong><\/span>\u591a\u4e2a\u5ba2\u6237\u7aef\u53ef\u4ee5\u540c\u65f6\u8fde\u63a5\u5230\u4e00\u4e2a TSMaster \u670d\u52a1\u5668\uff0c\u8fd9\u6837\u4e0d\u540c\u7684\u7528\u6237\u6216\u6d4b\u8bd5\u7cfb\u7edf\u53ef\u4ee5\u5171\u4eab\u540c\u4e00\u4e2a\u670d\u52a1\u5668\u8d44\u6e90\uff0c\u5b9e\u73b0\u534f\u540c\u5de5\u4f5c\u548c\u8d44\u6e90\u5171\u4eab\u3002<\/li>
      3. \u591a\u5bf9\u591a (Many-to-Many)\uff1a<\/strong><\/span>\u591a\u4e2a\u5ba2\u6237\u7aef\u548c\u591a\u4e2a\u670d\u52a1\u5668\u4e4b\u95f4\u53ef\u4ee5\u8fdb\u884c\u7075\u6d3b\u7684\u901a\u4fe1\u548c\u63a7\u5236\uff0c\u6784\u5efa\u590d\u6742\u7684\u5206\u5e03\u5f0f\u6d4b\u8bd5\u548c\u63a7\u5236\u7cfb\u7edf\uff0c\u9002\u7528\u4e8e\u5927\u578b\u5de5\u7a0b\u9879\u76ee\u548c\u5206\u5e03\u5f0f\u6d4b\u8bd5\u73af\u5883\u3002<\/li><\/ol>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
        \n\t\t\t\t
        \n\t\t\t\t\t\t\t\t\t\t\t\t\t\"TSMaster\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
        \n\t\t\t\t
        \n\t\t\t\t\t\t\t

        \u8fd9\u79cd\u7075\u6d3b\u7684\u62d3\u6251\u7ed3\u6784\u4f7f\u5f97 TSMaster \u80fd\u591f\u9002\u5e94\u5404\u79cd\u590d\u6742\u7684\u5de5\u7a0b\u9700\u6c42\uff0c\u65e0\u8bba\u662f\u5728\u5355\u4e00\u9879\u76ee\u4e2d\u8fd8\u662f\u5728\u8de8\u9879\u76ee\u3001\u8de8\u5730\u57df\u7684\u5206\u5e03\u5f0f\u6d4b\u8bd5\u4e2d\uff0c\u90fd\u80fd\u63d0\u4f9b\u9ad8\u6548\u3001\u53ef\u9760\u7684\u89e3\u51b3\u65b9\u6848\u3002\u901a\u8fc7\u8fd9\u79cd\u591a\u6837\u5316\u7684\u901a\u4fe1\u6a21\u5f0f\uff0c\u7528\u6237\u53ef\u4ee5\u6700\u5927\u9650\u5ea6\u5730\u5229\u7528\u786c\u4ef6\u548c\u8f6f\u4ef6\u8d44\u6e90\uff0c\u63d0\u9ad8\u7cfb\u7edf\u7684\u6269\u5c55\u6027\u548c\u7075\u6d3b\u6027\uff0c\u6ee1\u8db3\u4e0d\u540c\u89c4\u6a21\u548c\u590d\u6742\u5ea6\u7684\u5de5\u7a0b\u9879\u76ee\u9700\u6c42\u3002<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t

        \n\t\t\t\t\t
        \n\t\t
        \n\t\t\t\t
        \n\t\t\t\t
        \n\t\t\t

        03\u3001TSMaster RPC \u4f7f\u7528\u8bf4\u660e<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
        \n\t\t\t\t
        \n\t\t\t\t\t\t\t\u57fa\u4e8eRPC\u672c\u8eab\u673a\u5236\uff0cTSMaster\u63d0\u4f9b\u4e86\u76f8\u5e94\u63a5\u53e3\uff0c\u5728\u9700\u8981\u88ab\u7a0b\u63a7\u7684\u5de5\u7a0b\u4e2d\uff0c\u6fc0\u6d3bRPC server\u7aef\uff0c\u4e3a\u7a0b\u63a7\u811a\u672c\u63d0\u4f9b\u76f8\u5e94\u8d44\u6e90\u3002\n\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
        \n\t\t\t\t
        \n\t\t\t\t\t\t\t

        1\uff5c\u6fc0\u6d3b server<\/h3>

        \u5f00\u542fserver\u7aef\u64cd\u4f5c\u5982\u4e0b\uff1a<\/p>

        \u00a0<\/p>

        \u65b0\u5efa\u4e00\u4e2aC\u811a\u672c\uff0c\u5728\u542f\u52a8\u4e8b\u4ef6\u4e2d\u8f93\u5165\u4e0b\u9762\u4ee3\u7801\uff0c\u5373\u8868\u793a\u6fc0\u6d3b\u4e86\u5f53\u524d\u5de5\u7a0b\u7684rpc server rpc_tsmaster_activate_server(true);<\/p>

        \u5b9e\u9645\u4e0a\uff0c\u5728 TSMaster v2024.06.05.1124 \u7248\u672c\u4e4b\u540e\uff0c\u6240\u6709TSMaster\u5de5\u7a0b\u5df2\u7ecf\u9ed8\u8ba4\u6fc0\u6d3b\u4e86RPC\u529f\u80fd\u3002<\/p>

        \u00a0<\/p>

        2\uff5c\u6d3b client<\/h3>

        native_int h; \/\/client \u53e5\u67c4<\/p>

        \/\/\u53c2\u6570 1 \u4e3a\u63d0\u4f9b rpc \u670d\u52a1\u7684 TSMaster \u5e94\u7528\u7a0b\u5e8f\u540d<\/p>

        com.rpc_tsmaster_create_client(\u201cTSMaster\u201d,&h);<\/p>

        \/\/\u6fc0\u6d3b client \u7aef<\/p>

        Com.rpc_tsmaster_activate_client(h,true);<\/p>

        \u00a0<\/p>

        3\uff5c\u4fee\u6539 server \u7aef\u6570\u636e<\/h3>

        3.1 \u542f\u52a8\u505c\u6b62 server \u5de5\u7a0b<\/strong><\/span><\/p>

        \u542f\u52a8\u5de5\u7a0b\uff1a<\/p>

        TSMaster \u5c0f\u7a0b\u5e8f\uff1a<\/p>

        com.rpc_tsmaster_cmd_start_simulation(h);<\/span><\/p>

        API(C\\C++\\C#\\Python):<\/p>

        rpc_tsmaster_cmd_start_simulation(h);<\/span><\/p>

        \u00a0<\/p>

        \u00a0<\/p>

        3.2 \u8bfb\u5199\u7cfb\u7edf\u53d8\u91cf<\/strong><\/span><\/p>

        \u8bbe\u7f6e\u7cfb\u7edf\u53d8\u91cf\uff1a<\/p>

        TSMaster \u5c0f\u7a0b\u5e8f\uff1a<\/p>

        com.rpc_tsmaster_cmd_write_system_var(h, “Var1”, “1.2345”);<\/span><\/p>

        API(C\\C++\\C#\\Python):<\/p>

        rpc_tsmaster_cmd_write_system_var(h,”Var1″,”1.2345″);<\/span><\/p>

        \u00a0<\/p>

        \u83b7\u53d6\u7cfb\u7edf\u53d8\u91cf\uff1a<\/p>

        TSMaster \u5c0f\u7a0b\u5e8f\uff1a<\/p>

        com.rpc_tsmaster_cmd_read_system_var(h, “Var1”, “1.2345”);<\/span><\/p>

        API(C\\C++\\C#\\Python):<\/p>

        rpc_tsmaster_cmd_read_system_var(h,”Var1″,”1.2345″);<\/span><\/p>

        \u00a0<\/p>

        \u00a0<\/p>

        3.3 \u8bfb\u5199 CAN \u4fe1\u53f7<\/span><\/strong><\/p>

        \u8bbe\u7f6e CAN \u4fe1\u53f7\uff1a<\/p>

        TSMaster \u5c0f\u7a0b\u5e8f\uff1a<\/p>

        com.rpc_tsmaster_cmd_set_can_signal(h,”chnidx\/net\/node\/msg\/signal”, 1234)<\/span><\/p>

        API(C\\C++\\C#\\Python):<\/p>

        rpc_tsmaster_cmd_set_can_signal(h,”chnidx\/net\/node\/msg\/signal”, 1234)<\/span><\/p>

        \u00a0<\/p>

        \u83b7\u53d6 CAN \u4fe1\u53f7\uff1a<\/p>

        double d = 0;<\/p>

        TSMaster \u5c0f\u7a0b\u5e8f\uff1a<\/p>

        com.rpc_tsmaster_cmd_get_can_signal(h,”chnidx\/net\/node\/msg\/signal”, %d)<\/span><\/p>

        API(C\\C++\\C#\\Python):<\/p>

        rpc_tsmaster_cmd_get_can_signal(h,”chnidx\/net\/node\/msg\/signal”, %d)<\/span><\/p>

        \u00a0<\/p>

        \u00a0<\/p>

        3.4 \u8bfb\u5199 LIN \u4fe1\u53f7<\/strong><\/span><\/p>

        \u8bbe\u7f6e LIN \u4fe1\u53f7\uff1a<\/p>

        TSMaster \u5c0f\u7a0b\u5e8f\uff1a<\/p>

        com.rpc_tsmaster_cmd_set_lin_signal(h,”chnidx\/net\/node\/msg\/signal”, 1234);<\/span><\/p>

        API(C\\C++\\C#\\Python):<\/p>

        rpc_tsmaster_cmd_set_lin_signal(h,”chnidx\/net\/node\/msg\/signal”, 1234);<\/span><\/p>

        \u00a0<\/p>

        \u83b7\u53d6 LIN \u4fe1\u53f7\uff1a<\/p>

        double d = 0;<\/p>

        TSMaster \u5c0f\u7a0b\u5e8f\uff1a<\/p>

        com.rpc_tsmaster_cmd_get_lin_signal(h,”chnidx\/net\/node\/msg\/signal”, %d);<\/span><\/p>

        API(C\\C++\\C#\\Python):<\/p>

        rpc_tsmaster_cmd_get_lin_signal(h,”chnidx\/net\/node\/msg\/signal”, %d);<\/span><\/p>

        \u00a0<\/p>

        \u00a0<\/p>

        3.5 \u8bfb\u5199 FlexRay \u4fe1\u53f7<\/strong><\/span><\/p>

        \u8bbe\u7f6e FR \u4fe1\u53f7\uff1a<\/p>

        TSMaster \u5c0f\u7a0b\u5e8f\uff1a<\/p>

        com.rpc_tsmaster_cmd_set_flexray_signal(h,”chnidx\/net\/node\/msg\/signal”, 1234);<\/span><\/p>

        API(C\\C++\\C#\\Python):<\/p>

        rpc_tsmaster_cmd_set_flexray_signal(h,”chnidx\/net\/node\/msg\/signal”, 1234);<\/span><\/p>

        \u00a0<\/p>

        \u83b7\u53d6 FR \u4fe1\u53f7\uff1a<\/p>

        double d = 0;<\/p>

        TSMaster \u5c0f\u7a0b\u5e8f\uff1a<\/p>

        com.rpc_tsmaster_cmd_get_can_signal(h,”chnidx\/net\/node\/msg\/signal”, %d);<\/span><\/p>

        API(C\\C++\\C#\\Python):<\/p>

        rpc_tsmaster_cmd_get_can_signal(h,”chnidx\/net\/node\/msg\/signal”, %d)<\/span><\/p>

        \u00a0<\/p>

        \u00a0<\/p>

        3.6 RPC\u00a0\u4f7f\u7528 TSMaster \u7cfb\u7edf\u51fd\u6570<\/strong><\/span><\/p>

        \u00a0<\/p>

        \/\/ \u7b2c\u4e00\u6b65\uff1a\u51c6\u5907\u8c03\u7528\u51fd\u6570\u7684\u8f93\u5165\u53c2\u6570<\/span><\/p>

        #define STR_BUFFER_SIZE 1024<\/span><\/p>

        char args[4][STR_BUFFER_SIZE];<\/span><\/p>

        char* pArgs[4] = {&args[0][0], &args[1][0], &args[2][0], &args[3][0]};<\/span><\/p>

        sprintf_s(pArgs[0], STR_BUFFER_SIZE, “%s”, “var1”);<\/span><\/p>

        sprintf_s(pArgs[1], STR_BUFFER_SIZE, “%d”, svtString);<\/span><\/p>

        sprintf_s(pArgs[2], STR_BUFFER_SIZE, “%s”, “string default value”);<\/span><\/p>

        sprintf_s(pArgs[3], STR_BUFFER_SIZE, “%s”, “this is a comment”);<\/span><\/p>

        \u00a0<\/p>

        \/\/ \u6b65\u9aa4 2\uff1a\u8c03\u7528\u4efb\u610f API<\/span><\/p>

        s32 ret;<\/span><\/p>

        ret = com.rpc_tsmaster_call_system_api(h, “app.create_system_var”, 4, STR_BUFFER_SIZE,<\/span><\/p>

        &pArgs[0]);<\/span><\/p>

        \u00a0<\/p>

        \/\/ \u6b65\u9aa4 3\uff1a\u5904\u7406\u53c2\u6570\u4e2d\u7684\u8fd4\u56de\u503c\uff08\u5982\u679c\u53ef\u7528\uff09<\/span><\/p>

        s32 i;<\/span><\/p>

        log(“API call result = %d”, ret);<\/span><\/p>

        for (i=0; i<4; i++){<\/span><\/p>

        log(“Argument %d: %s”, i+1, pArgs[i]);<\/span><\/p>

        }<\/span><\/p>

        \u00a0<\/p>

        \u4e0a\u8ff0\u4ee3\u7801\u7b49\u4ef7\u4e0e\u5728 TSMaster \u8fdb\u7a0b\u4e2d\u4f7f\u7528 app.create_system_var \u6765\u521b\u5efa\u7cfb\u7edf\u53d8\u91cf\uff0c\u5373\uff1aapp.create_system_var(var1,svtString,\u201dstring default value\u201d,\u201dthis is a comment\u201d);<\/p>

        \u00a0<\/p>

        \u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u4f7f\u7528\u8be5\u65b9\u5f0f\u8c03\u7528 TSMaster \u5185\u7684\u7cfb\u7edf\u51fd\u6570\uff0c\u65e0\u6cd5\u4f7f\u7528\u53c2\u6570\u4e3a\u6307\u9488\u7c7b\u578b(\u62a5\u6587\u7c7b\u578b\u9664\u5916)\u7684\u51fd\u6570\u3002<\/span><\/p>

        \u00a0<\/p>

        \u00a0<\/p>

        3.7 RPC\u00a0\u4f7f\u7528\u5c0f\u7a0b\u5e8f\u5e93\u51fd\u6570<\/strong><\/span><\/p>

        \u00a0<\/p>

        \/\/ \u7b2c\u4e00\u6b65\uff1a\u51c6\u5907\u8c03\u7528\u51fd\u6570\u7684\u8f93\u5165\u53c2\u6570<\/span><\/p>

        #define STR_BUFFER_SIZE 1024<\/span><\/p>

        char args[4][STR_BUFFER_SIZE];<\/span><\/p>

        char* pArgs[4] = {&args[0][0], &args[1][0], &args[2][0], &args[3][0]};<\/span><\/p>

        sprintf_s(pArgs[0], STR_BUFFER_SIZE, “%s”, “var1”);<\/span><\/p>

        sprintf_s(pArgs[1], STR_BUFFER_SIZE, “%d”, svtString);<\/span><\/p>

        sprintf_s(pArgs[2], STR_BUFFER_SIZE, “%s”, “string default value”);<\/span><\/p>

        sprintf_s(pArgs[3], STR_BUFFER_SIZE, “%s”, “this is a comment”);<\/span><\/p>

        \u00a0<\/p>

        \/\/\u6b65\u9aa4 2\uff1a\u8c03\u7528\u4efb\u610f API<\/span><\/p>

        s32 ret;TSMaster RPC \u7f16\u7a0b\u6307\u5bfc<\/span><\/p>

        ret = com.rpc_tsmaster_call_library_api(h, “mylib.create_system_var”, 4, STR_BUFFER_SIZE,<\/span><\/p>

        &pArgs[0]);<\/span><\/p>

        \u00a0<\/p>

        \/\/ \u6b65\u9aa4 3\uff1a\u5904\u7406\u53c2\u6570\u4e2d\u7684\u8fd4\u56de\u503c\uff08\u5982\u679c\u53ef\u7528\uff09<\/span><\/p>

        s32 i;<\/span><\/p>

        log(“API call result = %d”, ret);<\/span><\/p>

        for (i=0; i<4; i++){<\/span><\/p>

        log(“Argument %d: %s”, i+1, pArgs[i]);<\/span><\/p>

        }<\/span><\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t

        \n\t\t\t\t\t
        \n\t\t
        \n\t\t\t\t
        \n\t\t\t\t
        \n\t\t\t

        04\u3001TSMaster RPC \u51fd\u6570\u8bf4\u660e\n\n<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
        \n\t\t\t\t
        \n\t\t\t\t\t\t\t\u57fa\u4e8eRPC\u672c\u8eab\u673a\u5236\uff0cTSMaster\u63d0\u4f9b\u4e86\u76f8\u5e94\u63a5\u53e3\uff0c\u5728\u9700\u8981\u88ab\u7a0b\u63a7\u7684\u5de5\u7a0b\u4e2d\uff0c\u6fc0\u6d3bRPC server\u7aef\uff0c\u4e3a\u7a0b\u63a7\u811a\u672c\u63d0\u4f9b\u76f8\u5e94\u8d44\u6e90\u3002\n\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
        \n\t\t\t\t
        \n\t\t\t\t\t\t\t

        1\uff5crpc_tsmaster_create_client<\/h3>
        \u51fd\u6570\u540d\u79f0<\/strong><\/section><\/section><\/td>
        UInt32 rpc_tsmaster_create_client(const char*\u00a0ATSMasterAppName,const psize_t AHandle)<\/section><\/section><\/td><\/tr>
        \u529f\u80fd\u4ecb\u7ecd<\/strong><\/section><\/section><\/td>
        \u521b\u5efa\u4e00\u4e2a TSMaster Rpc \u5ba2\u6237\u7aef<\/section><\/section><\/td><\/tr>
        \u8c03\u7528\u4f4d\u7f6e<\/strong><\/section><\/section><\/td>
        \u521d\u59cb\u5316 tsmaster lib \u5e93\u4e4b\u540e<\/section><\/section><\/td><\/tr>
        \u8f93\u5165\u53c2\u6570<\/strong><\/section><\/section><\/td>
        ATSMasterAppName: TSMaster server \u7aef\u7684\u5e94\u7528\u7a0b\u5e8f\u540d\u79f0;AHandle : TSMaster Rpc \u5ba2\u6237\u7aef\u53e5\u67c4<\/section><\/section><\/td><\/tr>
        \u8fd4\u56de\u503c<\/strong><\/section><\/section><\/td>
        ==0: \u51fd\u6570\u6267\u884c\u6210\u529f\u5176\u4ed6\u503c\uff1a\u51fd\u6570\u6267\u884c\u5931\u8d25<\/section><\/section><\/td><\/tr>
        \u793a\u4f8b<\/strong><\/section><\/section><\/td>
        s32 h;rpc_tsmaster_create_client(“TSMaster1”, &h)<\/section><\/section><\/td><\/tr><\/tbody><\/table>

        2\uff5crpc_tsmaster_activate_client<\/h3>

        \u51fd\u6570\u540d\u79f0<\/strong><\/p><\/section><\/section><\/td>

        UInt32 rpc_tsmaster_activate_client(const size_t AHandle,const\u00a0bool AActivate)<\/p><\/section><\/section><\/td><\/tr>

        \u529f\u80fd\u4ecb\u7ecd<\/strong><\/p><\/section><\/section><\/td>

        \u6fc0\u6d3b\u6216\u8005\u505c\u7528\u4e00\u4e2a TSMaster Rpc \u5ba2\u6237\u7aef<\/p><\/section><\/section><\/td><\/tr>

        \u8c03\u7528\u4f4d\u7f6e<\/strong><\/p><\/section><\/section><\/td>

        \u521b\u5efa TSMaster Rpc \u5ba2\u6237\u7aef\u4e4b\u540e<\/p><\/section><\/section><\/td><\/tr>

        \u8f93\u5165\u53c2\u6570<\/strong><\/p><\/section><\/section><\/td>

        AHandle : TSMaster Rpc \u5ba2\u6237\u7aef\u53e5\u67c4<\/p>

        AActivate: true=\u6fc0\u6d3b\uff0cfalse=\u505c\u7528<\/p><\/section><\/section><\/td><\/tr>

        \u8fd4\u56de\u503c<\/strong><\/p><\/section><\/section><\/td>

        ==0: \u51fd\u6570\u6267\u884c\u6210\u529f<\/p>

        \u5176\u4ed6\u503c\uff1a\u51fd\u6570\u6267\u884c\u5931\u8d25<\/p><\/section><\/section><\/td><\/tr>

        \u793a\u4f8b<\/strong><\/p><\/section><\/section><\/td>

        rpc_tsmaster_activate_client(h, true)<\/p><\/section><\/section><\/td><\/tr><\/tbody><\/table><\/section><\/section><\/section>

        3\uff5crpc_tsmaster_is_simulation_running<\/h3>

        \u51fd\u6570\u540d\u79f0<\/strong><\/p><\/section><\/section><\/td>

        UInt32 rpc_tsmaster_is_simulation_running(const size_t\u00a0AHandle,const pbool AIsRunning)<\/p><\/section><\/section><\/td><\/tr>

        \u529f\u80fd\u4ecb\u7ecd<\/strong><\/p><\/section><\/section><\/td>

        \u83b7\u53d6\u8fdc\u7a0b TSMaster \u4eff\u771f\u8fd0\u884c\u7684\u72b6\u6001<\/p><\/section><\/section><\/td><\/tr>

        \u8c03\u7528\u4f4d\u7f6e<\/strong><\/p><\/section><\/section><\/td>

        \u521b\u5efa TSMaster Rpc \u5ba2\u6237\u7aef\u4e4b\u540e<\/p><\/section><\/section><\/td><\/tr>

        \u8f93\u5165\u53c2\u6570<\/strong><\/p><\/section><\/section><\/td>

        AHandle : TSMaster Rpc \u5ba2\u6237\u7aef\u53e5\u67c4<\/p>

        AIsRunning\uff1a\u8fdc\u7a0b TSMaster \u4eff\u771f\u8fd0\u884c\u7684\u72b6\u6001\u7684\u6570\u636e\u6307\u9488<\/p>

        True=\u6b63\u5728\u8fd0\u884c\uff0cfalse=\u672a\u8fd0\u884c<\/p><\/section><\/section><\/td><\/tr>

        \u8fd4\u56de\u503c<\/strong><\/p><\/section><\/section><\/td>

        ==0: \u51fd\u6570\u6267\u884c\u6210\u529f<\/p>

        \u5176\u4ed6\u503c\uff1a\u51fd\u6570\u6267\u884c\u5931\u8d25<\/p><\/section><\/section><\/td><\/tr>

        \u793a\u4f8b<\/strong><\/p><\/section><\/section><\/td>

        bool b;<\/p>

        if (0 == com.rpc_tsmaster_is_simulation_running(h, &b)){<\/p>

        if (b){<\/p>

        \/\/ current simulation is running<\/p>

        }<\/p>

        }<\/p><\/section><\/section><\/td><\/tr><\/tbody><\/table><\/section><\/section><\/section>

        \u00a0<\/p>

        4<\/strong><\/em>\uff5crpc_tsmaster_cmd_set_mode_realtime<\/strong><\/h3><\/section><\/section>
        <\/section><\/section><\/section><\/section><\/section>

        \u51fd\u6570\u540d\u79f0<\/strong><\/p><\/section><\/section><\/td>

        UInt32 rpc_tsmaster_cmd_set_mode_realtime(const size_t AHandle)<\/p><\/section><\/section><\/td><\/tr>

        \u529f\u80fd\u4ecb\u7ecd<\/strong><\/p><\/section><\/section><\/td>

        \u5c06 TSMaster Rpc server \u914d\u7f6e\u4e3a\u5b9e\u65f6\u6a21\u5f0f<\/p><\/section><\/section><\/td><\/tr>

        \u8c03\u7528\u4f4d\u7f6e<\/strong><\/p><\/section><\/section><\/td>

        \u521b\u5efa TSMaster Rpc \u5ba2\u6237\u7aef\u4e4b\u540e\uff0c\u4eff\u771f\u8fd0\u884c\u4e4b\u524d<\/p><\/section><\/section><\/td><\/tr>

        \u8f93\u5165\u53c2\u6570<\/strong><\/p><\/section><\/section><\/td>

        AHandle : TSMaster Rpc \u5ba2\u6237\u7aef\u53e5\u67c4<\/p><\/section><\/section><\/td><\/tr>

        \u8fd4\u56de\u503c<\/strong><\/p><\/section><\/section><\/td>

        ==0: \u51fd\u6570\u6267\u884c\u6210\u529f<\/p>

        \u5176\u4ed6\u503c\uff1a\u51fd\u6570\u6267\u884c\u5931\u8d25<\/p><\/section><\/section><\/td><\/tr>

        \u793a\u4f8b<\/strong><\/p><\/section><\/section><\/td>

        rpc_tsmaster_cmd_set_mode_realtime(h)<\/p><\/section><\/section><\/td><\/tr><\/tbody><\/table><\/section><\/section><\/section>

        5<\/strong><\/em>\uff5crpc_tsmaster_cmd_set_mode_sim<\/strong><\/h3><\/section><\/section>
        <\/section><\/section><\/section><\/section><\/section>

        \u51fd\u6570\u540d\u79f0<\/strong><\/p><\/section><\/section><\/td>

        UInt32 rpc_tsmaster_cmd_set_mode_sim(const size_t AHandle)<\/p><\/section><\/section><\/td><\/tr>

        \u529f\u80fd\u4ecb\u7ecd<\/strong><\/p><\/section><\/section><\/td>

        \u5c06 TSMaster Rpc server \u914d\u7f6e\u4e3a\u4eff\u771f\u6a21\u5f0f<\/p><\/section><\/section><\/td><\/tr>

        \u8c03\u7528\u4f4d\u7f6e<\/strong><\/p><\/section><\/section><\/td>

        \u521b\u5efa TSMaster Rpc \u5ba2\u6237\u7aef\u4e4b\u540e\uff0c\u4eff\u771f\u8fd0\u884c\u4e4b\u524d<\/p><\/section><\/section><\/td><\/tr>

        \u8f93\u5165\u53c2\u6570<\/strong><\/p><\/section><\/section><\/td>

        AHandle : TSMaster Rpc \u5ba2\u6237\u7aef\u53e5\u67c4<\/p><\/section><\/section><\/td><\/tr>

        \u8fd4\u56de\u503c<\/strong><\/p><\/section><\/section><\/td>

        ==0: \u51fd\u6570\u6267\u884c\u6210\u529f<\/p>

        \u5176\u4ed6\u503c\uff1a\u51fd\u6570\u6267\u884c\u5931\u8d25<\/p><\/section><\/section><\/td><\/tr>

        \u793a\u4f8b<\/strong><\/p><\/section><\/section><\/td>

        rpc_tsmaster_cmd_set_mode_sim(h)<\/p><\/section><\/section><\/td><\/tr><\/tbody><\/table><\/section><\/section><\/section>

        \u00a0<\/p>

        6<\/strong><\/em>\uff5crpc_tsmaster_cmd_start_simulation<\/strong><\/h3><\/section><\/section>
        <\/section><\/section><\/section><\/section><\/section>

        \u51fd\u6570\u540d\u79f0<\/strong><\/p><\/section><\/section><\/td>

        UInt32 rpc_tsmaster_cmd_start_simulation(const size_t AHandle)<\/p><\/section><\/section><\/td><\/tr>

        \u529f\u80fd\u4ecb\u7ecd<\/strong><\/p><\/section><\/section><\/td>

        \u542f\u52a8 TSMaster Rpc server \u4eff\u771f<\/p><\/section><\/section><\/td><\/tr>

        \u8c03\u7528\u4f4d\u7f6e<\/strong><\/p><\/section><\/section><\/td>

        \u521b\u5efa TSMaster Rpc \u5ba2\u6237\u7aef\u4e4b\u540e<\/p><\/section><\/section><\/td><\/tr>

        \u8f93\u5165\u53c2\u6570<\/strong><\/p><\/section><\/section><\/td>

        AHandle : TSMaster Rpc \u5ba2\u6237\u7aef\u53e5\u67c4<\/p><\/section><\/section><\/td><\/tr>

        \u8fd4\u56de\u503c<\/strong><\/p><\/section><\/section><\/td>

        ==0: \u51fd\u6570\u6267\u884c\u6210\u529f<\/p>

        \u5176\u4ed6\u503c\uff1a\u51fd\u6570\u6267\u884c\u5931\u8d25<\/p><\/section><\/section><\/td><\/tr>

        \u793a\u4f8b<\/strong><\/p><\/section><\/section><\/td>

        rpc_tsmaster_cmd_start_simulation(h)<\/p><\/section><\/section><\/td><\/tr><\/tbody><\/table><\/section><\/section><\/section>

        7<\/strong><\/em>\uff5crpc_tsmaster_cmd_set_can_signal<\/strong><\/h3><\/section><\/section>
        <\/section><\/section><\/section><\/section><\/section>

        \u51fd\u6570\u540d\u79f0<\/strong><\/p><\/section><\/section><\/td>

        UInt32 rpc_tsmaster_cmd_set_can_signal(const size_t AHandle,const<\/p>

        char* ASgnAddress,const double AValue)<\/p><\/section><\/section><\/td><\/tr>

        \u529f\u80fd\u4ecb\u7ecd<\/strong><\/p><\/section><\/section><\/td>

        \u5728\u8fdc\u7a0b TSMaster \u4e0a\u4fee\u6539\u6570\u636e\u5e93\u4e2d\u7684 CAN \u4fe1\u53f7\u503c<\/p><\/section><\/section><\/td><\/tr>

        \u8c03\u7528\u4f4d\u7f6e<\/strong><\/p><\/section><\/section><\/td>

        \u521b\u5efa TSMaster Rpc \u5ba2\u6237\u7aef\u4e4b\u540e<\/p><\/section><\/section><\/td><\/tr>

        \u8f93\u5165\u53c2\u6570<\/strong><\/p><\/section><\/section><\/td>

        AHandle : TSMaster Rpc \u5ba2\u6237\u7aef\u53e5\u67c4<\/p>

        ASgnAddress\uff1a\u6570\u636e\u5e93\u4e2d\u4fe1\u53f7\u7684\u8def\u5f84<\/p>

        AValue: \u4fe1\u53f7\u503c<\/p><\/section><\/section><\/td><\/tr>

        \u8fd4\u56de\u503c<\/strong><\/p><\/section><\/section><\/td>

        ==0: \u51fd\u6570\u6267\u884c\u6210\u529f<\/p>

        \u5176\u4ed6\u503c\uff1a\u51fd\u6570\u6267\u884c\u5931\u8d25<\/p><\/section><\/section><\/td><\/tr>

        \u793a\u4f8b<\/strong><\/p><\/section><\/section><\/td>

        if(0==rpc_tsmaster_cmd_set_can_signal(h,<\/p>

        “0\/CAN_FD_Powertrain\/Engine\/EngineData\/EngSpeed”, 1234)){<\/p>

        \/\/ signal written<\/p>

        }<\/p><\/section><\/section><\/td><\/tr><\/tbody><\/table><\/section><\/section><\/section>

        8<\/strong><\/em>\uff5crpc_tsmaster_cmd_get_can_signal<\/strong><\/h3><\/section><\/section>
        <\/section><\/section><\/section><\/section><\/section>

        \u51fd\u6570\u540d\u79f0<\/strong><\/p><\/section><\/section><\/td>

        UInt32 rpc_tsmaster_cmd_get_can_signal(const size_t AHandle,const<\/p>

        char* ASgnAddress,const pdouble AValue)<\/p><\/section><\/section><\/td><\/tr>

        \u529f\u80fd\u4ecb\u7ecd<\/strong><\/p><\/section><\/section><\/td>

        \u5728\u8fdc\u7a0b TSMaster \u4e0a\u83b7\u53d6\u6570\u636e\u5e93\u4e2d\u7684 CAN \u4fe1\u53f7\u503c<\/p><\/section><\/section><\/td><\/tr>

        \u8c03\u7528\u4f4d\u7f6e<\/strong><\/p><\/section><\/section><\/td>

        \u521b\u5efa TSMaster Rpc \u5ba2\u6237\u7aef\u4e4b\u540e<\/p><\/section><\/section><\/td><\/tr>

        \u8f93\u5165\u53c2\u6570<\/strong><\/p><\/section><\/section><\/td>

        AHandle : TSMaster Rpc \u5ba2\u6237\u7aef\u53e5\u67c4<\/p>

        ASgnAddress\uff1a\u6570\u636e\u5e93\u4e2d\u4fe1\u53f7\u7684\u8def\u5f84<\/p>

        AValue: \u4fe1\u53f7\u503c\u6307\u9488<\/p><\/section><\/section><\/td><\/tr>

        \u8fd4\u56de\u503c<\/strong><\/p><\/section><\/section><\/td>

        ==0: \u51fd\u6570\u6267\u884c\u6210\u529f<\/p>

        \u5176\u4ed6\u503c\uff1a\u51fd\u6570\u6267\u884c\u5931\u8d25<\/p><\/section><\/section><\/td><\/tr>

        \u793a\u4f8b<\/strong><\/p><\/section><\/section><\/td>

        double d;<\/p>

        if(0==rpc_tsmaster_cmd_get_can_signal(h,<\/p>

        “0\/CAN_FD_Powertrain\/Engine\/EngineData\/EngSpeed”, &d)){<\/p>

        \/\/ signal is retrieved<\/p>

        }<\/p><\/section><\/section><\/td><\/tr><\/tbody><\/table><\/section><\/section><\/section>

        9<\/strong><\/em>\uff5crpc_tsmaster_cmd_set_lin_signal<\/strong><\/h3><\/section><\/section>
        <\/section><\/section><\/section><\/section><\/section>

        \u51fd\u6570\u540d\u79f0<\/strong><\/p><\/section><\/section><\/td>

        UInt32 rpc_tsmaster_cmd_set_lin_signal(const size_t AHandle,const<\/p>

        char* ASgnAddress,const double AValue)<\/p><\/section><\/section><\/td><\/tr>

        \u529f\u80fd\u4ecb\u7ecd<\/strong><\/p><\/section><\/section><\/td>

        \u5728\u8fdc\u7a0b TSMaster \u4e0a\u4fee\u6539\u6570\u636e\u5e93\u4e2d\u7684 LIN \u4fe1\u53f7\u503c<\/p><\/section><\/section><\/td><\/tr>

        \u8c03\u7528\u4f4d\u7f6e<\/strong><\/p><\/section><\/section><\/td>

        \u521b\u5efa TSMaster Rpc \u5ba2\u6237\u7aef\u4e4b\u540e<\/p><\/section><\/section><\/td><\/tr>

        \u8f93\u5165\u53c2\u6570<\/strong><\/p><\/section><\/section><\/td>

        AHandle : TSMaster Rpc \u5ba2\u6237\u7aef\u53e5\u67c4<\/p>

        ASgnAddress\uff1a\u6570\u636e\u5e93\u4e2d\u4fe1\u53f7\u7684\u8def\u5f84<\/p>

        AValue: \u4fe1\u53f7\u503c<\/p><\/section><\/section><\/td><\/tr>

        \u8fd4\u56de\u503c<\/strong><\/p><\/section><\/section><\/td>

        ==0: \u51fd\u6570\u6267\u884c\u6210\u529f<\/p>

        \u5176\u4ed6\u503c\uff1a\u51fd\u6570\u6267\u884c\u5931\u8d25<\/p><\/section><\/section><\/td><\/tr>

        \u793a\u4f8b<\/strong><\/p><\/section><\/section><\/td>

        if(0==rpc_tsmaster_cmd_set_lin_signal(h,<\/p>

        “chnidx\/net\/node\/msg\/signal”, 1234)){<\/p>

        \/\/ signal written<\/p>

        }<\/p><\/section><\/section><\/td><\/tr><\/tbody><\/table><\/section><\/section><\/section>

        10<\/strong><\/em>\uff5crpc_tsmaster_cmd_get_lin_signal<\/strong><\/h3><\/section><\/section>
        <\/section><\/section><\/section><\/section><\/section>

        \u51fd\u6570\u540d\u79f0<\/strong><\/p><\/section><\/section><\/td>

        UInt32 rpc_tsmaster_cmd_get_lin_signal(const size_t AHandle,const<\/p>

        char* ASgnAddress,const pdouble AValue)<\/p><\/section><\/section><\/td><\/tr>

        \u529f\u80fd\u4ecb\u7ecd<\/strong><\/p><\/section><\/section><\/td>

        \u5728\u8fdc\u7a0b TSMaster \u4e0a\u83b7\u53d6\u6570\u636e\u5e93\u4e2d\u7684 LIN \u4fe1\u53f7\u503c<\/p><\/section><\/section><\/td><\/tr>

        \u8c03\u7528\u4f4d\u7f6e<\/strong><\/p><\/section><\/section><\/td>

        \u521b\u5efa TSMaster Rpc \u5ba2\u6237\u7aef\u4e4b\u540e<\/p><\/section><\/section><\/td><\/tr>

        \u8f93\u5165\u53c2\u6570<\/strong><\/p><\/section><\/section><\/td>

        AHandle : TSMaster Rpc \u5ba2\u6237\u7aef\u53e5\u67c4<\/p>

        ASgnAddress\uff1a\u6570\u636e\u5e93\u4e2d\u4fe1\u53f7\u7684\u8def\u5f84<\/p>

        AValue: \u4fe1\u53f7\u503c\u6307\u9488<\/p><\/section><\/section><\/td><\/tr>

        \u8fd4\u56de\u503c<\/strong><\/p><\/section><\/section><\/td>

        ==0: \u51fd\u6570\u6267\u884c\u6210\u529f<\/p>

        \u5176\u4ed6\u503c\uff1a\u51fd\u6570\u6267\u884c\u5931\u8d25<\/p><\/section><\/section><\/td><\/tr>

        \u793a\u4f8b<\/strong><\/p><\/section><\/section><\/td>

        double d;<\/p>

        if(0==rpc_tsmaster_cmd_get_lin_signal(h,<\/p>

        “chnidx\/net\/node\/msg\/signal”, &d)){<\/p>

        \/\/ signal is retrieved<\/p>

        }<\/p><\/section><\/section><\/td><\/tr><\/tbody><\/table><\/section><\/section><\/section>

        11<\/strong><\/em>\uff5crpc_tsmaster_cmd_set_flexray_signal<\/strong><\/h3><\/section><\/section>
        <\/section><\/section><\/section><\/section><\/section>

        \u51fd\u6570\u540d\u79f0<\/strong><\/p><\/section><\/section><\/td>

        UInt32 rpc_tsmaster_cmd_set_flexray_signal(const size_t\u00a0\u00a0AHandle,const char* ASgnAddress,const double AValue)<\/p><\/section><\/section><\/td><\/tr>

        \u529f\u80fd\u4ecb\u7ecd<\/strong><\/p><\/section><\/section><\/td>

        \u5728\u8fdc\u7a0b TSMaster \u4e0a\u4fee\u6539\u6570\u636e\u5e93\u4e2d\u7684 flexray \u4fe1\u53f7\u503c<\/p><\/section><\/section><\/td><\/tr>

        \u8c03\u7528\u4f4d\u7f6e<\/strong><\/p><\/section><\/section><\/td>

        \u521b\u5efa TSMaster Rpc \u5ba2\u6237\u7aef\u4e4b\u540e<\/p><\/section><\/section><\/td><\/tr>

        \u8f93\u5165\u53c2\u6570<\/strong><\/p><\/section><\/section><\/td>

        AHandle : TSMaster Rpc \u5ba2\u6237\u7aef\u53e5\u67c4<\/p>

        ASgnAddress\uff1a\u6570\u636e\u5e93\u4e2d\u4fe1\u53f7\u7684\u8def\u5f84<\/p>

        AValue: \u4fe1\u53f7\u503c<\/p><\/section><\/section><\/td><\/tr>

        \u8fd4\u56de\u503c<\/strong><\/p><\/section><\/section><\/td>

        ==0: \u51fd\u6570\u6267\u884c\u6210\u529f<\/p>

        \u5176\u4ed6\u503c\uff1a\u51fd\u6570\u6267\u884c\u5931\u8d25<\/p><\/section><\/section><\/td><\/tr>

        \u793a\u4f8b<\/strong><\/p><\/section><\/section><\/td>

        if(0==rpc_tsmaster_cmd_set_flexray_signal(h,<\/p>

        “chnidx\/net\/node\/msg\/signal”, 1234)){<\/p>

        \/\/ signal written<\/p>

        }<\/p><\/section><\/section><\/td><\/tr><\/tbody><\/table><\/section><\/section><\/section>

        12<\/strong><\/em>\uff5crpc_tsmaster_cmd_get_flexray_signal<\/strong><\/h3><\/section><\/section>
        <\/section><\/section><\/section><\/section><\/section>

        \u51fd\u6570\u540d\u79f0<\/strong><\/p><\/section><\/section><\/td>

        UInt32 rpc_tsmaster_cmd_get_flexray_signal(const size_t\u00a0AHandle,const char* ASgnAddress,const pdouble AValue)<\/p><\/section><\/section><\/td><\/tr>

        \u529f\u80fd\u4ecb\u7ecd<\/strong><\/p><\/section><\/section><\/td>

        \u5728\u8fdc\u7a0b TSMaster \u4e0a\u83b7\u53d6\u6570\u636e\u5e93\u4e2d\u7684 flexray \u4fe1\u53f7\u503c<\/p><\/section><\/section><\/td><\/tr>

        \u8c03\u7528\u4f4d\u7f6e<\/strong><\/p><\/section><\/section><\/td>

        \u521b\u5efa TSMaster Rpc \u5ba2\u6237\u7aef\u4e4b\u540e<\/p><\/section><\/section><\/td><\/tr>

        \u8f93\u5165\u53c2\u6570<\/strong><\/p><\/section><\/section><\/td>

        AHandle : TSMaster Rpc \u5ba2\u6237\u7aef\u53e5\u67c4<\/p>

        ASgnAddress\uff1a\u6570\u636e\u5e93\u4e2d\u4fe1\u53f7\u7684\u8def\u5f84<\/p>

        AValue: \u4fe1\u53f7\u503c\u6307\u9488<\/p><\/section><\/section><\/td><\/tr>

        \u8fd4\u56de\u503c<\/strong><\/p><\/section><\/section><\/td>

        ==0: \u51fd\u6570\u6267\u884c\u6210\u529f<\/p>

        \u5176\u4ed6\u503c\uff1a\u51fd\u6570\u6267\u884c\u5931\u8d25<\/p><\/section><\/section><\/td><\/tr>

        \u793a\u4f8b<\/strong><\/p><\/section><\/section><\/td>

        double d;<\/p>

        if(0==rpc_tsmaster_cmd_get_flexray_signal(h,<\/p>

        “chnidx\/net\/node\/msg\/signal”, &d)){<\/p>

        \/\/ signal is retrieved<\/p>

        }<\/p><\/section><\/section><\/td><\/tr><\/tbody><\/table><\/section><\/section><\/section>

        13<\/strong><\/em>\uff5crpc_tsmaster_cmd_write_system_var<\/strong><\/h3><\/section><\/section>
        <\/section><\/section><\/section><\/section><\/section>

        \u51fd\u6570\u540d\u79f0<\/strong><\/p><\/section><\/section><\/td>

        UInt32 rpc_tsmaster_cmd_write_system_var(const size_t\u00a0AHandle,const char* ACompleteName,const char* AValue)<\/p><\/section><\/section><\/td><\/tr>

        \u529f\u80fd\u4ecb\u7ecd<\/strong><\/p><\/section><\/section><\/td>

        \u4ece\u8fdc\u7a0b TSMaster \u6309\u540d\u79f0\u5199\u5165\u7cfb\u7edf\u53d8\u91cf<\/p><\/section><\/section><\/td><\/tr>

        \u8c03\u7528\u4f4d\u7f6e<\/strong><\/p><\/section><\/section><\/td>

        \u521b\u5efa TSMaster Rpc \u5ba2\u6237\u7aef\u4e4b\u540e<\/p><\/section><\/section><\/td><\/tr>

        \u8f93\u5165\u53c2\u6570<\/strong><\/p><\/section><\/section><\/td>

        AHandle : TSMaster Rpc \u5ba2\u6237\u7aef\u53e5\u67c4<\/p>

        ACompleteName\uff1a\u7cfb\u7edf\u53d8\u91cf\u540d\u79f0<\/p>

        AValue: \u6570\u636e\u503c<\/p><\/section><\/section><\/td><\/tr>

        \u8fd4\u56de\u503c<\/strong><\/p><\/section><\/section><\/td>

        ==0: \u51fd\u6570\u6267\u884c\u6210\u529f<\/p>

        \u5176\u4ed6\u503c\uff1a\u51fd\u6570\u6267\u884c\u5931\u8d25<\/p><\/section><\/section><\/td><\/tr>

        \u793a\u4f8b<\/strong><\/p><\/section><\/section><\/td>

        rpc_tsmaster_cmd_write_system_var(h, “v1”, “1.2345”)<\/p><\/section><\/section><\/td><\/tr><\/tbody><\/table><\/section><\/section><\/section>

        14<\/strong><\/em>\uff5crpc_tsmaster_cmd_read_system_var<\/strong><\/h3><\/section><\/section>
        <\/section><\/section><\/section><\/section><\/section>

        \u51fd\u6570\u540d\u79f0<\/strong><\/p><\/section><\/section><\/td>

        UInt32 rpc_tsmaster_cmd_read_system_var(const size_t\u00a0AHandle,const char* ASysVarName,const pdouble AValue)<\/p><\/section><\/section><\/td><\/tr>

        \u529f\u80fd\u4ecb\u7ecd<\/strong><\/p><\/section><\/section><\/td>

        \u4ece\u8fdc\u7a0b TSMaster \u6309\u540d\u79f0\u8bfb\u53d6\u7cfb\u7edf\u53d8\u91cf\u00a0\u00a0\u00a0\u00a0<\/p><\/section><\/section><\/td><\/tr>

        \u8c03\u7528\u4f4d\u7f6e<\/strong><\/p><\/section><\/section><\/td>

        \u521b\u5efa TSMaster Rpc \u5ba2\u6237\u7aef\u4e4b\u540e<\/p><\/section><\/section><\/td><\/tr>

        \u8f93\u5165\u53c2\u6570<\/strong><\/p><\/section><\/section><\/td>

        AHandle : TSMaster Rpc \u5ba2\u6237\u7aef\u53e5\u67c4<\/p>

        ASysVarName\uff1a\u7cfb\u7edf\u53d8\u91cf\u540d\u79f0<\/p>

        AValue: \u6570\u636e\u503c\u6307\u9488<\/p><\/section><\/section><\/td><\/tr>

        \u8fd4\u56de\u503c<\/strong><\/p><\/section><\/section><\/td>

        ==0: \u51fd\u6570\u6267\u884c\u6210\u529f<\/p>

        \u5176\u4ed6\u503c\uff1a\u51fd\u6570\u6267\u884c\u5931\u8d25<\/p><\/section><\/section><\/td><\/tr>

        \u793a\u4f8b<\/strong><\/p><\/section><\/section><\/td>

        double d;<\/p>

        if (0 == rpc_tsmaster_cmd_read_system_var(h, “v1”, &d)){<\/p>

        log(“value = %f”, d);<\/p>

        }<\/p><\/section><\/section><\/td><\/tr><\/tbody><\/table><\/section><\/section><\/section>

        15<\/strong><\/em>\uff5crpc_tsmaster_cmd_write_signal<\/strong><\/h3><\/section><\/section>
        <\/section><\/section><\/section><\/section><\/section>

        \u51fd\u6570\u540d\u79f0<\/strong><\/p><\/section><\/section><\/td>

        UInt32 rpc_tsmaster_cmd_write_signal(const size_t AHandle,const\u00a0TLIBApplicationChannelType ABusType,const char* AAddr,const double<\/p>

        AValue)<\/p><\/section><\/section><\/td><\/tr>

        \u529f\u80fd\u4ecb\u7ecd<\/strong><\/p><\/section><\/section><\/td>

        \u4ece\u8fdc\u7a0b TSMaster \u6309\u540d\u79f0\u5199\u5165\u4fe1\u53f7\u503c<\/p><\/section><\/section><\/td><\/tr>

        \u8c03\u7528\u4f4d\u7f6e<\/strong><\/p><\/section><\/section><\/td>

        \u521b\u5efa TSMaster Rpc \u5ba2\u6237\u7aef\u4e4b\u540e<\/p><\/section><\/section><\/td><\/tr>

        \u8f93\u5165\u53c2\u6570<\/strong><\/p><\/section><\/section><\/td>

        AHandle : TSMaster Rpc \u5ba2\u6237\u7aef\u53e5\u67c4<\/p>

        ABusType\uff1a\u603b\u7ebf\u7c7b\u578b<\/p>

        AAddr\uff1a\u6570\u636e\u5e93\u4e2d\u4fe1\u53f7\u7684\u8def\u5f84<\/p>

        AValue: \u6570\u636e\u503c<\/p><\/section><\/section><\/td><\/tr>

        \u8fd4\u56de\u503c<\/strong><\/p><\/section><\/section><\/td>

        ==0: \u51fd\u6570\u6267\u884c\u6210\u529f<\/p>

        \u5176\u4ed6\u503c\uff1a\u51fd\u6570\u6267\u884c\u5931\u8d25<\/p><\/section><\/section><\/td><\/tr>

        \u793a\u4f8b<\/strong><\/p><\/section><\/section><\/td>

        if(0==rpc_tsmaster_cmd_write_signal(h,APP_CAN,<\/p>

        “0\/Powertrain\/Engine\/EngSpeed”, 1234)){<\/p>

        \/\/ value written<\/p>

        }<\/p><\/section><\/section><\/td><\/tr><\/tbody><\/table><\/section><\/section><\/section>

        16<\/strong><\/em>\uff5crpc_tsmaster_cmd_read_signal<\/strong><\/h3><\/section><\/section>
        <\/section><\/section><\/section><\/section><\/section>

        \u51fd\u6570\u540d\u79f0<\/strong><\/p><\/section><\/section><\/td>

        UInt32 rpc_tsmaster_cmd_read_signal(const size_t AHandle,const\u00a0TLIBApplicationChannelType ABusType,const char* AAddr,const<\/p>

        pdouble AValue)<\/p><\/section><\/section><\/td><\/tr>

        \u529f\u80fd\u4ecb\u7ecd<\/strong><\/p><\/section><\/section><\/td>

        \u4ece\u8fdc\u7a0b TSMaster \u6309\u540d\u79f0\u8bfb\u53d6\u4fe1\u53f7<\/p><\/section><\/section><\/td><\/tr>

        \u8c03\u7528\u4f4d\u7f6e<\/strong><\/p><\/section><\/section><\/td>

        \u521b\u5efa TSMaster Rpc \u5ba2\u6237\u7aef\u4e4b\u540e<\/p><\/section><\/section><\/td><\/tr>

        \u8f93\u5165\u53c2\u6570<\/strong><\/p><\/section><\/section><\/td>

        AHandle : TSMaster Rpc \u5ba2\u6237\u7aef\u53e5\u67c4<\/p>

        ABusType\uff1a\u603b\u7ebf\u7c7b\u578b<\/p>

        AAddr\uff1a\u6570\u636e\u5e93\u4e2d\u4fe1\u53f7\u7684\u8def\u5f84<\/p>

        AValue: \u6570\u636e\u503c\u6307\u9488<\/p><\/section><\/section><\/td><\/tr>

        \u8fd4\u56de\u503c<\/strong><\/p><\/section><\/section><\/td>

        ==0: \u51fd\u6570\u6267\u884c\u6210\u529f<\/p>

        \u5176\u4ed6\u503c\uff1a\u51fd\u6570\u6267\u884c\u5931\u8d25<\/p><\/section><\/section><\/td><\/tr>

        \u793a\u4f8b<\/strong><\/p><\/section><\/section><\/td>

        double d;<\/p>

        if(0==rpc_tsmaster_cmd_read_signal(h,APP_CAN,<\/p>

        “0\/Powertrain\/Engine\/EngSpeed”, &d)){<\/p>

        log(“signal value = %f”, d);<\/p>

        }<\/p><\/section><\/section><\/td><\/tr><\/tbody><\/table><\/section><\/section><\/section>

        17<\/strong><\/em>\uff5crpc_tsmaster_delete_client<\/strong><\/h3><\/section><\/section>
        <\/section><\/section><\/section><\/section><\/section>

        \u51fd\u6570\u540d\u79f0<\/strong><\/p><\/section><\/section><\/td>

        UInt32 rpc_tsmaster_delete_client(const size_t AHandle)<\/p><\/section><\/section><\/td><\/tr>

        \u529f\u80fd\u4ecb\u7ecd<\/strong><\/p><\/section><\/section><\/td>

        \u5220\u9664 rpc client<\/p><\/section><\/section><\/td><\/tr>

        \u8c03\u7528\u4f4d\u7f6e<\/strong><\/p><\/section><\/section><\/td>

        \u521b\u5efa TSMaster Rpc \u5ba2\u6237\u7aef\u4e4b\u540e<\/p><\/section><\/section><\/td><\/tr>

        \u8f93\u5165\u53c2\u6570<\/strong><\/p><\/section><\/section><\/td>

        AHandle : TSMaster Rpc \u5ba2\u6237\u7aef\u53e5\u67c4<\/p><\/section><\/section><\/td><\/tr>

        \u8fd4\u56de\u503c<\/strong><\/p><\/section><\/section><\/td>

        ==0: \u51fd\u6570\u6267\u884c\u6210\u529f<\/p>

        \u5176\u4ed6\u503c\uff1a\u51fd\u6570\u6267\u884c\u5931\u8d25<\/p><\/section><\/section><\/td><\/tr>

        \u793a\u4f8b<\/strong><\/p><\/section><\/section><\/td>

        rpc_tsmaster_delete_client(h)<\/p><\/section><\/section><\/td><\/tr><\/tbody><\/table><\/section><\/section><\/section>

        18<\/strong><\/em>\uff5crpc_tsmaster_cmd_stop_simulation<\/strong><\/h3><\/section><\/section>
        <\/section><\/section><\/section><\/section><\/section>

        \u51fd\u6570\u540d\u79f0<\/strong><\/p><\/section><\/section><\/td>

        UInt32 rpc_tsmaster_cmd_stop_simulation(const size_t AHandle)<\/p><\/section><\/section><\/td><\/tr>

        \u529f\u80fd\u4ecb\u7ecd<\/strong><\/p><\/section><\/section><\/td>

        \u505c\u6b62\u8fdc\u7a0b TSMaster \u4eff\u771f<\/p><\/section><\/section><\/td><\/tr>

        \u8c03\u7528\u4f4d\u7f6e<\/strong><\/p><\/section><\/section><\/td>

        \u521b\u5efa TSMaster Rpc \u5ba2\u6237\u7aef\u4e4b\u540e<\/p><\/section><\/section><\/td><\/tr>

        \u8f93\u5165\u53c2\u6570<\/strong><\/p><\/section><\/section><\/td>

        AHandle : TSMaster Rpc \u5ba2\u6237\u7aef\u53e5\u67c4<\/p><\/section><\/section><\/td><\/tr>

        \u8fd4\u56de\u503c<\/strong><\/p><\/section><\/section><\/td>

        ==0: \u51fd\u6570\u6267\u884c\u6210\u529f<\/p>

        \u5176\u4ed6\u503c\uff1a\u51fd\u6570\u6267\u884c\u5931\u8d25<\/p><\/section><\/section><\/td><\/tr>

        \u793a\u4f8b<\/strong><\/p><\/section><\/section><\/td>

        rpc_tsmaster_cmd_stop_simulation(h)<\/p><\/section><\/section><\/td><\/tr><\/tbody><\/table><\/section><\/section><\/section>

        19<\/strong><\/em>\uff5crpc_tsmaster_call_system_api<\/strong><\/h3><\/section><\/section>
        <\/section><\/section><\/section><\/section><\/section>

        \u51fd\u6570\u540d\u79f0<\/strong><\/p><\/section><\/section><\/td>

        UInt32 rpc_tsmaster_call_system_api(const size_t AHandle,const\u00a0char* AAPIName,const s32 AArgCount,const s32 AArgCapacity,const<\/p>

        char** AArgs)<\/p><\/section><\/section><\/td><\/tr>

        \u529f\u80fd\u4ecb\u7ecd<\/strong><\/p><\/section><\/section><\/td>

        Client \u8c03\u7528 server \u7aef\u4f7f\u7528\u7cfb\u7edf\u51fd\u6570<\/strong><\/p><\/section><\/section><\/td><\/tr>

        \u8c03\u7528\u4f4d\u7f6e<\/strong><\/p><\/section><\/section><\/td>

        \u521b\u5efa TSMaster Rpc \u5ba2\u6237\u7aef\u4e4b\u540e<\/p><\/section><\/section><\/td><\/tr>

        \u8f93\u5165\u53c2\u6570<\/strong><\/p><\/section><\/section><\/td>

        AHandle : TSMaster Rpc \u5ba2\u6237\u7aef\u53e5\u67c4<\/p>

        AAPIName\uff1a\u7cfb\u7edf\u51fd\u6570\u540d\u79f0\uff0c\u201dapp.create_system_var\u201d<\/p>

        AArgCount: \u51fd\u6570\u53c2\u6570\u6570\u91cf<\/p>

        AArgCapacity\uff1a\u53c2\u6570\u5b57\u7b26\u4e32\u957f\u5ea6<\/p>

        AArgs\uff1a\u53c2\u6570\u5b57\u7b26\u4e32\u6570\u7ec4<\/p><\/section><\/section><\/td><\/tr>

        \u8fd4\u56de\u503c<\/strong><\/p><\/section><\/section><\/td>

        ==0: \u51fd\u6570\u6267\u884c\u6210\u529f<\/p>

        \u5176\u4ed6\u503c\uff1a\u51fd\u6570\u6267\u884c\u5931\u8d25<\/p><\/section><\/section><\/td><\/tr>

        \u793a\u4f8b<\/strong><\/p><\/section><\/section><\/td>

        \/\/ \u7b2c\u4e00\u6b65\uff1a\u51c6\u5907\u8c03\u7528\u51fd\u6570\u7684\u8f93\u5165\u53c2\u6570<\/p>

        #define STR_BUFFER_SIZE 1024<\/p>

        char args[4][STR_BUFFER_SIZE];<\/p>

        char* pArgs[4] = {&args[0][0], &args[1][0], &args[2][0], &args[3][0]};<\/p>

        sprintf_s(pArgs[0], STR_BUFFER_SIZE, “%s”, “var1”);<\/p>

        sprintf_s(pArgs[1], STR_BUFFER_SIZE, “%d”, svtString);<\/p>

        sprintf_s(pArgs[2], STR_BUFFER_SIZE, “%s”, “string default value”);<\/p>

        sprintf_s(pArgs[3], STR_BUFFER_SIZE, “%s”, “this is a comment”);<\/p>

        \/\/ \u6b65\u9aa4 2\uff1a\u8c03\u7528\u4efb\u610f API<\/p>

        s32 ret;<\/p>

        ret = com.rpc_tsmaster_call_system_api(h, “app.create_system_var”, 4,<\/p>

        STR_BUFFER_SIZE, &pArgs[0]);<\/p>

        \/\/ \u6b65\u9aa4 3\uff1a\u5904\u7406\u53c2\u6570\u4e2d\u7684\u8fd4\u56de\u503c\uff08\u5982\u679c\u53ef\u7528\uff09<\/p>

        s32 i;<\/p>

        log(“API call result = %d”, ret);<\/p>

        for (i=0; i<4; i++){<\/p>

        log(“Argument %d: %s”, i+1, pArgs[i]);<\/p>

        }<\/p><\/section><\/section><\/td><\/tr><\/tbody><\/table><\/section><\/section><\/section>

        20<\/strong><\/em>\uff5crpc_tsmaster_call_library_api<\/strong><\/h3><\/section><\/section>
        <\/section><\/section><\/section><\/section><\/section>

        \u51fd\u6570\u540d\u79f0<\/strong><\/p><\/section><\/section><\/td>

        UInt32 rpc_tsmaster_call_library_api(const size_t AHandle,const\u00a0char* AAPIName,const s32 AArgCount,const s32 AArgCapacity,const\u00a0\u00a0char** AArgs)<\/p><\/section><\/section><\/td><\/tr>

        \u529f\u80fd\u4ecb\u7ecd<\/strong><\/p><\/section><\/section><\/td>

        Client \u8c03\u7528 server \u7aef\u4f7f\u7528\u7cfb\u7edf\u51fd\u6570<\/strong><\/p><\/section><\/section><\/td><\/tr>

        \u8c03\u7528\u4f4d\u7f6e<\/strong><\/p><\/section><\/section><\/td>

        \u521b\u5efa TSMaster Rpc \u5ba2\u6237\u7aef\u4e4b\u540e<\/p><\/section><\/section><\/td><\/tr>

        \u8f93\u5165\u53c2\u6570<\/strong><\/p><\/section><\/section><\/td>

        AHandle : TSMaster Rpc \u5ba2\u6237\u7aef\u53e5\u67c4<\/p>

        AAPIName\uff1a\u5c0f\u7a0b\u5e8f\u5e93\u51fd\u6570\u540d\u79f0\uff0c\u201dmylib.create_system_var\u201d<\/p>

        AArgCount: \u51fd\u6570\u53c2\u6570\u6570\u91cf<\/p>

        AArgCapacity\uff1a\u53c2\u6570\u5b57\u7b26\u4e32\u957f\u5ea6<\/p>

        AArgs\uff1a\u53c2\u6570\u5b57\u7b26\u4e32\u6570\u7ec4<\/p><\/section><\/section><\/td><\/tr>

        \u8fd4\u56de\u503c<\/strong><\/p><\/section><\/section><\/td>

        ==0: \u51fd\u6570\u6267\u884c\u6210\u529f<\/p>

        \u5176\u4ed6\u503c\uff1a\u51fd\u6570\u6267\u884c\u5931\u8d25<\/p><\/section><\/section><\/td><\/tr>

        \u793a\u4f8b<\/strong><\/p><\/section><\/section><\/td>

        \/\/ \u7b2c\u4e00\u6b65\uff1a\u51c6\u5907\u8c03\u7528\u51fd\u6570\u7684\u8f93\u5165\u53c2\u6570<\/p>

        #define STR_BUFFER_SIZE 1024<\/p>

        char args[4][STR_BUFFER_SIZE];<\/p>

        char* pArgs[4] = {&args[0][0], &args[1][0], &args[2][0], &args[3][0]};<\/p>

        sprintf_s(pArgs[0], STR_BUFFER_SIZE, “%s”, “var1”);<\/p>

        sprintf_s(pArgs[1], STR_BUFFER_SIZE, “%d”, svtString);<\/p>

        sprintf_s(pArgs[2], STR_BUFFER_SIZE, “%s”, “string default value”);<\/p>

        sprintf_s(pArgs[3], STR_BUFFER_SIZE, “%s”, “this is a comment”);<\/p>

        \/\/\u6b65\u9aa4 2\uff1a\u8c03\u7528\u4efb\u610f API<\/p>

        s32 ret;<\/p>

        ret = com.rpc_tsmaster_call_library_api(h, “mylib.create_system_var”,<\/p>

        4, STR_BUFFER_SIZE, &pArgs[0]);<\/p>

        \/\/ \u6b65\u9aa4 3\uff1a\u5904\u7406\u53c2\u6570\u4e2d\u7684\u8fd4\u56de\u503c\uff08\u5982\u679c\u53ef\u7528\uff09<\/p>

        s32 i;<\/p>

        log(“API call result = %d”, ret);<\/p>

        for (i=0; i<4; i++){<\/p>

        log(“Argument %d: %s”, i+1, pArgs[i]);<\/p>

        }<\/p><\/section><\/section><\/td><\/tr><\/tbody><\/table><\/section><\/section><\/section>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"

        \u4ecb\u7ecdRPC\u6a21\u5757\u524d\uff0c\u6211\u4eec\u5148\u6d45\u804a\u4e00\u4e0bRPC\u7684\u76f8\u5173\u8bf4\u660e\uff0c\u4ee5\u53ca\u5728\u4ec0\u4e48\u6837\u7684\u60c5\u51b5\u4e0b\u9700\u8981\u4e86\u89e3\u672c\u6587 \u3002 RPC \u8bf4\u660e\u8fdc\u7a0b\u8fc7\u7a0b\u8c03 […]<\/p>\n","protected":false},"author":11,"featured_media":11646,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"ocean_post_layout":"","ocean_both_sidebars_style":"","ocean_both_sidebars_content_width":0,"ocean_both_sidebars_sidebars_width":0,"ocean_sidebar":"","ocean_second_sidebar":"","ocean_disable_margins":"enable","ocean_add_body_class":"","ocean_shortcode_before_top_bar":"","ocean_shortcode_after_top_bar":"","ocean_shortcode_before_header":"","ocean_shortcode_after_header":"","ocean_has_shortcode":"","ocean_shortcode_after_title":"","ocean_shortcode_before_footer_widgets":"","ocean_shortcode_after_footer_widgets":"","ocean_shortcode_before_footer_bottom":"","ocean_shortcode_after_footer_bottom":"","ocean_display_top_bar":"default","ocean_display_header":"default","ocean_header_style":"","ocean_center_header_left_menu":"","ocean_custom_header_template":"","ocean_custom_logo":0,"ocean_custom_retina_logo":0,"ocean_custom_logo_max_width":0,"ocean_custom_logo_tablet_max_width":0,"ocean_custom_logo_mobile_max_width":0,"ocean_custom_logo_max_height":0,"ocean_custom_logo_tablet_max_height":0,"ocean_custom_logo_mobile_max_height":0,"ocean_header_custom_menu":"","ocean_menu_typo_font_family":"","ocean_menu_typo_font_subset":"","ocean_menu_typo_font_size":0,"ocean_menu_typo_font_size_tablet":0,"ocean_menu_typo_font_size_mobile":0,"ocean_menu_typo_font_size_unit":"px","ocean_menu_typo_font_weight":"","ocean_menu_typo_font_weight_tablet":"","ocean_menu_typo_font_weight_mobile":"","ocean_menu_typo_transform":"","ocean_menu_typo_transform_tablet":"","ocean_menu_typo_transform_mobile":"","ocean_menu_typo_line_height":0,"ocean_menu_typo_line_height_tablet":0,"ocean_menu_typo_line_height_mobile":0,"ocean_menu_typo_line_height_unit":"","ocean_menu_typo_spacing":0,"ocean_menu_typo_spacing_tablet":0,"ocean_menu_typo_spacing_mobile":0,"ocean_menu_typo_spacing_unit":"","ocean_menu_link_color":"","ocean_menu_link_color_hover":"","ocean_menu_link_color_active":"","ocean_menu_link_background":"","ocean_menu_link_hover_background":"","ocean_menu_link_active_background":"","ocean_menu_social_links_bg":"","ocean_menu_social_hover_links_bg":"","ocean_menu_social_links_color":"","ocean_menu_social_hover_links_color":"","ocean_disable_title":"default","ocean_disable_heading":"default","ocean_post_title":"","ocean_post_subheading":"","ocean_post_title_style":"","ocean_post_title_background_color":"","ocean_post_title_background":0,"ocean_post_title_bg_image_position":"","ocean_post_title_bg_image_attachment":"","ocean_post_title_bg_image_repeat":"","ocean_post_title_bg_image_size":"","ocean_post_title_height":0,"ocean_post_title_bg_overlay":0.5,"ocean_post_title_bg_overlay_color":"","ocean_disable_breadcrumbs":"default","ocean_breadcrumbs_color":"","ocean_breadcrumbs_separator_color":"","ocean_breadcrumbs_links_color":"","ocean_breadcrumbs_links_hover_color":"","ocean_display_footer_widgets":"default","ocean_display_footer_bottom":"default","ocean_custom_footer_template":"","ocean_post_oembed":"","ocean_post_self_hosted_media":"","ocean_post_video_embed":"","ocean_link_format":"","ocean_link_format_target":"self","ocean_quote_format":"","ocean_quote_format_link":"post","ocean_gallery_link_images":"on","ocean_gallery_id":[],"footnotes":""},"categories":[90],"tags":[306,131,236],"class_list":["post-11643","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software-tutorial","tag-rpc","tag-tsmaster","tag-236","entry","has-media","owp-thumbs-layout-horizontal","owp-btn-normal","owp-tabs-layout-horizontal","has-no-thumbnails","has-product-nav"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tosunai.com\/wp-json\/wp\/v2\/posts\/11643","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tosunai.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tosunai.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tosunai.com\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tosunai.com\/wp-json\/wp\/v2\/comments?post=11643"}],"version-history":[{"count":0,"href":"https:\/\/www.tosunai.com\/wp-json\/wp\/v2\/posts\/11643\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.tosunai.com\/wp-json\/wp\/v2\/media\/11646"}],"wp:attachment":[{"href":"https:\/\/www.tosunai.com\/wp-json\/wp\/v2\/media?parent=11643"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tosunai.com\/wp-json\/wp\/v2\/categories?post=11643"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tosunai.com\/wp-json\/wp\/v2\/tags?post=11643"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}