{"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\/en\/tsmaster-rpc-programming-guide-and-instructions\/","title":{"rendered":"Sharing | Getting Started with TSMaster RPC Basics: Programming Guidelines and Usage Notes"},"content":{"rendered":"
\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

Before we introduce the RPC module, let's have a brief chat about RPC and the circumstances under which you need to know this article .<\/p>

  1. RPC Description
    <\/strong>Remote Procedure Call (RPC, Remote Procedure Call) is a network communication protocol that allows a program to call a program or service on another computer as if it were a local program.The main purpose of RPC is to simplify distributed computing by eliminating the need for developers to concern themselves with the details of underlying network communications.

    <\/li>
  2. When do I need to know about this article?
    <\/strong>Users who have developed a corresponding application project based on TSMaster and want to automate the control of TSMaster in an external program can consult this article.(Note: In addition to RPC, TSMaster also provides COM-based interfaces, which can be found in a separate article.)<\/span>

    This article applies to the program control mode: TSMaster1 control TSMaster2, or other processes control TSMaster process (using TSMaster.dll) for the language: C + + + , Python, C# and other languages.<\/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
    Table of Contents for this article<\/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 | Basic Concepts of RPC<\/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

    Client and Server:<\/strong><\/p>

    Client: The program that initiates the RPC request.<\/p>

    Server: The program that receives the RPC request and performs the corresponding procedure.<\/p>

    \u00a0<\/p>

    Representation.<\/strong><\/p>

    Client Agent: Encapsulates the request and sends it to the server.<\/p>

    Server Proxy: receives the request, unpacks it and invokes the local procedure, after which it returns the result to the client proxy.<\/p>

    \u00a0<\/p>

    Communication mechanisms.<\/strong><\/p>

    Transport Protocol: The protocol used by the underlying layer, e.g. TCP, UDP.<\/p>

    Data Serialization: Converting data structures or objects into a format that can be transmitted, such as JSON, XML, Protocol Buffers.<\/p>

    \u00a0<\/p>

    RPC Workflow.<\/strong><\/p>

    • Client calls local proxy method: the client calls a method that appears to be local, but is actually handled by the client proxy;<\/li>
    • Client agent serialization request: packages information such as method names, parameters, etc. into a message;<\/li>
    • Message Transfer: The client agent transfers the message over the network to the server;<\/li>
    • Server proxy unpacking request: after receiving the message, the server proxy unpacks the message and calls the actual local method;<\/li>
    • Execute method and generate response: After the local method is executed, generate the response result;<\/li>
    • Server agent packages the response: the server agent packages the result into a message and sends it back to the client over the network;<\/li>
    • Client Agent Unpacking Response: After receiving the response message, the client agent unpacks it and returns the result to the client.<\/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. TSMaster RPC Application\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 Function<\/h3>

      Based on TSMaster's RPC mechanism, users can build a complete project in TSMaster's host environment, covering a series of processes from test case development to programmed device management, bus communication configuration and control board operation. Through this mechanism, users can efficiently control the TSMaster server remotely from the client.Read and write operations to system variables, CAN signals, LIN signals, FlexRay signals, Ethernet (ETH) signals, etc. can be realized. In addition, the user can call various functions defined on the TSMaster server<\/span><\/strong>, further expanding and customizing the system's functionality.<\/p>

      \u00a0<\/p>

      This integrated solution makes engineering management and automated testing more convenient and efficient. Users do not need to switch between multiple platforms to accomplish complex tasks including hardware configuration, signal monitoring, data acquisition and test execution. Through TSMaster's RPC mechanism, users can realize remote program control of the server on the client side, which simplifies the operation process, improves the efficiency of testing and development, and ensures the stability and reliability of the system.<\/p>


      TSMaster provides powerful interfaces and rich functional modules, which can be flexibly combined and used by users according to their needs to realize fine control and management of various signals and devices. This architecture is not only suitable for the R&D testing stage, but also for real-time monitoring and troubleshooting in the production environment, which greatly improves the overall quality and efficiency of engineering projects.<\/p>

      \u00a0<\/p>

      In addition, TSMaster's RPC mechanism supports a variety of topologies, enabling not only one-to-one communication between client and server, but also the following complex communication topologies:<\/p>

      \u00a0<\/p>

      1. One-to-Many:<\/span><\/strong>A single client can control multiple TSMaster servers at the same time, for situations where multiple test environments or devices need to be managed at the same time.<\/li>
      2. Many-to-One:<\/strong><\/span>Multiple clients can connect to one TSMaster server at the same time, so that different users or test systems can share the same server resources to realize collaborative work and resource sharing.<\/li>
      3. Many-to-Many:<\/strong><\/span>Flexible communication and control between multiple clients and multiple servers is possible to build complex distributed test and control systems, suitable for large-scale engineering projects and distributed test environments.<\/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's\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

        This flexible topology enables TSMaster to adapt to a variety of complex engineering needs, providing an efficient and reliable solution both in a single project and in distributed testing across projects and geographic regions. Through this diversified communication mode, users can maximize the use of hardware and software resources, improve the scalability and flexibility of the system, and meet the needs of engineering projects of different scales and complexity.<\/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. TSMaster RPC User's Guide<\/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\tBased on the RPC mechanism, TSMaster provides a corresponding interface to activate the RPC server side in the project that needs to be programmed to provide the corresponding resources for the programmed script.\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\uff5cActivate server<\/h3>

        To open the server side, do the following:<\/p>

        \u00a0<\/p>

        Create a new C script and enter the following code in the startup event, which means that the rpc server of the current project is activated rpc_tsmaster_activate_server(true);<\/p>

        In fact, the RPC feature has been activated by default for all TSMaster projects after the TSMaster v2024.06.05.1124 release.<\/p>

        \u00a0<\/p>

        2\uff5cLive client<\/h3>

        native_int h; \/\/client handle<\/p>

        \/\/ Parameter 1 is the name of the TSMaster application providing the rpc service.<\/p>

        com.rpc_tsmaster_create_client(\"TSMaster\",&h);<\/p>

        \/\/ Activate the client side<\/p>

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

        \u00a0<\/p>

        3\uff5cModify server-side data<\/h3>

        3.1 Starting and stopping the server project<\/strong><\/span><\/p>

        Launching the project:<\/p>

        TSMaster applet:<\/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 Reading and writing system variables<\/strong><\/span><\/p>

        Set system variables:<\/p>

        TSMaster applet:<\/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\u2033, \"1.2345\u2033);<\/span><\/p>

        \u00a0<\/p>

        Get system variables:<\/p>

        TSMaster applet:<\/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\u2033, \"1.2345\u2033);<\/span><\/p>

        \u00a0<\/p>

        \u00a0<\/p>

        3.3 Reading and writing CAN signals<\/span><\/strong><\/p>

        Set the CAN signal:<\/p>

        TSMaster applet:<\/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>

        Get CAN signal:<\/p>

        double d = 0;<\/p>

        TSMaster applet:<\/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 Reading and writing LIN signals<\/strong><\/span><\/p>

        Set the LIN signal:<\/p>

        TSMaster applet:<\/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>

        Get LIN signal:<\/p>

        double d = 0;<\/p>

        TSMaster applet:<\/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 Reading and Writing FlexRay Signals<\/strong><\/span><\/p>

        Set the FR signal:<\/p>

        TSMaster applet:<\/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>

        Acquire the FR signal:<\/p>

        double d = 0;<\/p>

        TSMaster applet:<\/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 Using the TSMaster System Functions<\/strong><\/span><\/p>

        \u00a0<\/p>

        \/\/ The first step is to prepare the input parameters for the function call.<\/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>

        \/\/ Step 2: Call any 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>

        \/\/ Step 3: Process return values in parameters (if available)<\/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>

        The above code is equivalent to using app.create_system_var in the TSMaster process to create a system variable, i.e.: app.create_system_var(var1,svtString, \"string default value \", \"this is a comment\");<\/p>

        \u00a0<\/p>

        Note that calling system functions within TSMaster in this way does not allow you to use functions whose arguments are of pointer type (except for message types).<\/span><\/p>

        \u00a0<\/p>

        \u00a0<\/p>

        3.7 RPC Using Applet Library Functions<\/strong><\/span><\/p>

        \u00a0<\/p>

        \/\/ The first step is to prepare the input parameters for the function call.<\/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>

        \/Step 2: Call any API<\/span><\/p>

        s32 ret;TSMaster RPC Programming Guide<\/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>

        \/\/ Step 3: Process return values in parameters (if available)<\/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, TSMaster RPC function description\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\tBased on the RPC mechanism, TSMaster provides a corresponding interface to activate the RPC server side in the project that needs to be programmed to provide the corresponding resources for the programmed script.\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>
        function name<\/strong><\/section><\/section><\/td>
        UInt32 rpc_tsmaster_create_client(const char* ATSMasterAppName,const psize_t AHandle)<\/section><\/section><\/td><\/tr>
        Function<\/strong><\/section><\/section><\/td>
        Creating a TSMaster Rpc Client<\/section><\/section><\/td><\/tr>
        call location<\/strong><\/section><\/section><\/td>
        After initializing the tsmaster lib library<\/section><\/section><\/td><\/tr>
        input parameter<\/strong><\/section><\/section><\/td>
        ATSMasterAppName: Application name of the TSMaster server side;AHandle : TSMaster Rpc client handle<\/section><\/section><\/td><\/tr>
        return value<\/strong><\/section><\/section><\/td>
        ==0: function execution success other values: function execution failure<\/section><\/section><\/td><\/tr>
        typical example<\/strong><\/section><\/section><\/td>
        s32 h;rpc_tsmaster_create_client(\"TSMaster1\", &h)<\/section><\/section><\/td><\/tr><\/tbody><\/table>

        2\uff5crpc_tsmaster_activate_client<\/h3>

        function name<\/strong><\/p><\/section><\/section><\/td>

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

        Function<\/strong><\/p><\/section><\/section><\/td>

        Activating or deactivating a TSMaster Rpc client<\/p><\/section><\/section><\/td><\/tr>

        call location<\/strong><\/p><\/section><\/section><\/td>

        After creating the TSMaster Rpc client<\/p><\/section><\/section><\/td><\/tr>

        input parameter<\/strong><\/p><\/section><\/section><\/td>

        AHandle : TSMaster Rpc Client Handle<\/p>

        AActivate: true=activate, false=deactivate<\/p><\/section><\/section><\/td><\/tr>

        return value<\/strong><\/p><\/section><\/section><\/td>

        ==0: function executed successfully<\/p>

        Other values: function execution failed<\/p><\/section><\/section><\/td><\/tr>

        typical example<\/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>

        function name<\/strong><\/p><\/section><\/section><\/td>

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

        Function<\/strong><\/p><\/section><\/section><\/td>

        Getting the Status of a Remote TSMaster Emulation Run<\/p><\/section><\/section><\/td><\/tr>

        call location<\/strong><\/p><\/section><\/section><\/td>

        After creating the TSMaster Rpc client<\/p><\/section><\/section><\/td><\/tr>

        input parameter<\/strong><\/p><\/section><\/section><\/td>

        AHandle : TSMaster Rpc Client Handle<\/p>

        AIsRunning: data pointer to the state of the remote TSMaster emulation running<\/p>

        True = running, false = not running<\/p><\/section><\/section><\/td><\/tr>

        return value<\/strong><\/p><\/section><\/section><\/td>

        ==0: function executed successfully<\/p>

        Other values: function execution failed<\/p><\/section><\/section><\/td><\/tr>

        typical example<\/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>

        function name<\/strong><\/p><\/section><\/section><\/td>

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

        Function<\/strong><\/p><\/section><\/section><\/td>

        Configuring the TSMaster Rpc server to real-time mode<\/p><\/section><\/section><\/td><\/tr>

        call location<\/strong><\/p><\/section><\/section><\/td>

        After creating the TSMaster Rpc client and before running the simulation<\/p><\/section><\/section><\/td><\/tr>

        input parameter<\/strong><\/p><\/section><\/section><\/td>

        AHandle : TSMaster Rpc Client Handle<\/p><\/section><\/section><\/td><\/tr>

        return value<\/strong><\/p><\/section><\/section><\/td>

        ==0: function executed successfully<\/p>

        Other values: function execution failed<\/p><\/section><\/section><\/td><\/tr>

        typical example<\/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>

        function name<\/strong><\/p><\/section><\/section><\/td>

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

        Function<\/strong><\/p><\/section><\/section><\/td>

        Configure the TSMaster Rpc server to emulation mode<\/p><\/section><\/section><\/td><\/tr>

        call location<\/strong><\/p><\/section><\/section><\/td>

        After creating the TSMaster Rpc client and before running the simulation<\/p><\/section><\/section><\/td><\/tr>

        input parameter<\/strong><\/p><\/section><\/section><\/td>

        AHandle : TSMaster Rpc Client Handle<\/p><\/section><\/section><\/td><\/tr>

        return value<\/strong><\/p><\/section><\/section><\/td>

        ==0: function executed successfully<\/p>

        Other values: function execution failed<\/p><\/section><\/section><\/td><\/tr>

        typical example<\/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>

        function name<\/strong><\/p><\/section><\/section><\/td>

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

        Function<\/strong><\/p><\/section><\/section><\/td>

        Start the TSMaster Rpc server emulation<\/p><\/section><\/section><\/td><\/tr>

        call location<\/strong><\/p><\/section><\/section><\/td>

        After creating the TSMaster Rpc client<\/p><\/section><\/section><\/td><\/tr>

        input parameter<\/strong><\/p><\/section><\/section><\/td>

        AHandle : TSMaster Rpc Client Handle<\/p><\/section><\/section><\/td><\/tr>

        return value<\/strong><\/p><\/section><\/section><\/td>

        ==0: function executed successfully<\/p>

        Other values: function execution failed<\/p><\/section><\/section><\/td><\/tr>

        typical example<\/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>

        function name<\/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>

        Function<\/strong><\/p><\/section><\/section><\/td>

        Modifying CAN signal values in the database on a remote TSMaster<\/p><\/section><\/section><\/td><\/tr>

        call location<\/strong><\/p><\/section><\/section><\/td>

        After creating the TSMaster Rpc client<\/p><\/section><\/section><\/td><\/tr>

        input parameter<\/strong><\/p><\/section><\/section><\/td>

        AHandle : TSMaster Rpc Client Handle<\/p>

        ASgnAddress: path to the signal in the database<\/p>

        AValue: signal value<\/p><\/section><\/section><\/td><\/tr>

        return value<\/strong><\/p><\/section><\/section><\/td>

        ==0: function executed successfully<\/p>

        Other values: function execution failed<\/p><\/section><\/section><\/td><\/tr>

        typical example<\/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>

        function name<\/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>

        Function<\/strong><\/p><\/section><\/section><\/td>

        Getting CAN Signal Values in the Database on a Remote TSMaster<\/p><\/section><\/section><\/td><\/tr>

        call location<\/strong><\/p><\/section><\/section><\/td>

        After creating the TSMaster Rpc client<\/p><\/section><\/section><\/td><\/tr>

        input parameter<\/strong><\/p><\/section><\/section><\/td>

        AHandle : TSMaster Rpc Client Handle<\/p>

        ASgnAddress: path to the signal in the database<\/p>

        AValue: Pointer to signal value<\/p><\/section><\/section><\/td><\/tr>

        return value<\/strong><\/p><\/section><\/section><\/td>

        ==0: function executed successfully<\/p>

        Other values: function execution failed<\/p><\/section><\/section><\/td><\/tr>

        typical example<\/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>

        function name<\/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>

        Function<\/strong><\/p><\/section><\/section><\/td>

        Modifying LIN signal values in the database on a remote TSMaster<\/p><\/section><\/section><\/td><\/tr>

        call location<\/strong><\/p><\/section><\/section><\/td>

        After creating the TSMaster Rpc client<\/p><\/section><\/section><\/td><\/tr>

        input parameter<\/strong><\/p><\/section><\/section><\/td>

        AHandle : TSMaster Rpc Client Handle<\/p>

        ASgnAddress: path to the signal in the database<\/p>

        AValue: signal value<\/p><\/section><\/section><\/td><\/tr>

        return value<\/strong><\/p><\/section><\/section><\/td>

        ==0: function executed successfully<\/p>

        Other values: function execution failed<\/p><\/section><\/section><\/td><\/tr>

        typical example<\/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>

        function name<\/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>

        Function<\/strong><\/p><\/section><\/section><\/td>

        Getting LIN Signal Values in the Database on a Remote TSMaster<\/p><\/section><\/section><\/td><\/tr>

        call location<\/strong><\/p><\/section><\/section><\/td>

        After creating the TSMaster Rpc client<\/p><\/section><\/section><\/td><\/tr>

        input parameter<\/strong><\/p><\/section><\/section><\/td>

        AHandle : TSMaster Rpc Client Handle<\/p>

        ASgnAddress: path to the signal in the database<\/p>

        AValue: Pointer to signal value<\/p><\/section><\/section><\/td><\/tr>

        return value<\/strong><\/p><\/section><\/section><\/td>

        ==0: function executed successfully<\/p>

        Other values: function execution failed<\/p><\/section><\/section><\/td><\/tr>

        typical example<\/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>

        function name<\/strong><\/p><\/section><\/section><\/td>

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

        Function<\/strong><\/p><\/section><\/section><\/td>

        Modifying flexray signal values in the database on a remote TSMaster<\/p><\/section><\/section><\/td><\/tr>

        call location<\/strong><\/p><\/section><\/section><\/td>

        After creating the TSMaster Rpc client<\/p><\/section><\/section><\/td><\/tr>

        input parameter<\/strong><\/p><\/section><\/section><\/td>

        AHandle : TSMaster Rpc Client Handle<\/p>

        ASgnAddress: path to the signal in the database<\/p>

        AValue: signal value<\/p><\/section><\/section><\/td><\/tr>

        return value<\/strong><\/p><\/section><\/section><\/td>

        ==0: function executed successfully<\/p>

        Other values: function execution failed<\/p><\/section><\/section><\/td><\/tr>

        typical example<\/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>

        function name<\/strong><\/p><\/section><\/section><\/td>

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

        Function<\/strong><\/p><\/section><\/section><\/td>

        Getting the flexray signal value in the database on a remote TSMaster<\/p><\/section><\/section><\/td><\/tr>

        call location<\/strong><\/p><\/section><\/section><\/td>

        After creating the TSMaster Rpc client<\/p><\/section><\/section><\/td><\/tr>

        input parameter<\/strong><\/p><\/section><\/section><\/td>

        AHandle : TSMaster Rpc Client Handle<\/p>

        ASgnAddress: path to the signal in the database<\/p>

        AValue: Pointer to signal value<\/p><\/section><\/section><\/td><\/tr>

        return value<\/strong><\/p><\/section><\/section><\/td>

        ==0: function executed successfully<\/p>

        Other values: function execution failed<\/p><\/section><\/section><\/td><\/tr>

        typical example<\/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>

        function name<\/strong><\/p><\/section><\/section><\/td>

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

        Function<\/strong><\/p><\/section><\/section><\/td>

        Writing System Variables by Name from a Remote TSMaster<\/p><\/section><\/section><\/td><\/tr>

        call location<\/strong><\/p><\/section><\/section><\/td>

        After creating the TSMaster Rpc client<\/p><\/section><\/section><\/td><\/tr>

        input parameter<\/strong><\/p><\/section><\/section><\/td>

        AHandle : TSMaster Rpc Client Handle<\/p>

        ACompleteName: system variable name<\/p>

        AValue: Data value<\/p><\/section><\/section><\/td><\/tr>

        return value<\/strong><\/p><\/section><\/section><\/td>

        ==0: function executed successfully<\/p>

        Other values: function execution failed<\/p><\/section><\/section><\/td><\/tr>

        typical example<\/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>

        function name<\/strong><\/p><\/section><\/section><\/td>

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

        Function<\/strong><\/p><\/section><\/section><\/td>

        Reading System Variables by Name from a Remote TSMaster\u00a0\u00a0\u00a0\u00a0<\/p><\/section><\/section><\/td><\/tr>

        call location<\/strong><\/p><\/section><\/section><\/td>

        After creating the TSMaster Rpc client<\/p><\/section><\/section><\/td><\/tr>

        input parameter<\/strong><\/p><\/section><\/section><\/td>

        AHandle : TSMaster Rpc Client Handle<\/p>

        ASysVarName: system variable name<\/p>

        AValue: data value pointer<\/p><\/section><\/section><\/td><\/tr>

        return value<\/strong><\/p><\/section><\/section><\/td>

        ==0: function executed successfully<\/p>

        Other values: function execution failed<\/p><\/section><\/section><\/td><\/tr>

        typical example<\/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>

        function name<\/strong><\/p><\/section><\/section><\/td>

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

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

        Function<\/strong><\/p><\/section><\/section><\/td>

        Write signal values by name from a remote TSMaster<\/p><\/section><\/section><\/td><\/tr>

        call location<\/strong><\/p><\/section><\/section><\/td>

        After creating the TSMaster Rpc client<\/p><\/section><\/section><\/td><\/tr>

        input parameter<\/strong><\/p><\/section><\/section><\/td>

        AHandle : TSMaster Rpc Client Handle<\/p>

        ABusType: bus type<\/p>

        AAddr: path to the signal in the database<\/p>

        AValue: Data value<\/p><\/section><\/section><\/td><\/tr>

        return value<\/strong><\/p><\/section><\/section><\/td>

        ==0: function executed successfully<\/p>

        Other values: function execution failed<\/p><\/section><\/section><\/td><\/tr>

        typical example<\/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>

        function name<\/strong><\/p><\/section><\/section><\/td>

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

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

        Function<\/strong><\/p><\/section><\/section><\/td>

        Reading signals by name from a remote TSMaster<\/p><\/section><\/section><\/td><\/tr>

        call location<\/strong><\/p><\/section><\/section><\/td>

        After creating the TSMaster Rpc client<\/p><\/section><\/section><\/td><\/tr>

        input parameter<\/strong><\/p><\/section><\/section><\/td>

        AHandle : TSMaster Rpc Client Handle<\/p>

        ABusType: bus type<\/p>

        AAddr: path to the signal in the database<\/p>

        AValue: data value pointer<\/p><\/section><\/section><\/td><\/tr>

        return value<\/strong><\/p><\/section><\/section><\/td>

        ==0: function executed successfully<\/p>

        Other values: function execution failed<\/p><\/section><\/section><\/td><\/tr>

        typical example<\/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>

        function name<\/strong><\/p><\/section><\/section><\/td>

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

        Function<\/strong><\/p><\/section><\/section><\/td>

        Delete rpc client<\/p><\/section><\/section><\/td><\/tr>

        call location<\/strong><\/p><\/section><\/section><\/td>

        After creating the TSMaster Rpc client<\/p><\/section><\/section><\/td><\/tr>

        input parameter<\/strong><\/p><\/section><\/section><\/td>

        AHandle : TSMaster Rpc Client Handle<\/p><\/section><\/section><\/td><\/tr>

        return value<\/strong><\/p><\/section><\/section><\/td>

        ==0: function executed successfully<\/p>

        Other values: function execution failed<\/p><\/section><\/section><\/td><\/tr>

        typical example<\/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>

        function name<\/strong><\/p><\/section><\/section><\/td>

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

        Function<\/strong><\/p><\/section><\/section><\/td>

        Stop the remote TSMaster emulation<\/p><\/section><\/section><\/td><\/tr>

        call location<\/strong><\/p><\/section><\/section><\/td>

        After creating the TSMaster Rpc client<\/p><\/section><\/section><\/td><\/tr>

        input parameter<\/strong><\/p><\/section><\/section><\/td>

        AHandle : TSMaster Rpc Client Handle<\/p><\/section><\/section><\/td><\/tr>

        return value<\/strong><\/p><\/section><\/section><\/td>

        ==0: function executed successfully<\/p>

        Other values: function execution failed<\/p><\/section><\/section><\/td><\/tr>

        typical example<\/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>

        function name<\/strong><\/p><\/section><\/section><\/td>

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

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

        Function<\/strong><\/p><\/section><\/section><\/td>

        Client calls server to use system functions<\/strong><\/p><\/section><\/section><\/td><\/tr>

        call location<\/strong><\/p><\/section><\/section><\/td>

        After creating the TSMaster Rpc client<\/p><\/section><\/section><\/td><\/tr>

        input parameter<\/strong><\/p><\/section><\/section><\/td>

        AHandle : TSMaster Rpc Client Handle<\/p>

        AAPIName: name of the system function, \"app.create_system_var\"<\/p>

        AArgCount: number of function arguments<\/p>

        AArgCapacity: length of parameter string<\/p>

        AArgs: array of argument strings<\/p><\/section><\/section><\/td><\/tr>

        return value<\/strong><\/p><\/section><\/section><\/td>

        ==0: function executed successfully<\/p>

        Other values: function execution failed<\/p><\/section><\/section><\/td><\/tr>

        typical example<\/strong><\/p><\/section><\/section><\/td>

        \/\/ The first step is to prepare the input parameters for the function call.<\/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>

        \/\/ Step 2: Call any 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>

        \/\/ Step 3: Process return values in parameters (if available)<\/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>

        function name<\/strong><\/p><\/section><\/section><\/td>

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

        Function<\/strong><\/p><\/section><\/section><\/td>

        Client calls server to use system functions<\/strong><\/p><\/section><\/section><\/td><\/tr>

        call location<\/strong><\/p><\/section><\/section><\/td>

        After creating the TSMaster Rpc client<\/p><\/section><\/section><\/td><\/tr>

        input parameter<\/strong><\/p><\/section><\/section><\/td>

        AHandle : TSMaster Rpc Client Handle<\/p>

        AAPIName: applet library function name, \"mylib.create_system_var\"<\/p>

        AArgCount: number of function arguments<\/p>

        AArgCapacity: length of parameter string<\/p>

        AArgs: array of argument strings<\/p><\/section><\/section><\/td><\/tr>

        return value<\/strong><\/p><\/section><\/section><\/td>

        ==0: function executed successfully<\/p>

        Other values: function execution failed<\/p><\/section><\/section><\/td><\/tr>

        typical example<\/strong><\/p><\/section><\/section><\/td>

        \/\/ The first step is to prepare the input parameters for the function call.<\/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>

        \/Step 2: Call any 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>

        \/\/ Step 3: Process return values in parameters (if available)<\/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>","protected":false},"excerpt":{"rendered":"

        Before introducing the RPC module, let's have a superficial chat about RPC instructions and in what kind of situations you need to know this article . RPC Description Remote Procedure Call [...]<\/p>","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\/en\/wp-json\/wp\/v2\/posts\/11643","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tosunai.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tosunai.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tosunai.com\/en\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tosunai.com\/en\/wp-json\/wp\/v2\/comments?post=11643"}],"version-history":[{"count":0,"href":"https:\/\/www.tosunai.com\/en\/wp-json\/wp\/v2\/posts\/11643\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.tosunai.com\/en\/wp-json\/wp\/v2\/media\/11646"}],"wp:attachment":[{"href":"https:\/\/www.tosunai.com\/en\/wp-json\/wp\/v2\/media?parent=11643"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tosunai.com\/en\/wp-json\/wp\/v2\/categories?post=11643"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tosunai.com\/en\/wp-json\/wp\/v2\/tags?post=11643"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}