C_runtime/service/erpc_PLCObject_server.cpp
author Edouard Tisserant <edouard.tisserant@gmail.com>
Tue, 03 Dec 2024 21:26:52 +0100
changeset 4058 5472b88bbc9d
permissions -rw-r--r--
C runtime: move generated erpc interface in separate "service" directory
4058
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     1
/*
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     2
 * Generated by erpcgen 1.13.0 on Fri Nov 22 15:03:08 2024.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     3
 *
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     4
 * AUTOGENERATED - DO NOT EDIT
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     5
 */
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     6
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     7
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     8
#include "erpc_PLCObject_server.hpp"
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     9
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    10
#include <new>
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    11
#include "erpc_port.h"
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    12
#endif
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    13
#include "erpc_manually_constructed.hpp"
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    14
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    15
#if 11300 != ERPC_VERSION_NUMBER
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    16
#error "The generated shim code version is different to the rest of eRPC code."
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    17
#endif
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    18
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    19
using namespace erpc;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    20
using namespace std;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    21
using namespace erpcShim;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    22
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    23
#if ERPC_NESTED_CALLS_DETECTION
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    24
extern bool nestingDetection;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    25
#endif
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    26
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    27
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    28
//! @brief Function to read struct binary_t
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    29
static void read_binary_t_struct(erpc::Codec * codec, binary_t * data);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    30
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    31
//! @brief Function to read struct extra_file
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    32
static void read_extra_file_struct(erpc::Codec * codec, extra_file * data);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    33
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    34
//! @brief Function to read struct list_extra_file_1_t
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    35
static void read_list_extra_file_1_t_struct(erpc::Codec * codec, list_extra_file_1_t * data);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    36
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    37
//! @brief Function to read struct trace_order
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    38
static void read_trace_order_struct(erpc::Codec * codec, trace_order * data);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    39
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    40
//! @brief Function to read struct list_trace_order_1_t
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    41
static void read_list_trace_order_1_t_struct(erpc::Codec * codec, list_trace_order_1_t * data);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    42
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    43
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    44
// Read struct binary_t function implementation
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    45
static void read_binary_t_struct(erpc::Codec * codec, binary_t * data)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    46
{
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    47
    if(NULL == data)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    48
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    49
        return;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    50
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    51
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    52
    uint8_t * data_local;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    53
    codec->readBinary(data->dataLength, &data_local);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    54
    if (data->dataLength > 0)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    55
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    56
    data->data = (uint8_t *) erpc_malloc(data->dataLength * sizeof(uint8_t));
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    57
        if (data->data == NULL)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    58
        {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    59
            codec->updateStatus(kErpcStatus_MemoryError);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    60
        }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    61
        else
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    62
        {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    63
            memcpy(data->data, data_local, data->dataLength);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    64
        }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    65
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    66
    else
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    67
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    68
        data->data = NULL;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    69
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    70
}
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    71
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    72
// Read struct extra_file function implementation
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    73
static void read_extra_file_struct(erpc::Codec * codec, extra_file * data)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    74
{
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    75
    if(NULL == data)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    76
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    77
        return;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    78
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    79
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    80
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    81
        uint32_t fname_len;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    82
        char * fname_local;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    83
        codec->readString(fname_len, &fname_local);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    84
        data->fname = (char*) erpc_malloc((fname_len + 1) * sizeof(char));
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    85
        if ((data->fname == NULL) || (fname_local == NULL))
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    86
        {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    87
            codec->updateStatus(kErpcStatus_MemoryError);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    88
        }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    89
        else
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    90
        {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    91
            memcpy(data->fname, fname_local, fname_len);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    92
            (data->fname)[fname_len] = 0;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    93
        }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    94
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    95
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    96
    read_binary_t_struct(codec, &(data->blobID));
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    97
}
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    98
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    99
// Read struct list_extra_file_1_t function implementation
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   100
static void read_list_extra_file_1_t_struct(erpc::Codec * codec, list_extra_file_1_t * data)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   101
{
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   102
    if(NULL == data)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   103
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   104
        return;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   105
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   106
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   107
    codec->startReadList(data->elementsCount);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   108
    data->elements = (extra_file *) erpc_malloc(data->elementsCount * sizeof(extra_file));
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   109
    if ((data->elements == NULL) && (data->elementsCount > 0))
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   110
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   111
        codec->updateStatus(kErpcStatus_MemoryError);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   112
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   113
    for (uint32_t listCount = 0U; listCount < data->elementsCount; ++listCount)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   114
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   115
        read_extra_file_struct(codec, &(data->elements[listCount]));
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   116
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   117
}
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   118
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   119
// Read struct trace_order function implementation
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   120
static void read_trace_order_struct(erpc::Codec * codec, trace_order * data)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   121
{
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   122
    if(NULL == data)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   123
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   124
        return;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   125
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   126
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   127
    codec->read(data->idx);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   128
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   129
    read_binary_t_struct(codec, &(data->force));
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   130
}
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   131
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   132
// Read struct list_trace_order_1_t function implementation
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   133
static void read_list_trace_order_1_t_struct(erpc::Codec * codec, list_trace_order_1_t * data)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   134
{
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   135
    if(NULL == data)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   136
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   137
        return;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   138
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   139
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   140
    codec->startReadList(data->elementsCount);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   141
    data->elements = (trace_order *) erpc_malloc(data->elementsCount * sizeof(trace_order));
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   142
    if ((data->elements == NULL) && (data->elementsCount > 0))
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   143
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   144
        codec->updateStatus(kErpcStatus_MemoryError);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   145
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   146
    for (uint32_t listCount = 0U; listCount < data->elementsCount; ++listCount)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   147
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   148
        read_trace_order_struct(codec, &(data->elements[listCount]));
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   149
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   150
}
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   151
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   152
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   153
//! @brief Function to write struct binary_t
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   154
static void write_binary_t_struct(erpc::Codec * codec, const binary_t * data);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   155
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   156
//! @brief Function to write struct log_message
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   157
static void write_log_message_struct(erpc::Codec * codec, const log_message * data);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   158
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   159
//! @brief Function to write struct PSKID
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   160
static void write_PSKID_struct(erpc::Codec * codec, const PSKID * data);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   161
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   162
//! @brief Function to write struct PLCstatus
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   163
static void write_PLCstatus_struct(erpc::Codec * codec, const PLCstatus * data);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   164
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   165
//! @brief Function to write struct trace_sample
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   166
static void write_trace_sample_struct(erpc::Codec * codec, const trace_sample * data);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   167
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   168
//! @brief Function to write struct TraceVariables
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   169
static void write_TraceVariables_struct(erpc::Codec * codec, const TraceVariables * data);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   170
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   171
//! @brief Function to write struct list_trace_sample_1_t
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   172
static void write_list_trace_sample_1_t_struct(erpc::Codec * codec, const list_trace_sample_1_t * data);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   173
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   174
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   175
// Write struct binary_t function implementation
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   176
static void write_binary_t_struct(erpc::Codec * codec, const binary_t * data)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   177
{
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   178
    if(NULL == data)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   179
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   180
        return;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   181
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   182
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   183
    codec->writeBinary(data->dataLength, data->data);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   184
}
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   185
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   186
// Write struct log_message function implementation
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   187
static void write_log_message_struct(erpc::Codec * codec, const log_message * data)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   188
{
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   189
    if(NULL == data)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   190
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   191
        return;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   192
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   193
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   194
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   195
        uint32_t msg_len = strlen((const char*)data->msg);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   196
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   197
        codec->writeString(msg_len, (const char*)data->msg);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   198
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   199
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   200
    codec->write(data->tick);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   201
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   202
    codec->write(data->sec);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   203
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   204
    codec->write(data->nsec);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   205
}
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   206
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   207
// Write struct PSKID function implementation
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   208
static void write_PSKID_struct(erpc::Codec * codec, const PSKID * data)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   209
{
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   210
    if(NULL == data)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   211
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   212
        return;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   213
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   214
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   215
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   216
        uint32_t ID_len = strlen((const char*)data->ID);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   217
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   218
        codec->writeString(ID_len, (const char*)data->ID);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   219
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   220
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   221
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   222
        uint32_t PSK_len = strlen((const char*)data->PSK);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   223
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   224
        codec->writeString(PSK_len, (const char*)data->PSK);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   225
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   226
}
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   227
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   228
// Write struct PLCstatus function implementation
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   229
static void write_PLCstatus_struct(erpc::Codec * codec, const PLCstatus * data)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   230
{
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   231
    if(NULL == data)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   232
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   233
        return;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   234
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   235
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   236
    codec->write(static_cast<int32_t>(data->PLCstatus));
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   237
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   238
    for (uint32_t arrayCount0 = 0U; arrayCount0 < 4U; ++arrayCount0)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   239
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   240
        codec->write(data->logcounts[arrayCount0]);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   241
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   242
}
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   243
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   244
// Write struct trace_sample function implementation
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   245
static void write_trace_sample_struct(erpc::Codec * codec, const trace_sample * data)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   246
{
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   247
    if(NULL == data)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   248
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   249
        return;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   250
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   251
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   252
    codec->write(data->tick);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   253
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   254
    write_binary_t_struct(codec, &(data->TraceBuffer));
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   255
}
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   256
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   257
// Write struct TraceVariables function implementation
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   258
static void write_TraceVariables_struct(erpc::Codec * codec, const TraceVariables * data)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   259
{
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   260
    if(NULL == data)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   261
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   262
        return;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   263
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   264
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   265
    codec->write(static_cast<int32_t>(data->PLCstatus));
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   266
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   267
    write_list_trace_sample_1_t_struct(codec, &(data->traces));
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   268
}
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   269
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   270
// Write struct list_trace_sample_1_t function implementation
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   271
static void write_list_trace_sample_1_t_struct(erpc::Codec * codec, const list_trace_sample_1_t * data)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   272
{
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   273
    if(NULL == data)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   274
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   275
        return;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   276
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   277
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   278
    codec->startWriteList(data->elementsCount);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   279
    for (uint32_t listCount = 0U; listCount < data->elementsCount; ++listCount)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   280
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   281
        write_trace_sample_struct(codec, &(data->elements[listCount]));
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   282
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   283
}
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   284
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   285
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   286
//! @brief Function to free space allocated inside struct binary_t
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   287
static void free_binary_t_struct(binary_t * data);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   288
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   289
//! @brief Function to free space allocated inside struct log_message
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   290
static void free_log_message_struct(log_message * data);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   291
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   292
//! @brief Function to free space allocated inside struct PSKID
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   293
static void free_PSKID_struct(PSKID * data);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   294
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   295
//! @brief Function to free space allocated inside struct trace_sample
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   296
static void free_trace_sample_struct(trace_sample * data);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   297
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   298
//! @brief Function to free space allocated inside struct TraceVariables
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   299
static void free_TraceVariables_struct(TraceVariables * data);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   300
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   301
//! @brief Function to free space allocated inside struct list_trace_sample_1_t
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   302
static void free_list_trace_sample_1_t_struct(list_trace_sample_1_t * data);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   303
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   304
//! @brief Function to free space allocated inside struct extra_file
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   305
static void free_extra_file_struct(extra_file * data);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   306
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   307
//! @brief Function to free space allocated inside struct list_extra_file_1_t
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   308
static void free_list_extra_file_1_t_struct(list_extra_file_1_t * data);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   309
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   310
//! @brief Function to free space allocated inside struct trace_order
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   311
static void free_trace_order_struct(trace_order * data);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   312
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   313
//! @brief Function to free space allocated inside struct list_trace_order_1_t
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   314
static void free_list_trace_order_1_t_struct(list_trace_order_1_t * data);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   315
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   316
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   317
// Free space allocated inside struct binary_t function implementation
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   318
static void free_binary_t_struct(binary_t * data)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   319
{
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   320
    erpc_free(data->data);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   321
}
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   322
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   323
// Free space allocated inside struct log_message function implementation
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   324
static void free_log_message_struct(log_message * data)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   325
{
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   326
    erpc_free(data->msg);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   327
}
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   328
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   329
// Free space allocated inside struct PSKID function implementation
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   330
static void free_PSKID_struct(PSKID * data)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   331
{
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   332
    erpc_free(data->ID);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   333
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   334
    erpc_free(data->PSK);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   335
}
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   336
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   337
// Free space allocated inside struct trace_sample function implementation
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   338
static void free_trace_sample_struct(trace_sample * data)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   339
{
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   340
    free_binary_t_struct(&data->TraceBuffer);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   341
}
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   342
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   343
// Free space allocated inside struct TraceVariables function implementation
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   344
static void free_TraceVariables_struct(TraceVariables * data)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   345
{
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   346
    free_list_trace_sample_1_t_struct(&data->traces);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   347
}
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   348
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   349
// Free space allocated inside struct list_trace_sample_1_t function implementation
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   350
static void free_list_trace_sample_1_t_struct(list_trace_sample_1_t * data)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   351
{
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   352
    for (uint32_t listCount = 0; listCount < data->elementsCount; ++listCount)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   353
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   354
        free_trace_sample_struct(&data->elements[listCount]);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   355
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   356
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   357
    erpc_free(data->elements);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   358
}
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   359
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   360
// Free space allocated inside struct extra_file function implementation
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   361
static void free_extra_file_struct(extra_file * data)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   362
{
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   363
    erpc_free(data->fname);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   364
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   365
    free_binary_t_struct(&data->blobID);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   366
}
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   367
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   368
// Free space allocated inside struct list_extra_file_1_t function implementation
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   369
static void free_list_extra_file_1_t_struct(list_extra_file_1_t * data)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   370
{
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   371
    for (uint32_t listCount = 0; listCount < data->elementsCount; ++listCount)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   372
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   373
        free_extra_file_struct(&data->elements[listCount]);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   374
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   375
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   376
    erpc_free(data->elements);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   377
}
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   378
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   379
// Free space allocated inside struct trace_order function implementation
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   380
static void free_trace_order_struct(trace_order * data)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   381
{
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   382
    free_binary_t_struct(&data->force);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   383
}
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   384
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   385
// Free space allocated inside struct list_trace_order_1_t function implementation
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   386
static void free_list_trace_order_1_t_struct(list_trace_order_1_t * data)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   387
{
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   388
    for (uint32_t listCount = 0; listCount < data->elementsCount; ++listCount)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   389
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   390
        free_trace_order_struct(&data->elements[listCount]);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   391
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   392
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   393
    erpc_free(data->elements);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   394
}
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   395
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   396
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   397
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   398
BeremizPLCObjectService_service::BeremizPLCObjectService_service(BeremizPLCObjectService_interface *_BeremizPLCObjectService_interface)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   399
    : erpc::Service(BeremizPLCObjectService_interface::m_serviceId)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   400
    , m_handler(_BeremizPLCObjectService_interface)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   401
{
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   402
}
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   403
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   404
BeremizPLCObjectService_service::~BeremizPLCObjectService_service()
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   405
{
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   406
}
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   407
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   408
// return service interface handler.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   409
BeremizPLCObjectService_interface* BeremizPLCObjectService_service::getHandler(void)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   410
{
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   411
    return m_handler;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   412
}
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   413
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   414
// Call the correct server shim based on method unique ID.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   415
erpc_status_t BeremizPLCObjectService_service::handleInvocation(uint32_t methodId, uint32_t sequence, Codec * codec, MessageBufferFactory *messageFactory, Transport * transport)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   416
{
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   417
    erpc_status_t erpcStatus;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   418
    switch (methodId)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   419
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   420
        case BeremizPLCObjectService_interface::m_AppendChunkToBlobId:
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   421
        {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   422
            erpcStatus = AppendChunkToBlob_shim(codec, messageFactory, transport, sequence);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   423
            break;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   424
        }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   425
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   426
        case BeremizPLCObjectService_interface::m_GetLogMessageId:
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   427
        {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   428
            erpcStatus = GetLogMessage_shim(codec, messageFactory, transport, sequence);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   429
            break;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   430
        }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   431
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   432
        case BeremizPLCObjectService_interface::m_GetPLCIDId:
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   433
        {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   434
            erpcStatus = GetPLCID_shim(codec, messageFactory, transport, sequence);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   435
            break;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   436
        }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   437
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   438
        case BeremizPLCObjectService_interface::m_GetPLCstatusId:
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   439
        {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   440
            erpcStatus = GetPLCstatus_shim(codec, messageFactory, transport, sequence);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   441
            break;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   442
        }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   443
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   444
        case BeremizPLCObjectService_interface::m_GetTraceVariablesId:
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   445
        {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   446
            erpcStatus = GetTraceVariables_shim(codec, messageFactory, transport, sequence);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   447
            break;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   448
        }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   449
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   450
        case BeremizPLCObjectService_interface::m_MatchMD5Id:
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   451
        {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   452
            erpcStatus = MatchMD5_shim(codec, messageFactory, transport, sequence);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   453
            break;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   454
        }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   455
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   456
        case BeremizPLCObjectService_interface::m_NewPLCId:
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   457
        {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   458
            erpcStatus = NewPLC_shim(codec, messageFactory, transport, sequence);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   459
            break;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   460
        }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   461
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   462
        case BeremizPLCObjectService_interface::m_PurgeBlobsId:
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   463
        {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   464
            erpcStatus = PurgeBlobs_shim(codec, messageFactory, transport, sequence);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   465
            break;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   466
        }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   467
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   468
        case BeremizPLCObjectService_interface::m_RepairPLCId:
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   469
        {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   470
            erpcStatus = RepairPLC_shim(codec, messageFactory, transport, sequence);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   471
            break;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   472
        }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   473
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   474
        case BeremizPLCObjectService_interface::m_ResetLogCountId:
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   475
        {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   476
            erpcStatus = ResetLogCount_shim(codec, messageFactory, transport, sequence);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   477
            break;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   478
        }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   479
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   480
        case BeremizPLCObjectService_interface::m_SeedBlobId:
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   481
        {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   482
            erpcStatus = SeedBlob_shim(codec, messageFactory, transport, sequence);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   483
            break;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   484
        }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   485
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   486
        case BeremizPLCObjectService_interface::m_SetTraceVariablesListId:
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   487
        {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   488
            erpcStatus = SetTraceVariablesList_shim(codec, messageFactory, transport, sequence);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   489
            break;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   490
        }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   491
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   492
        case BeremizPLCObjectService_interface::m_StartPLCId:
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   493
        {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   494
            erpcStatus = StartPLC_shim(codec, messageFactory, transport, sequence);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   495
            break;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   496
        }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   497
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   498
        case BeremizPLCObjectService_interface::m_StopPLCId:
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   499
        {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   500
            erpcStatus = StopPLC_shim(codec, messageFactory, transport, sequence);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   501
            break;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   502
        }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   503
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   504
        case BeremizPLCObjectService_interface::m_ExtendedCallId:
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   505
        {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   506
            erpcStatus = ExtendedCall_shim(codec, messageFactory, transport, sequence);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   507
            break;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   508
        }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   509
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   510
        default:
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   511
        {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   512
            erpcStatus = kErpcStatus_InvalidArgument;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   513
            break;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   514
        }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   515
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   516
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   517
    return erpcStatus;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   518
}
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   519
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   520
// Server shim for AppendChunkToBlob of BeremizPLCObjectService interface.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   521
erpc_status_t BeremizPLCObjectService_service::AppendChunkToBlob_shim(Codec * codec, MessageBufferFactory *messageFactory, Transport * transport, uint32_t sequence)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   522
{
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   523
    erpc_status_t err = kErpcStatus_Success;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   524
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   525
    binary_t *data = NULL;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   526
    data = (binary_t *) erpc_malloc(sizeof(binary_t));
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   527
    if (data == NULL)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   528
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   529
        codec->updateStatus(kErpcStatus_MemoryError);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   530
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   531
    binary_t *blobID = NULL;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   532
    blobID = (binary_t *) erpc_malloc(sizeof(binary_t));
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   533
    if (blobID == NULL)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   534
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   535
        codec->updateStatus(kErpcStatus_MemoryError);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   536
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   537
    binary_t *newBlobID = NULL;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   538
    uint32_t result;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   539
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   540
    // startReadMessage() was already called before this shim was invoked.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   541
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   542
    read_binary_t_struct(codec, data);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   543
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   544
    read_binary_t_struct(codec, blobID);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   545
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   546
    newBlobID = (binary_t *) erpc_malloc(sizeof(binary_t));
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   547
    if (newBlobID == NULL)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   548
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   549
        codec->updateStatus(kErpcStatus_MemoryError);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   550
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   551
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   552
    err = codec->getStatus();
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   553
    if (err == kErpcStatus_Success)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   554
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   555
        // Invoke the actual served function.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   556
#if ERPC_NESTED_CALLS_DETECTION
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   557
        nestingDetection = true;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   558
#endif
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   559
        result = m_handler->AppendChunkToBlob(data, blobID, newBlobID);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   560
#if ERPC_NESTED_CALLS_DETECTION
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   561
        nestingDetection = false;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   562
#endif
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   563
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   564
        // preparing MessageBuffer for serializing data
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   565
        err = messageFactory->prepareServerBufferForSend(codec->getBufferRef(), transport->reserveHeaderSize());
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   566
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   567
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   568
    if (err == kErpcStatus_Success)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   569
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   570
        // preparing codec for serializing data
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   571
        codec->reset(transport->reserveHeaderSize());
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   572
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   573
        // Build response message.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   574
        codec->startWriteMessage(message_type_t::kReplyMessage, BeremizPLCObjectService_interface::m_serviceId, BeremizPLCObjectService_interface::m_AppendChunkToBlobId, sequence);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   575
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   576
        write_binary_t_struct(codec, newBlobID);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   577
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   578
        codec->write(result);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   579
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   580
        err = codec->getStatus();
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   581
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   582
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   583
    if (data)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   584
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   585
        free_binary_t_struct(data);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   586
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   587
    erpc_free(data);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   588
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   589
    if (blobID)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   590
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   591
        free_binary_t_struct(blobID);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   592
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   593
    erpc_free(blobID);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   594
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   595
    if (newBlobID)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   596
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   597
        free_binary_t_struct(newBlobID);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   598
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   599
    erpc_free(newBlobID);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   600
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   601
    return err;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   602
}
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   603
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   604
// Server shim for GetLogMessage of BeremizPLCObjectService interface.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   605
erpc_status_t BeremizPLCObjectService_service::GetLogMessage_shim(Codec * codec, MessageBufferFactory *messageFactory, Transport * transport, uint32_t sequence)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   606
{
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   607
    erpc_status_t err = kErpcStatus_Success;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   608
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   609
    uint8_t level;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   610
    uint32_t msgID;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   611
    log_message *message = NULL;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   612
    uint32_t result;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   613
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   614
    // startReadMessage() was already called before this shim was invoked.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   615
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   616
    codec->read(level);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   617
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   618
    codec->read(msgID);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   619
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   620
    message = (log_message *) erpc_malloc(sizeof(log_message));
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   621
    if (message == NULL)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   622
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   623
        codec->updateStatus(kErpcStatus_MemoryError);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   624
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   625
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   626
    err = codec->getStatus();
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   627
    if (err == kErpcStatus_Success)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   628
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   629
        // Invoke the actual served function.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   630
#if ERPC_NESTED_CALLS_DETECTION
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   631
        nestingDetection = true;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   632
#endif
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   633
        result = m_handler->GetLogMessage(level, msgID, message);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   634
#if ERPC_NESTED_CALLS_DETECTION
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   635
        nestingDetection = false;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   636
#endif
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   637
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   638
        // preparing MessageBuffer for serializing data
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   639
        err = messageFactory->prepareServerBufferForSend(codec->getBufferRef(), transport->reserveHeaderSize());
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   640
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   641
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   642
    if (err == kErpcStatus_Success)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   643
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   644
        // preparing codec for serializing data
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   645
        codec->reset(transport->reserveHeaderSize());
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   646
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   647
        // Build response message.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   648
        codec->startWriteMessage(message_type_t::kReplyMessage, BeremizPLCObjectService_interface::m_serviceId, BeremizPLCObjectService_interface::m_GetLogMessageId, sequence);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   649
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   650
        write_log_message_struct(codec, message);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   651
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   652
        codec->write(result);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   653
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   654
        err = codec->getStatus();
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   655
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   656
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   657
    if (message)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   658
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   659
        free_log_message_struct(message);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   660
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   661
    erpc_free(message);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   662
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   663
    return err;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   664
}
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   665
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   666
// Server shim for GetPLCID of BeremizPLCObjectService interface.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   667
erpc_status_t BeremizPLCObjectService_service::GetPLCID_shim(Codec * codec, MessageBufferFactory *messageFactory, Transport * transport, uint32_t sequence)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   668
{
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   669
    erpc_status_t err = kErpcStatus_Success;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   670
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   671
    PSKID *plcID = NULL;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   672
    uint32_t result;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   673
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   674
    // startReadMessage() was already called before this shim was invoked.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   675
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   676
    plcID = (PSKID *) erpc_malloc(sizeof(PSKID));
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   677
    if (plcID == NULL)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   678
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   679
        codec->updateStatus(kErpcStatus_MemoryError);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   680
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   681
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   682
    err = codec->getStatus();
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   683
    if (err == kErpcStatus_Success)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   684
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   685
        // Invoke the actual served function.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   686
#if ERPC_NESTED_CALLS_DETECTION
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   687
        nestingDetection = true;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   688
#endif
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   689
        result = m_handler->GetPLCID(plcID);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   690
#if ERPC_NESTED_CALLS_DETECTION
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   691
        nestingDetection = false;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   692
#endif
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   693
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   694
        // preparing MessageBuffer for serializing data
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   695
        err = messageFactory->prepareServerBufferForSend(codec->getBufferRef(), transport->reserveHeaderSize());
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   696
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   697
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   698
    if (err == kErpcStatus_Success)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   699
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   700
        // preparing codec for serializing data
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   701
        codec->reset(transport->reserveHeaderSize());
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   702
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   703
        // Build response message.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   704
        codec->startWriteMessage(message_type_t::kReplyMessage, BeremizPLCObjectService_interface::m_serviceId, BeremizPLCObjectService_interface::m_GetPLCIDId, sequence);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   705
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   706
        write_PSKID_struct(codec, plcID);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   707
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   708
        codec->write(result);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   709
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   710
        err = codec->getStatus();
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   711
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   712
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   713
    if (plcID)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   714
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   715
        free_PSKID_struct(plcID);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   716
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   717
    erpc_free(plcID);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   718
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   719
    return err;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   720
}
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   721
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   722
// Server shim for GetPLCstatus of BeremizPLCObjectService interface.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   723
erpc_status_t BeremizPLCObjectService_service::GetPLCstatus_shim(Codec * codec, MessageBufferFactory *messageFactory, Transport * transport, uint32_t sequence)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   724
{
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   725
    erpc_status_t err = kErpcStatus_Success;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   726
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   727
    PLCstatus *status = NULL;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   728
    uint32_t result;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   729
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   730
    // startReadMessage() was already called before this shim was invoked.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   731
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   732
    status = (PLCstatus *) erpc_malloc(sizeof(PLCstatus));
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   733
    if (status == NULL)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   734
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   735
        codec->updateStatus(kErpcStatus_MemoryError);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   736
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   737
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   738
    err = codec->getStatus();
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   739
    if (err == kErpcStatus_Success)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   740
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   741
        // Invoke the actual served function.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   742
#if ERPC_NESTED_CALLS_DETECTION
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   743
        nestingDetection = true;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   744
#endif
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   745
        result = m_handler->GetPLCstatus(status);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   746
#if ERPC_NESTED_CALLS_DETECTION
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   747
        nestingDetection = false;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   748
#endif
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   749
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   750
        // preparing MessageBuffer for serializing data
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   751
        err = messageFactory->prepareServerBufferForSend(codec->getBufferRef(), transport->reserveHeaderSize());
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   752
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   753
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   754
    if (err == kErpcStatus_Success)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   755
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   756
        // preparing codec for serializing data
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   757
        codec->reset(transport->reserveHeaderSize());
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   758
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   759
        // Build response message.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   760
        codec->startWriteMessage(message_type_t::kReplyMessage, BeremizPLCObjectService_interface::m_serviceId, BeremizPLCObjectService_interface::m_GetPLCstatusId, sequence);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   761
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   762
        write_PLCstatus_struct(codec, status);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   763
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   764
        codec->write(result);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   765
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   766
        err = codec->getStatus();
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   767
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   768
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   769
    erpc_free(status);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   770
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   771
    return err;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   772
}
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   773
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   774
// Server shim for GetTraceVariables of BeremizPLCObjectService interface.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   775
erpc_status_t BeremizPLCObjectService_service::GetTraceVariables_shim(Codec * codec, MessageBufferFactory *messageFactory, Transport * transport, uint32_t sequence)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   776
{
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   777
    erpc_status_t err = kErpcStatus_Success;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   778
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   779
    uint32_t debugToken;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   780
    TraceVariables *traces = NULL;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   781
    uint32_t result;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   782
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   783
    // startReadMessage() was already called before this shim was invoked.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   784
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   785
    codec->read(debugToken);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   786
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   787
    traces = (TraceVariables *) erpc_malloc(sizeof(TraceVariables));
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   788
    if (traces == NULL)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   789
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   790
        codec->updateStatus(kErpcStatus_MemoryError);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   791
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   792
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   793
    err = codec->getStatus();
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   794
    if (err == kErpcStatus_Success)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   795
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   796
        // Invoke the actual served function.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   797
#if ERPC_NESTED_CALLS_DETECTION
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   798
        nestingDetection = true;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   799
#endif
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   800
        result = m_handler->GetTraceVariables(debugToken, traces);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   801
#if ERPC_NESTED_CALLS_DETECTION
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   802
        nestingDetection = false;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   803
#endif
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   804
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   805
        // preparing MessageBuffer for serializing data
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   806
        err = messageFactory->prepareServerBufferForSend(codec->getBufferRef(), transport->reserveHeaderSize());
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   807
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   808
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   809
    if (err == kErpcStatus_Success)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   810
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   811
        // preparing codec for serializing data
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   812
        codec->reset(transport->reserveHeaderSize());
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   813
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   814
        // Build response message.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   815
        codec->startWriteMessage(message_type_t::kReplyMessage, BeremizPLCObjectService_interface::m_serviceId, BeremizPLCObjectService_interface::m_GetTraceVariablesId, sequence);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   816
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   817
        write_TraceVariables_struct(codec, traces);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   818
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   819
        codec->write(result);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   820
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   821
        err = codec->getStatus();
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   822
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   823
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   824
    if (traces)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   825
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   826
        free_TraceVariables_struct(traces);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   827
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   828
    erpc_free(traces);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   829
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   830
    return err;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   831
}
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   832
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   833
// Server shim for MatchMD5 of BeremizPLCObjectService interface.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   834
erpc_status_t BeremizPLCObjectService_service::MatchMD5_shim(Codec * codec, MessageBufferFactory *messageFactory, Transport * transport, uint32_t sequence)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   835
{
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   836
    erpc_status_t err = kErpcStatus_Success;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   837
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   838
    char * MD5 = NULL;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   839
    bool match;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   840
    uint32_t result;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   841
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   842
    // startReadMessage() was already called before this shim was invoked.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   843
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   844
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   845
        uint32_t MD5_len;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   846
        char * MD5_local;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   847
        codec->readString(MD5_len, &MD5_local);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   848
        MD5 = (char*) erpc_malloc((MD5_len + 1) * sizeof(char));
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   849
        if ((MD5 == NULL) || (MD5_local == NULL))
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   850
        {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   851
            codec->updateStatus(kErpcStatus_MemoryError);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   852
        }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   853
        else
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   854
        {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   855
            memcpy(MD5, MD5_local, MD5_len);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   856
            (MD5)[MD5_len] = 0;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   857
        }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   858
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   859
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   860
    err = codec->getStatus();
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   861
    if (err == kErpcStatus_Success)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   862
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   863
        // Invoke the actual served function.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   864
#if ERPC_NESTED_CALLS_DETECTION
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   865
        nestingDetection = true;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   866
#endif
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   867
        result = m_handler->MatchMD5(MD5, &match);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   868
#if ERPC_NESTED_CALLS_DETECTION
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   869
        nestingDetection = false;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   870
#endif
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   871
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   872
        // preparing MessageBuffer for serializing data
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   873
        err = messageFactory->prepareServerBufferForSend(codec->getBufferRef(), transport->reserveHeaderSize());
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   874
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   875
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   876
    if (err == kErpcStatus_Success)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   877
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   878
        // preparing codec for serializing data
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   879
        codec->reset(transport->reserveHeaderSize());
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   880
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   881
        // Build response message.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   882
        codec->startWriteMessage(message_type_t::kReplyMessage, BeremizPLCObjectService_interface::m_serviceId, BeremizPLCObjectService_interface::m_MatchMD5Id, sequence);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   883
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   884
        codec->write(match);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   885
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   886
        codec->write(result);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   887
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   888
        err = codec->getStatus();
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   889
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   890
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   891
    erpc_free(MD5);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   892
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   893
    return err;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   894
}
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   895
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   896
// Server shim for NewPLC of BeremizPLCObjectService interface.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   897
erpc_status_t BeremizPLCObjectService_service::NewPLC_shim(Codec * codec, MessageBufferFactory *messageFactory, Transport * transport, uint32_t sequence)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   898
{
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   899
    erpc_status_t err = kErpcStatus_Success;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   900
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   901
    char * md5sum = NULL;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   902
    binary_t *plcObjectBlobID = NULL;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   903
    plcObjectBlobID = (binary_t *) erpc_malloc(sizeof(binary_t));
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   904
    if (plcObjectBlobID == NULL)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   905
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   906
        codec->updateStatus(kErpcStatus_MemoryError);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   907
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   908
    list_extra_file_1_t *extrafiles = NULL;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   909
    extrafiles = (list_extra_file_1_t *) erpc_malloc(sizeof(list_extra_file_1_t));
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   910
    if (extrafiles == NULL)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   911
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   912
        codec->updateStatus(kErpcStatus_MemoryError);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   913
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   914
    bool success;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   915
    uint32_t result;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   916
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   917
    // startReadMessage() was already called before this shim was invoked.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   918
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   919
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   920
        uint32_t md5sum_len;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   921
        char * md5sum_local;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   922
        codec->readString(md5sum_len, &md5sum_local);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   923
        md5sum = (char*) erpc_malloc((md5sum_len + 1) * sizeof(char));
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   924
        if ((md5sum == NULL) || (md5sum_local == NULL))
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   925
        {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   926
            codec->updateStatus(kErpcStatus_MemoryError);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   927
        }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   928
        else
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   929
        {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   930
            memcpy(md5sum, md5sum_local, md5sum_len);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   931
            (md5sum)[md5sum_len] = 0;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   932
        }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   933
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   934
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   935
    read_binary_t_struct(codec, plcObjectBlobID);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   936
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   937
    read_list_extra_file_1_t_struct(codec, extrafiles);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   938
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   939
    err = codec->getStatus();
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   940
    if (err == kErpcStatus_Success)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   941
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   942
        // Invoke the actual served function.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   943
#if ERPC_NESTED_CALLS_DETECTION
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   944
        nestingDetection = true;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   945
#endif
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   946
        result = m_handler->NewPLC(md5sum, plcObjectBlobID, extrafiles, &success);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   947
#if ERPC_NESTED_CALLS_DETECTION
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   948
        nestingDetection = false;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   949
#endif
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   950
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   951
        // preparing MessageBuffer for serializing data
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   952
        err = messageFactory->prepareServerBufferForSend(codec->getBufferRef(), transport->reserveHeaderSize());
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   953
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   954
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   955
    if (err == kErpcStatus_Success)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   956
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   957
        // preparing codec for serializing data
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   958
        codec->reset(transport->reserveHeaderSize());
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   959
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   960
        // Build response message.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   961
        codec->startWriteMessage(message_type_t::kReplyMessage, BeremizPLCObjectService_interface::m_serviceId, BeremizPLCObjectService_interface::m_NewPLCId, sequence);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   962
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   963
        codec->write(success);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   964
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   965
        codec->write(result);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   966
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   967
        err = codec->getStatus();
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   968
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   969
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   970
    erpc_free(md5sum);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   971
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   972
    if (plcObjectBlobID)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   973
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   974
        free_binary_t_struct(plcObjectBlobID);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   975
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   976
    erpc_free(plcObjectBlobID);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   977
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   978
    if (extrafiles)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   979
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   980
        free_list_extra_file_1_t_struct(extrafiles);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   981
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   982
    erpc_free(extrafiles);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   983
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   984
    return err;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   985
}
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   986
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   987
// Server shim for PurgeBlobs of BeremizPLCObjectService interface.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   988
erpc_status_t BeremizPLCObjectService_service::PurgeBlobs_shim(Codec * codec, MessageBufferFactory *messageFactory, Transport * transport, uint32_t sequence)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   989
{
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   990
    erpc_status_t err = kErpcStatus_Success;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   991
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   992
    uint32_t result;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   993
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   994
    // startReadMessage() was already called before this shim was invoked.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   995
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   996
    err = codec->getStatus();
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   997
    if (err == kErpcStatus_Success)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   998
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   999
        // Invoke the actual served function.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1000
#if ERPC_NESTED_CALLS_DETECTION
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1001
        nestingDetection = true;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1002
#endif
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1003
        result = m_handler->PurgeBlobs();
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1004
#if ERPC_NESTED_CALLS_DETECTION
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1005
        nestingDetection = false;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1006
#endif
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1007
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1008
        // preparing MessageBuffer for serializing data
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1009
        err = messageFactory->prepareServerBufferForSend(codec->getBufferRef(), transport->reserveHeaderSize());
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1010
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1011
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1012
    if (err == kErpcStatus_Success)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1013
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1014
        // preparing codec for serializing data
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1015
        codec->reset(transport->reserveHeaderSize());
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1016
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1017
        // Build response message.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1018
        codec->startWriteMessage(message_type_t::kReplyMessage, BeremizPLCObjectService_interface::m_serviceId, BeremizPLCObjectService_interface::m_PurgeBlobsId, sequence);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1019
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1020
        codec->write(result);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1021
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1022
        err = codec->getStatus();
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1023
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1024
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1025
    return err;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1026
}
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1027
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1028
// Server shim for RepairPLC of BeremizPLCObjectService interface.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1029
erpc_status_t BeremizPLCObjectService_service::RepairPLC_shim(Codec * codec, MessageBufferFactory *messageFactory, Transport * transport, uint32_t sequence)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1030
{
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1031
    erpc_status_t err = kErpcStatus_Success;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1032
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1033
    uint32_t result;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1034
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1035
    // startReadMessage() was already called before this shim was invoked.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1036
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1037
    err = codec->getStatus();
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1038
    if (err == kErpcStatus_Success)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1039
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1040
        // Invoke the actual served function.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1041
#if ERPC_NESTED_CALLS_DETECTION
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1042
        nestingDetection = true;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1043
#endif
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1044
        result = m_handler->RepairPLC();
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1045
#if ERPC_NESTED_CALLS_DETECTION
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1046
        nestingDetection = false;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1047
#endif
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1048
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1049
        // preparing MessageBuffer for serializing data
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1050
        err = messageFactory->prepareServerBufferForSend(codec->getBufferRef(), transport->reserveHeaderSize());
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1051
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1052
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1053
    if (err == kErpcStatus_Success)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1054
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1055
        // preparing codec for serializing data
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1056
        codec->reset(transport->reserveHeaderSize());
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1057
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1058
        // Build response message.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1059
        codec->startWriteMessage(message_type_t::kReplyMessage, BeremizPLCObjectService_interface::m_serviceId, BeremizPLCObjectService_interface::m_RepairPLCId, sequence);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1060
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1061
        codec->write(result);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1062
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1063
        err = codec->getStatus();
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1064
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1065
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1066
    return err;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1067
}
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1068
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1069
// Server shim for ResetLogCount of BeremizPLCObjectService interface.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1070
erpc_status_t BeremizPLCObjectService_service::ResetLogCount_shim(Codec * codec, MessageBufferFactory *messageFactory, Transport * transport, uint32_t sequence)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1071
{
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1072
    erpc_status_t err = kErpcStatus_Success;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1073
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1074
    uint32_t result;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1075
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1076
    // startReadMessage() was already called before this shim was invoked.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1077
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1078
    err = codec->getStatus();
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1079
    if (err == kErpcStatus_Success)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1080
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1081
        // Invoke the actual served function.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1082
#if ERPC_NESTED_CALLS_DETECTION
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1083
        nestingDetection = true;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1084
#endif
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1085
        result = m_handler->ResetLogCount();
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1086
#if ERPC_NESTED_CALLS_DETECTION
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1087
        nestingDetection = false;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1088
#endif
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1089
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1090
        // preparing MessageBuffer for serializing data
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1091
        err = messageFactory->prepareServerBufferForSend(codec->getBufferRef(), transport->reserveHeaderSize());
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1092
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1093
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1094
    if (err == kErpcStatus_Success)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1095
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1096
        // preparing codec for serializing data
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1097
        codec->reset(transport->reserveHeaderSize());
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1098
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1099
        // Build response message.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1100
        codec->startWriteMessage(message_type_t::kReplyMessage, BeremizPLCObjectService_interface::m_serviceId, BeremizPLCObjectService_interface::m_ResetLogCountId, sequence);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1101
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1102
        codec->write(result);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1103
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1104
        err = codec->getStatus();
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1105
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1106
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1107
    return err;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1108
}
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1109
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1110
// Server shim for SeedBlob of BeremizPLCObjectService interface.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1111
erpc_status_t BeremizPLCObjectService_service::SeedBlob_shim(Codec * codec, MessageBufferFactory *messageFactory, Transport * transport, uint32_t sequence)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1112
{
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1113
    erpc_status_t err = kErpcStatus_Success;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1114
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1115
    binary_t *seed = NULL;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1116
    seed = (binary_t *) erpc_malloc(sizeof(binary_t));
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1117
    if (seed == NULL)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1118
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1119
        codec->updateStatus(kErpcStatus_MemoryError);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1120
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1121
    binary_t *blobID = NULL;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1122
    uint32_t result;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1123
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1124
    // startReadMessage() was already called before this shim was invoked.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1125
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1126
    read_binary_t_struct(codec, seed);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1127
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1128
    blobID = (binary_t *) erpc_malloc(sizeof(binary_t));
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1129
    if (blobID == NULL)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1130
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1131
        codec->updateStatus(kErpcStatus_MemoryError);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1132
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1133
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1134
    err = codec->getStatus();
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1135
    if (err == kErpcStatus_Success)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1136
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1137
        // Invoke the actual served function.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1138
#if ERPC_NESTED_CALLS_DETECTION
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1139
        nestingDetection = true;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1140
#endif
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1141
        result = m_handler->SeedBlob(seed, blobID);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1142
#if ERPC_NESTED_CALLS_DETECTION
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1143
        nestingDetection = false;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1144
#endif
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1145
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1146
        // preparing MessageBuffer for serializing data
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1147
        err = messageFactory->prepareServerBufferForSend(codec->getBufferRef(), transport->reserveHeaderSize());
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1148
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1149
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1150
    if (err == kErpcStatus_Success)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1151
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1152
        // preparing codec for serializing data
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1153
        codec->reset(transport->reserveHeaderSize());
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1154
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1155
        // Build response message.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1156
        codec->startWriteMessage(message_type_t::kReplyMessage, BeremizPLCObjectService_interface::m_serviceId, BeremizPLCObjectService_interface::m_SeedBlobId, sequence);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1157
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1158
        write_binary_t_struct(codec, blobID);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1159
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1160
        codec->write(result);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1161
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1162
        err = codec->getStatus();
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1163
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1164
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1165
    if (seed)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1166
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1167
        free_binary_t_struct(seed);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1168
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1169
    erpc_free(seed);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1170
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1171
    if (blobID)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1172
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1173
        free_binary_t_struct(blobID);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1174
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1175
    erpc_free(blobID);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1176
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1177
    return err;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1178
}
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1179
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1180
// Server shim for SetTraceVariablesList of BeremizPLCObjectService interface.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1181
erpc_status_t BeremizPLCObjectService_service::SetTraceVariablesList_shim(Codec * codec, MessageBufferFactory *messageFactory, Transport * transport, uint32_t sequence)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1182
{
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1183
    erpc_status_t err = kErpcStatus_Success;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1184
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1185
    list_trace_order_1_t *orders = NULL;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1186
    orders = (list_trace_order_1_t *) erpc_malloc(sizeof(list_trace_order_1_t));
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1187
    if (orders == NULL)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1188
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1189
        codec->updateStatus(kErpcStatus_MemoryError);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1190
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1191
    int32_t debugtoken;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1192
    uint32_t result;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1193
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1194
    // startReadMessage() was already called before this shim was invoked.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1195
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1196
    read_list_trace_order_1_t_struct(codec, orders);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1197
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1198
    err = codec->getStatus();
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1199
    if (err == kErpcStatus_Success)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1200
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1201
        // Invoke the actual served function.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1202
#if ERPC_NESTED_CALLS_DETECTION
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1203
        nestingDetection = true;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1204
#endif
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1205
        result = m_handler->SetTraceVariablesList(orders, &debugtoken);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1206
#if ERPC_NESTED_CALLS_DETECTION
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1207
        nestingDetection = false;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1208
#endif
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1209
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1210
        // preparing MessageBuffer for serializing data
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1211
        err = messageFactory->prepareServerBufferForSend(codec->getBufferRef(), transport->reserveHeaderSize());
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1212
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1213
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1214
    if (err == kErpcStatus_Success)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1215
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1216
        // preparing codec for serializing data
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1217
        codec->reset(transport->reserveHeaderSize());
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1218
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1219
        // Build response message.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1220
        codec->startWriteMessage(message_type_t::kReplyMessage, BeremizPLCObjectService_interface::m_serviceId, BeremizPLCObjectService_interface::m_SetTraceVariablesListId, sequence);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1221
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1222
        codec->write(debugtoken);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1223
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1224
        codec->write(result);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1225
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1226
        err = codec->getStatus();
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1227
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1228
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1229
    if (orders)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1230
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1231
        free_list_trace_order_1_t_struct(orders);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1232
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1233
    erpc_free(orders);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1234
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1235
    return err;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1236
}
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1237
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1238
// Server shim for StartPLC of BeremizPLCObjectService interface.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1239
erpc_status_t BeremizPLCObjectService_service::StartPLC_shim(Codec * codec, MessageBufferFactory *messageFactory, Transport * transport, uint32_t sequence)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1240
{
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1241
    erpc_status_t err = kErpcStatus_Success;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1242
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1243
    uint32_t result;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1244
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1245
    // startReadMessage() was already called before this shim was invoked.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1246
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1247
    err = codec->getStatus();
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1248
    if (err == kErpcStatus_Success)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1249
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1250
        // Invoke the actual served function.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1251
#if ERPC_NESTED_CALLS_DETECTION
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1252
        nestingDetection = true;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1253
#endif
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1254
        result = m_handler->StartPLC();
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1255
#if ERPC_NESTED_CALLS_DETECTION
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1256
        nestingDetection = false;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1257
#endif
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1258
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1259
        // preparing MessageBuffer for serializing data
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1260
        err = messageFactory->prepareServerBufferForSend(codec->getBufferRef(), transport->reserveHeaderSize());
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1261
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1262
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1263
    if (err == kErpcStatus_Success)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1264
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1265
        // preparing codec for serializing data
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1266
        codec->reset(transport->reserveHeaderSize());
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1267
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1268
        // Build response message.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1269
        codec->startWriteMessage(message_type_t::kReplyMessage, BeremizPLCObjectService_interface::m_serviceId, BeremizPLCObjectService_interface::m_StartPLCId, sequence);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1270
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1271
        codec->write(result);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1272
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1273
        err = codec->getStatus();
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1274
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1275
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1276
    return err;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1277
}
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1278
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1279
// Server shim for StopPLC of BeremizPLCObjectService interface.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1280
erpc_status_t BeremizPLCObjectService_service::StopPLC_shim(Codec * codec, MessageBufferFactory *messageFactory, Transport * transport, uint32_t sequence)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1281
{
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1282
    erpc_status_t err = kErpcStatus_Success;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1283
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1284
    bool success;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1285
    uint32_t result;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1286
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1287
    // startReadMessage() was already called before this shim was invoked.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1288
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1289
    err = codec->getStatus();
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1290
    if (err == kErpcStatus_Success)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1291
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1292
        // Invoke the actual served function.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1293
#if ERPC_NESTED_CALLS_DETECTION
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1294
        nestingDetection = true;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1295
#endif
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1296
        result = m_handler->StopPLC(&success);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1297
#if ERPC_NESTED_CALLS_DETECTION
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1298
        nestingDetection = false;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1299
#endif
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1300
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1301
        // preparing MessageBuffer for serializing data
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1302
        err = messageFactory->prepareServerBufferForSend(codec->getBufferRef(), transport->reserveHeaderSize());
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1303
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1304
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1305
    if (err == kErpcStatus_Success)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1306
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1307
        // preparing codec for serializing data
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1308
        codec->reset(transport->reserveHeaderSize());
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1309
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1310
        // Build response message.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1311
        codec->startWriteMessage(message_type_t::kReplyMessage, BeremizPLCObjectService_interface::m_serviceId, BeremizPLCObjectService_interface::m_StopPLCId, sequence);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1312
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1313
        codec->write(success);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1314
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1315
        codec->write(result);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1316
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1317
        err = codec->getStatus();
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1318
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1319
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1320
    return err;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1321
}
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1322
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1323
// Server shim for ExtendedCall of BeremizPLCObjectService interface.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1324
erpc_status_t BeremizPLCObjectService_service::ExtendedCall_shim(Codec * codec, MessageBufferFactory *messageFactory, Transport * transport, uint32_t sequence)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1325
{
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1326
    erpc_status_t err = kErpcStatus_Success;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1327
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1328
    char * method = NULL;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1329
    binary_t *argument = NULL;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1330
    argument = (binary_t *) erpc_malloc(sizeof(binary_t));
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1331
    if (argument == NULL)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1332
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1333
        codec->updateStatus(kErpcStatus_MemoryError);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1334
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1335
    binary_t *answer = NULL;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1336
    uint32_t result;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1337
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1338
    // startReadMessage() was already called before this shim was invoked.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1339
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1340
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1341
        uint32_t method_len;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1342
        char * method_local;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1343
        codec->readString(method_len, &method_local);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1344
        method = (char*) erpc_malloc((method_len + 1) * sizeof(char));
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1345
        if ((method == NULL) || (method_local == NULL))
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1346
        {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1347
            codec->updateStatus(kErpcStatus_MemoryError);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1348
        }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1349
        else
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1350
        {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1351
            memcpy(method, method_local, method_len);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1352
            (method)[method_len] = 0;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1353
        }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1354
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1355
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1356
    read_binary_t_struct(codec, argument);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1357
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1358
    answer = (binary_t *) erpc_malloc(sizeof(binary_t));
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1359
    if (answer == NULL)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1360
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1361
        codec->updateStatus(kErpcStatus_MemoryError);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1362
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1363
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1364
    err = codec->getStatus();
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1365
    if (err == kErpcStatus_Success)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1366
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1367
        // Invoke the actual served function.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1368
#if ERPC_NESTED_CALLS_DETECTION
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1369
        nestingDetection = true;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1370
#endif
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1371
        result = m_handler->ExtendedCall(method, argument, answer);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1372
#if ERPC_NESTED_CALLS_DETECTION
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1373
        nestingDetection = false;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1374
#endif
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1375
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1376
        // preparing MessageBuffer for serializing data
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1377
        err = messageFactory->prepareServerBufferForSend(codec->getBufferRef(), transport->reserveHeaderSize());
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1378
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1379
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1380
    if (err == kErpcStatus_Success)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1381
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1382
        // preparing codec for serializing data
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1383
        codec->reset(transport->reserveHeaderSize());
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1384
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1385
        // Build response message.
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1386
        codec->startWriteMessage(message_type_t::kReplyMessage, BeremizPLCObjectService_interface::m_serviceId, BeremizPLCObjectService_interface::m_ExtendedCallId, sequence);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1387
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1388
        write_binary_t_struct(codec, answer);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1389
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1390
        codec->write(result);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1391
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1392
        err = codec->getStatus();
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1393
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1394
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1395
    erpc_free(method);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1396
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1397
    if (argument)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1398
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1399
        free_binary_t_struct(argument);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1400
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1401
    erpc_free(argument);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1402
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1403
    if (answer)
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1404
    {
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1405
        free_binary_t_struct(answer);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1406
    }
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1407
    erpc_free(answer);
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1408
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1409
    return err;
5472b88bbc9d C runtime: move generated erpc interface in separate "service" directory
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
  1410
}