C_runtime/erpc_PLCObject_client.cpp
changeset 3937 e13543d716b6
equal deleted inserted replaced
3936:129202e555e0 3937:e13543d716b6
       
     1 /*
       
     2  * Generated by erpcgen 1.11.0 on Wed Mar 27 13:43:44 2024.
       
     3  *
       
     4  * AUTOGENERATED - DO NOT EDIT
       
     5  */
       
     6 
       
     7 
       
     8 #if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
       
     9 #include "erpc_port.h"
       
    10 #endif
       
    11 #include "erpc_codec.hpp"
       
    12 #include "erpc_PLCObject_client.hpp"
       
    13 #include "erpc_manually_constructed.hpp"
       
    14 
       
    15 #if 11100 != ERPC_VERSION_NUMBER
       
    16 #error "The generated shim code version is different to the rest of eRPC code."
       
    17 #endif
       
    18 
       
    19 using namespace erpc;
       
    20 using namespace std;
       
    21 using namespace erpcShim;
       
    22 
       
    23 //! @brief Function to write struct binary_t
       
    24 static void write_binary_t_struct(erpc::Codec * codec, const binary_t * data);
       
    25 
       
    26 //! @brief Function to write struct extra_file
       
    27 static void write_extra_file_struct(erpc::Codec * codec, const extra_file * data);
       
    28 
       
    29 //! @brief Function to write struct list_extra_file_1_t
       
    30 static void write_list_extra_file_1_t_struct(erpc::Codec * codec, const list_extra_file_1_t * data);
       
    31 
       
    32 //! @brief Function to write struct trace_order
       
    33 static void write_trace_order_struct(erpc::Codec * codec, const trace_order * data);
       
    34 
       
    35 //! @brief Function to write struct list_trace_order_1_t
       
    36 static void write_list_trace_order_1_t_struct(erpc::Codec * codec, const list_trace_order_1_t * data);
       
    37 
       
    38 
       
    39 // Write struct binary_t function implementation
       
    40 static void write_binary_t_struct(erpc::Codec * codec, const binary_t * data)
       
    41 {
       
    42     if(NULL == data)
       
    43     {
       
    44         return;
       
    45     }
       
    46 
       
    47     codec->writeBinary(data->dataLength, data->data);
       
    48 }
       
    49 
       
    50 // Write struct extra_file function implementation
       
    51 static void write_extra_file_struct(erpc::Codec * codec, const extra_file * data)
       
    52 {
       
    53     if(NULL == data)
       
    54     {
       
    55         return;
       
    56     }
       
    57 
       
    58     {
       
    59         uint32_t fname_len = strlen((const char*)data->fname);
       
    60 
       
    61         codec->writeString(fname_len, (const char*)data->fname);
       
    62     }
       
    63 
       
    64     write_binary_t_struct(codec, &(data->blobID));
       
    65 }
       
    66 
       
    67 // Write struct list_extra_file_1_t function implementation
       
    68 static void write_list_extra_file_1_t_struct(erpc::Codec * codec, const list_extra_file_1_t * data)
       
    69 {
       
    70     if(NULL == data)
       
    71     {
       
    72         return;
       
    73     }
       
    74 
       
    75     codec->startWriteList(data->elementsCount);
       
    76     for (uint32_t listCount = 0U; listCount < data->elementsCount; ++listCount)
       
    77     {
       
    78         write_extra_file_struct(codec, &(data->elements[listCount]));
       
    79     }
       
    80 }
       
    81 
       
    82 // Write struct trace_order function implementation
       
    83 static void write_trace_order_struct(erpc::Codec * codec, const trace_order * data)
       
    84 {
       
    85     if(NULL == data)
       
    86     {
       
    87         return;
       
    88     }
       
    89 
       
    90     codec->write(data->idx);
       
    91 
       
    92     write_binary_t_struct(codec, &(data->force));
       
    93 }
       
    94 
       
    95 // Write struct list_trace_order_1_t function implementation
       
    96 static void write_list_trace_order_1_t_struct(erpc::Codec * codec, const list_trace_order_1_t * data)
       
    97 {
       
    98     if(NULL == data)
       
    99     {
       
   100         return;
       
   101     }
       
   102 
       
   103     codec->startWriteList(data->elementsCount);
       
   104     for (uint32_t listCount = 0U; listCount < data->elementsCount; ++listCount)
       
   105     {
       
   106         write_trace_order_struct(codec, &(data->elements[listCount]));
       
   107     }
       
   108 }
       
   109 
       
   110 
       
   111 //! @brief Function to read struct binary_t
       
   112 static void read_binary_t_struct(erpc::Codec * codec, binary_t * data);
       
   113 
       
   114 //! @brief Function to read struct log_message
       
   115 static void read_log_message_struct(erpc::Codec * codec, log_message * data);
       
   116 
       
   117 //! @brief Function to read struct PSKID
       
   118 static void read_PSKID_struct(erpc::Codec * codec, PSKID * data);
       
   119 
       
   120 //! @brief Function to read struct PLCstatus
       
   121 static void read_PLCstatus_struct(erpc::Codec * codec, PLCstatus * data);
       
   122 
       
   123 //! @brief Function to read struct trace_sample
       
   124 static void read_trace_sample_struct(erpc::Codec * codec, trace_sample * data);
       
   125 
       
   126 //! @brief Function to read struct TraceVariables
       
   127 static void read_TraceVariables_struct(erpc::Codec * codec, TraceVariables * data);
       
   128 
       
   129 //! @brief Function to read struct list_trace_sample_1_t
       
   130 static void read_list_trace_sample_1_t_struct(erpc::Codec * codec, list_trace_sample_1_t * data);
       
   131 
       
   132 
       
   133 // Read struct binary_t function implementation
       
   134 static void read_binary_t_struct(erpc::Codec * codec, binary_t * data)
       
   135 {
       
   136     if(NULL == data)
       
   137     {
       
   138         return;
       
   139     }
       
   140 
       
   141     uint8_t * data_local;
       
   142     codec->readBinary(data->dataLength, &data_local);
       
   143     if (data->dataLength > 0)
       
   144     {
       
   145     data->data = (uint8_t *) erpc_malloc(data->dataLength * sizeof(uint8_t));
       
   146         if (data->data == NULL)
       
   147         {
       
   148             codec->updateStatus(kErpcStatus_MemoryError);
       
   149         }
       
   150         else
       
   151         {
       
   152             memcpy(data->data, data_local, data->dataLength);
       
   153         }
       
   154     }
       
   155     else
       
   156     {
       
   157         data->data = NULL;
       
   158     }
       
   159 }
       
   160 
       
   161 // Read struct log_message function implementation
       
   162 static void read_log_message_struct(erpc::Codec * codec, log_message * data)
       
   163 {
       
   164     if(NULL == data)
       
   165     {
       
   166         return;
       
   167     }
       
   168 
       
   169     {
       
   170         uint32_t msg_len;
       
   171         char * msg_local;
       
   172         codec->readString(msg_len, &msg_local);
       
   173         data->msg = (char*) erpc_malloc((msg_len + 1) * sizeof(char));
       
   174         if ((data->msg == NULL) || (msg_local == NULL))
       
   175         {
       
   176             codec->updateStatus(kErpcStatus_MemoryError);
       
   177         }
       
   178         else
       
   179         {
       
   180             memcpy(data->msg, msg_local, msg_len);
       
   181             (data->msg)[msg_len] = 0;
       
   182         }
       
   183     }
       
   184 
       
   185     codec->read(data->tick);
       
   186 
       
   187     codec->read(data->sec);
       
   188 
       
   189     codec->read(data->nsec);
       
   190 }
       
   191 
       
   192 // Read struct PSKID function implementation
       
   193 static void read_PSKID_struct(erpc::Codec * codec, PSKID * data)
       
   194 {
       
   195     if(NULL == data)
       
   196     {
       
   197         return;
       
   198     }
       
   199 
       
   200     {
       
   201         uint32_t ID_len;
       
   202         char * ID_local;
       
   203         codec->readString(ID_len, &ID_local);
       
   204         data->ID = (char*) erpc_malloc((ID_len + 1) * sizeof(char));
       
   205         if ((data->ID == NULL) || (ID_local == NULL))
       
   206         {
       
   207             codec->updateStatus(kErpcStatus_MemoryError);
       
   208         }
       
   209         else
       
   210         {
       
   211             memcpy(data->ID, ID_local, ID_len);
       
   212             (data->ID)[ID_len] = 0;
       
   213         }
       
   214     }
       
   215 
       
   216     {
       
   217         uint32_t PSK_len;
       
   218         char * PSK_local;
       
   219         codec->readString(PSK_len, &PSK_local);
       
   220         data->PSK = (char*) erpc_malloc((PSK_len + 1) * sizeof(char));
       
   221         if ((data->PSK == NULL) || (PSK_local == NULL))
       
   222         {
       
   223             codec->updateStatus(kErpcStatus_MemoryError);
       
   224         }
       
   225         else
       
   226         {
       
   227             memcpy(data->PSK, PSK_local, PSK_len);
       
   228             (data->PSK)[PSK_len] = 0;
       
   229         }
       
   230     }
       
   231 }
       
   232 
       
   233 // Read struct PLCstatus function implementation
       
   234 static void read_PLCstatus_struct(erpc::Codec * codec, PLCstatus * data)
       
   235 {
       
   236     int32_t _tmp_local_i32;
       
   237 
       
   238     if(NULL == data)
       
   239     {
       
   240         return;
       
   241     }
       
   242 
       
   243     codec->read(_tmp_local_i32);
       
   244     data->PLCstatus = static_cast<PLCstatus_enum>(_tmp_local_i32);
       
   245 
       
   246     for (uint32_t arrayCount0 = 0U; arrayCount0 < 4U; ++arrayCount0)
       
   247     {
       
   248         codec->read(data->logcounts[arrayCount0]);
       
   249     }
       
   250 }
       
   251 
       
   252 // Read struct trace_sample function implementation
       
   253 static void read_trace_sample_struct(erpc::Codec * codec, trace_sample * data)
       
   254 {
       
   255     if(NULL == data)
       
   256     {
       
   257         return;
       
   258     }
       
   259 
       
   260     codec->read(data->tick);
       
   261 
       
   262     read_binary_t_struct(codec, &(data->TraceBuffer));
       
   263 }
       
   264 
       
   265 // Read struct TraceVariables function implementation
       
   266 static void read_TraceVariables_struct(erpc::Codec * codec, TraceVariables * data)
       
   267 {
       
   268     int32_t _tmp_local_i32;
       
   269 
       
   270     if(NULL == data)
       
   271     {
       
   272         return;
       
   273     }
       
   274 
       
   275     codec->read(_tmp_local_i32);
       
   276     data->PLCstatus = static_cast<PLCstatus_enum>(_tmp_local_i32);
       
   277 
       
   278     read_list_trace_sample_1_t_struct(codec, &(data->traces));
       
   279 }
       
   280 
       
   281 // Read struct list_trace_sample_1_t function implementation
       
   282 static void read_list_trace_sample_1_t_struct(erpc::Codec * codec, list_trace_sample_1_t * data)
       
   283 {
       
   284     if(NULL == data)
       
   285     {
       
   286         return;
       
   287     }
       
   288 
       
   289     codec->startReadList(data->elementsCount);
       
   290     data->elements = (trace_sample *) erpc_malloc(data->elementsCount * sizeof(trace_sample));
       
   291     if ((data->elements == NULL) && (data->elementsCount > 0))
       
   292     {
       
   293         codec->updateStatus(kErpcStatus_MemoryError);
       
   294     }
       
   295     for (uint32_t listCount = 0U; listCount < data->elementsCount; ++listCount)
       
   296     {
       
   297         read_trace_sample_struct(codec, &(data->elements[listCount]));
       
   298     }
       
   299 }
       
   300 
       
   301 
       
   302 
       
   303 
       
   304 BeremizPLCObjectService_client::BeremizPLCObjectService_client(ClientManager *manager)
       
   305 :m_clientManager(manager)
       
   306 {
       
   307 }
       
   308 
       
   309 BeremizPLCObjectService_client::~BeremizPLCObjectService_client()
       
   310 {
       
   311 }
       
   312 
       
   313 // BeremizPLCObjectService interface AppendChunkToBlob function client shim.
       
   314 uint32_t BeremizPLCObjectService_client::AppendChunkToBlob(const binary_t * data, const binary_t * blobID, binary_t * newBlobID)
       
   315 {
       
   316     erpc_status_t err = kErpcStatus_Success;
       
   317 
       
   318     uint32_t result;
       
   319 
       
   320 #if ERPC_PRE_POST_ACTION
       
   321     pre_post_action_cb preCB = m_clientManager->getPreCB();
       
   322     if (preCB)
       
   323     {
       
   324         preCB();
       
   325     }
       
   326 #endif
       
   327 
       
   328     // Get a new request.
       
   329     RequestContext request = m_clientManager->createRequest(false);
       
   330 
       
   331     // Encode the request.
       
   332     Codec * codec = request.getCodec();
       
   333 
       
   334     if (codec == NULL)
       
   335     {
       
   336         err = kErpcStatus_MemoryError;
       
   337     }
       
   338     else
       
   339     {
       
   340         codec->startWriteMessage(message_type_t::kInvocationMessage, m_serviceId, m_AppendChunkToBlobId, request.getSequence());
       
   341 
       
   342         write_binary_t_struct(codec, data);
       
   343 
       
   344         write_binary_t_struct(codec, blobID);
       
   345 
       
   346         // Send message to server
       
   347         // Codec status is checked inside this function.
       
   348         m_clientManager->performRequest(request);
       
   349 
       
   350         read_binary_t_struct(codec, newBlobID);
       
   351 
       
   352         codec->read(result);
       
   353 
       
   354         err = codec->getStatus();
       
   355     }
       
   356 
       
   357     // Dispose of the request.
       
   358     m_clientManager->releaseRequest(request);
       
   359 
       
   360     // Invoke error handler callback function
       
   361     m_clientManager->callErrorHandler(err, m_AppendChunkToBlobId);
       
   362 
       
   363 #if ERPC_PRE_POST_ACTION
       
   364     pre_post_action_cb postCB = m_clientManager->getPostCB();
       
   365     if (postCB)
       
   366     {
       
   367         postCB();
       
   368     }
       
   369 #endif
       
   370 
       
   371 
       
   372     if (err != kErpcStatus_Success)
       
   373     {
       
   374         result = 0xFFFFFFFFU;
       
   375     }
       
   376 
       
   377     return result;
       
   378 }
       
   379 
       
   380 // BeremizPLCObjectService interface GetLogMessage function client shim.
       
   381 uint32_t BeremizPLCObjectService_client::GetLogMessage(uint8_t level, uint32_t msgID, log_message * message)
       
   382 {
       
   383     erpc_status_t err = kErpcStatus_Success;
       
   384 
       
   385     uint32_t result;
       
   386 
       
   387 #if ERPC_PRE_POST_ACTION
       
   388     pre_post_action_cb preCB = m_clientManager->getPreCB();
       
   389     if (preCB)
       
   390     {
       
   391         preCB();
       
   392     }
       
   393 #endif
       
   394 
       
   395     // Get a new request.
       
   396     RequestContext request = m_clientManager->createRequest(false);
       
   397 
       
   398     // Encode the request.
       
   399     Codec * codec = request.getCodec();
       
   400 
       
   401     if (codec == NULL)
       
   402     {
       
   403         err = kErpcStatus_MemoryError;
       
   404     }
       
   405     else
       
   406     {
       
   407         codec->startWriteMessage(message_type_t::kInvocationMessage, m_serviceId, m_GetLogMessageId, request.getSequence());
       
   408 
       
   409         codec->write(level);
       
   410 
       
   411         codec->write(msgID);
       
   412 
       
   413         // Send message to server
       
   414         // Codec status is checked inside this function.
       
   415         m_clientManager->performRequest(request);
       
   416 
       
   417         read_log_message_struct(codec, message);
       
   418 
       
   419         codec->read(result);
       
   420 
       
   421         err = codec->getStatus();
       
   422     }
       
   423 
       
   424     // Dispose of the request.
       
   425     m_clientManager->releaseRequest(request);
       
   426 
       
   427     // Invoke error handler callback function
       
   428     m_clientManager->callErrorHandler(err, m_GetLogMessageId);
       
   429 
       
   430 #if ERPC_PRE_POST_ACTION
       
   431     pre_post_action_cb postCB = m_clientManager->getPostCB();
       
   432     if (postCB)
       
   433     {
       
   434         postCB();
       
   435     }
       
   436 #endif
       
   437 
       
   438 
       
   439     if (err != kErpcStatus_Success)
       
   440     {
       
   441         result = 0xFFFFFFFFU;
       
   442     }
       
   443 
       
   444     return result;
       
   445 }
       
   446 
       
   447 // BeremizPLCObjectService interface GetPLCID function client shim.
       
   448 uint32_t BeremizPLCObjectService_client::GetPLCID(PSKID * plcID)
       
   449 {
       
   450     erpc_status_t err = kErpcStatus_Success;
       
   451 
       
   452     uint32_t result;
       
   453 
       
   454 #if ERPC_PRE_POST_ACTION
       
   455     pre_post_action_cb preCB = m_clientManager->getPreCB();
       
   456     if (preCB)
       
   457     {
       
   458         preCB();
       
   459     }
       
   460 #endif
       
   461 
       
   462     // Get a new request.
       
   463     RequestContext request = m_clientManager->createRequest(false);
       
   464 
       
   465     // Encode the request.
       
   466     Codec * codec = request.getCodec();
       
   467 
       
   468     if (codec == NULL)
       
   469     {
       
   470         err = kErpcStatus_MemoryError;
       
   471     }
       
   472     else
       
   473     {
       
   474         codec->startWriteMessage(message_type_t::kInvocationMessage, m_serviceId, m_GetPLCIDId, request.getSequence());
       
   475 
       
   476         // Send message to server
       
   477         // Codec status is checked inside this function.
       
   478         m_clientManager->performRequest(request);
       
   479 
       
   480         read_PSKID_struct(codec, plcID);
       
   481 
       
   482         codec->read(result);
       
   483 
       
   484         err = codec->getStatus();
       
   485     }
       
   486 
       
   487     // Dispose of the request.
       
   488     m_clientManager->releaseRequest(request);
       
   489 
       
   490     // Invoke error handler callback function
       
   491     m_clientManager->callErrorHandler(err, m_GetPLCIDId);
       
   492 
       
   493 #if ERPC_PRE_POST_ACTION
       
   494     pre_post_action_cb postCB = m_clientManager->getPostCB();
       
   495     if (postCB)
       
   496     {
       
   497         postCB();
       
   498     }
       
   499 #endif
       
   500 
       
   501 
       
   502     if (err != kErpcStatus_Success)
       
   503     {
       
   504         result = 0xFFFFFFFFU;
       
   505     }
       
   506 
       
   507     return result;
       
   508 }
       
   509 
       
   510 // BeremizPLCObjectService interface GetPLCstatus function client shim.
       
   511 uint32_t BeremizPLCObjectService_client::GetPLCstatus(PLCstatus * status)
       
   512 {
       
   513     erpc_status_t err = kErpcStatus_Success;
       
   514 
       
   515     uint32_t result;
       
   516 
       
   517 #if ERPC_PRE_POST_ACTION
       
   518     pre_post_action_cb preCB = m_clientManager->getPreCB();
       
   519     if (preCB)
       
   520     {
       
   521         preCB();
       
   522     }
       
   523 #endif
       
   524 
       
   525     // Get a new request.
       
   526     RequestContext request = m_clientManager->createRequest(false);
       
   527 
       
   528     // Encode the request.
       
   529     Codec * codec = request.getCodec();
       
   530 
       
   531     if (codec == NULL)
       
   532     {
       
   533         err = kErpcStatus_MemoryError;
       
   534     }
       
   535     else
       
   536     {
       
   537         codec->startWriteMessage(message_type_t::kInvocationMessage, m_serviceId, m_GetPLCstatusId, request.getSequence());
       
   538 
       
   539         // Send message to server
       
   540         // Codec status is checked inside this function.
       
   541         m_clientManager->performRequest(request);
       
   542 
       
   543         read_PLCstatus_struct(codec, status);
       
   544 
       
   545         codec->read(result);
       
   546 
       
   547         err = codec->getStatus();
       
   548     }
       
   549 
       
   550     // Dispose of the request.
       
   551     m_clientManager->releaseRequest(request);
       
   552 
       
   553     // Invoke error handler callback function
       
   554     m_clientManager->callErrorHandler(err, m_GetPLCstatusId);
       
   555 
       
   556 #if ERPC_PRE_POST_ACTION
       
   557     pre_post_action_cb postCB = m_clientManager->getPostCB();
       
   558     if (postCB)
       
   559     {
       
   560         postCB();
       
   561     }
       
   562 #endif
       
   563 
       
   564 
       
   565     if (err != kErpcStatus_Success)
       
   566     {
       
   567         result = 0xFFFFFFFFU;
       
   568     }
       
   569 
       
   570     return result;
       
   571 }
       
   572 
       
   573 // BeremizPLCObjectService interface GetTraceVariables function client shim.
       
   574 uint32_t BeremizPLCObjectService_client::GetTraceVariables(uint32_t debugToken, TraceVariables * traces)
       
   575 {
       
   576     erpc_status_t err = kErpcStatus_Success;
       
   577 
       
   578     uint32_t result;
       
   579 
       
   580 #if ERPC_PRE_POST_ACTION
       
   581     pre_post_action_cb preCB = m_clientManager->getPreCB();
       
   582     if (preCB)
       
   583     {
       
   584         preCB();
       
   585     }
       
   586 #endif
       
   587 
       
   588     // Get a new request.
       
   589     RequestContext request = m_clientManager->createRequest(false);
       
   590 
       
   591     // Encode the request.
       
   592     Codec * codec = request.getCodec();
       
   593 
       
   594     if (codec == NULL)
       
   595     {
       
   596         err = kErpcStatus_MemoryError;
       
   597     }
       
   598     else
       
   599     {
       
   600         codec->startWriteMessage(message_type_t::kInvocationMessage, m_serviceId, m_GetTraceVariablesId, request.getSequence());
       
   601 
       
   602         codec->write(debugToken);
       
   603 
       
   604         // Send message to server
       
   605         // Codec status is checked inside this function.
       
   606         m_clientManager->performRequest(request);
       
   607 
       
   608         read_TraceVariables_struct(codec, traces);
       
   609 
       
   610         codec->read(result);
       
   611 
       
   612         err = codec->getStatus();
       
   613     }
       
   614 
       
   615     // Dispose of the request.
       
   616     m_clientManager->releaseRequest(request);
       
   617 
       
   618     // Invoke error handler callback function
       
   619     m_clientManager->callErrorHandler(err, m_GetTraceVariablesId);
       
   620 
       
   621 #if ERPC_PRE_POST_ACTION
       
   622     pre_post_action_cb postCB = m_clientManager->getPostCB();
       
   623     if (postCB)
       
   624     {
       
   625         postCB();
       
   626     }
       
   627 #endif
       
   628 
       
   629 
       
   630     if (err != kErpcStatus_Success)
       
   631     {
       
   632         result = 0xFFFFFFFFU;
       
   633     }
       
   634 
       
   635     return result;
       
   636 }
       
   637 
       
   638 // BeremizPLCObjectService interface MatchMD5 function client shim.
       
   639 uint32_t BeremizPLCObjectService_client::MatchMD5(const char * MD5, bool * match)
       
   640 {
       
   641     erpc_status_t err = kErpcStatus_Success;
       
   642 
       
   643     uint32_t result;
       
   644 
       
   645 #if ERPC_PRE_POST_ACTION
       
   646     pre_post_action_cb preCB = m_clientManager->getPreCB();
       
   647     if (preCB)
       
   648     {
       
   649         preCB();
       
   650     }
       
   651 #endif
       
   652 
       
   653     // Get a new request.
       
   654     RequestContext request = m_clientManager->createRequest(false);
       
   655 
       
   656     // Encode the request.
       
   657     Codec * codec = request.getCodec();
       
   658 
       
   659     if (codec == NULL)
       
   660     {
       
   661         err = kErpcStatus_MemoryError;
       
   662     }
       
   663     else
       
   664     {
       
   665         codec->startWriteMessage(message_type_t::kInvocationMessage, m_serviceId, m_MatchMD5Id, request.getSequence());
       
   666 
       
   667         {
       
   668             uint32_t MD5_len = strlen((const char*)MD5);
       
   669 
       
   670             codec->writeString(MD5_len, (const char*)MD5);
       
   671         }
       
   672 
       
   673         // Send message to server
       
   674         // Codec status is checked inside this function.
       
   675         m_clientManager->performRequest(request);
       
   676 
       
   677         codec->read(*match);
       
   678 
       
   679         codec->read(result);
       
   680 
       
   681         err = codec->getStatus();
       
   682     }
       
   683 
       
   684     // Dispose of the request.
       
   685     m_clientManager->releaseRequest(request);
       
   686 
       
   687     // Invoke error handler callback function
       
   688     m_clientManager->callErrorHandler(err, m_MatchMD5Id);
       
   689 
       
   690 #if ERPC_PRE_POST_ACTION
       
   691     pre_post_action_cb postCB = m_clientManager->getPostCB();
       
   692     if (postCB)
       
   693     {
       
   694         postCB();
       
   695     }
       
   696 #endif
       
   697 
       
   698 
       
   699     if (err != kErpcStatus_Success)
       
   700     {
       
   701         result = 0xFFFFFFFFU;
       
   702     }
       
   703 
       
   704     return result;
       
   705 }
       
   706 
       
   707 // BeremizPLCObjectService interface NewPLC function client shim.
       
   708 uint32_t BeremizPLCObjectService_client::NewPLC(const char * md5sum, const binary_t * plcObjectBlobID, const list_extra_file_1_t * extrafiles, bool * success)
       
   709 {
       
   710     erpc_status_t err = kErpcStatus_Success;
       
   711 
       
   712     uint32_t result;
       
   713 
       
   714 #if ERPC_PRE_POST_ACTION
       
   715     pre_post_action_cb preCB = m_clientManager->getPreCB();
       
   716     if (preCB)
       
   717     {
       
   718         preCB();
       
   719     }
       
   720 #endif
       
   721 
       
   722     // Get a new request.
       
   723     RequestContext request = m_clientManager->createRequest(false);
       
   724 
       
   725     // Encode the request.
       
   726     Codec * codec = request.getCodec();
       
   727 
       
   728     if (codec == NULL)
       
   729     {
       
   730         err = kErpcStatus_MemoryError;
       
   731     }
       
   732     else
       
   733     {
       
   734         codec->startWriteMessage(message_type_t::kInvocationMessage, m_serviceId, m_NewPLCId, request.getSequence());
       
   735 
       
   736         {
       
   737             uint32_t md5sum_len = strlen((const char*)md5sum);
       
   738 
       
   739             codec->writeString(md5sum_len, (const char*)md5sum);
       
   740         }
       
   741 
       
   742         write_binary_t_struct(codec, plcObjectBlobID);
       
   743 
       
   744         write_list_extra_file_1_t_struct(codec, extrafiles);
       
   745 
       
   746         // Send message to server
       
   747         // Codec status is checked inside this function.
       
   748         m_clientManager->performRequest(request);
       
   749 
       
   750         codec->read(*success);
       
   751 
       
   752         codec->read(result);
       
   753 
       
   754         err = codec->getStatus();
       
   755     }
       
   756 
       
   757     // Dispose of the request.
       
   758     m_clientManager->releaseRequest(request);
       
   759 
       
   760     // Invoke error handler callback function
       
   761     m_clientManager->callErrorHandler(err, m_NewPLCId);
       
   762 
       
   763 #if ERPC_PRE_POST_ACTION
       
   764     pre_post_action_cb postCB = m_clientManager->getPostCB();
       
   765     if (postCB)
       
   766     {
       
   767         postCB();
       
   768     }
       
   769 #endif
       
   770 
       
   771 
       
   772     if (err != kErpcStatus_Success)
       
   773     {
       
   774         result = 0xFFFFFFFFU;
       
   775     }
       
   776 
       
   777     return result;
       
   778 }
       
   779 
       
   780 // BeremizPLCObjectService interface PurgeBlobs function client shim.
       
   781 uint32_t BeremizPLCObjectService_client::PurgeBlobs(void)
       
   782 {
       
   783     erpc_status_t err = kErpcStatus_Success;
       
   784 
       
   785     uint32_t result;
       
   786 
       
   787 #if ERPC_PRE_POST_ACTION
       
   788     pre_post_action_cb preCB = m_clientManager->getPreCB();
       
   789     if (preCB)
       
   790     {
       
   791         preCB();
       
   792     }
       
   793 #endif
       
   794 
       
   795     // Get a new request.
       
   796     RequestContext request = m_clientManager->createRequest(false);
       
   797 
       
   798     // Encode the request.
       
   799     Codec * codec = request.getCodec();
       
   800 
       
   801     if (codec == NULL)
       
   802     {
       
   803         err = kErpcStatus_MemoryError;
       
   804     }
       
   805     else
       
   806     {
       
   807         codec->startWriteMessage(message_type_t::kInvocationMessage, m_serviceId, m_PurgeBlobsId, request.getSequence());
       
   808 
       
   809         // Send message to server
       
   810         // Codec status is checked inside this function.
       
   811         m_clientManager->performRequest(request);
       
   812 
       
   813         codec->read(result);
       
   814 
       
   815         err = codec->getStatus();
       
   816     }
       
   817 
       
   818     // Dispose of the request.
       
   819     m_clientManager->releaseRequest(request);
       
   820 
       
   821     // Invoke error handler callback function
       
   822     m_clientManager->callErrorHandler(err, m_PurgeBlobsId);
       
   823 
       
   824 #if ERPC_PRE_POST_ACTION
       
   825     pre_post_action_cb postCB = m_clientManager->getPostCB();
       
   826     if (postCB)
       
   827     {
       
   828         postCB();
       
   829     }
       
   830 #endif
       
   831 
       
   832 
       
   833     if (err != kErpcStatus_Success)
       
   834     {
       
   835         result = 0xFFFFFFFFU;
       
   836     }
       
   837 
       
   838     return result;
       
   839 }
       
   840 
       
   841 // BeremizPLCObjectService interface RepairPLC function client shim.
       
   842 uint32_t BeremizPLCObjectService_client::RepairPLC(void)
       
   843 {
       
   844     erpc_status_t err = kErpcStatus_Success;
       
   845 
       
   846     uint32_t result;
       
   847 
       
   848 #if ERPC_PRE_POST_ACTION
       
   849     pre_post_action_cb preCB = m_clientManager->getPreCB();
       
   850     if (preCB)
       
   851     {
       
   852         preCB();
       
   853     }
       
   854 #endif
       
   855 
       
   856     // Get a new request.
       
   857     RequestContext request = m_clientManager->createRequest(false);
       
   858 
       
   859     // Encode the request.
       
   860     Codec * codec = request.getCodec();
       
   861 
       
   862     if (codec == NULL)
       
   863     {
       
   864         err = kErpcStatus_MemoryError;
       
   865     }
       
   866     else
       
   867     {
       
   868         codec->startWriteMessage(message_type_t::kInvocationMessage, m_serviceId, m_RepairPLCId, request.getSequence());
       
   869 
       
   870         // Send message to server
       
   871         // Codec status is checked inside this function.
       
   872         m_clientManager->performRequest(request);
       
   873 
       
   874         codec->read(result);
       
   875 
       
   876         err = codec->getStatus();
       
   877     }
       
   878 
       
   879     // Dispose of the request.
       
   880     m_clientManager->releaseRequest(request);
       
   881 
       
   882     // Invoke error handler callback function
       
   883     m_clientManager->callErrorHandler(err, m_RepairPLCId);
       
   884 
       
   885 #if ERPC_PRE_POST_ACTION
       
   886     pre_post_action_cb postCB = m_clientManager->getPostCB();
       
   887     if (postCB)
       
   888     {
       
   889         postCB();
       
   890     }
       
   891 #endif
       
   892 
       
   893 
       
   894     if (err != kErpcStatus_Success)
       
   895     {
       
   896         result = 0xFFFFFFFFU;
       
   897     }
       
   898 
       
   899     return result;
       
   900 }
       
   901 
       
   902 // BeremizPLCObjectService interface ResetLogCount function client shim.
       
   903 uint32_t BeremizPLCObjectService_client::ResetLogCount(void)
       
   904 {
       
   905     erpc_status_t err = kErpcStatus_Success;
       
   906 
       
   907     uint32_t result;
       
   908 
       
   909 #if ERPC_PRE_POST_ACTION
       
   910     pre_post_action_cb preCB = m_clientManager->getPreCB();
       
   911     if (preCB)
       
   912     {
       
   913         preCB();
       
   914     }
       
   915 #endif
       
   916 
       
   917     // Get a new request.
       
   918     RequestContext request = m_clientManager->createRequest(false);
       
   919 
       
   920     // Encode the request.
       
   921     Codec * codec = request.getCodec();
       
   922 
       
   923     if (codec == NULL)
       
   924     {
       
   925         err = kErpcStatus_MemoryError;
       
   926     }
       
   927     else
       
   928     {
       
   929         codec->startWriteMessage(message_type_t::kInvocationMessage, m_serviceId, m_ResetLogCountId, request.getSequence());
       
   930 
       
   931         // Send message to server
       
   932         // Codec status is checked inside this function.
       
   933         m_clientManager->performRequest(request);
       
   934 
       
   935         codec->read(result);
       
   936 
       
   937         err = codec->getStatus();
       
   938     }
       
   939 
       
   940     // Dispose of the request.
       
   941     m_clientManager->releaseRequest(request);
       
   942 
       
   943     // Invoke error handler callback function
       
   944     m_clientManager->callErrorHandler(err, m_ResetLogCountId);
       
   945 
       
   946 #if ERPC_PRE_POST_ACTION
       
   947     pre_post_action_cb postCB = m_clientManager->getPostCB();
       
   948     if (postCB)
       
   949     {
       
   950         postCB();
       
   951     }
       
   952 #endif
       
   953 
       
   954 
       
   955     if (err != kErpcStatus_Success)
       
   956     {
       
   957         result = 0xFFFFFFFFU;
       
   958     }
       
   959 
       
   960     return result;
       
   961 }
       
   962 
       
   963 // BeremizPLCObjectService interface SeedBlob function client shim.
       
   964 uint32_t BeremizPLCObjectService_client::SeedBlob(const binary_t * seed, binary_t * blobID)
       
   965 {
       
   966     erpc_status_t err = kErpcStatus_Success;
       
   967 
       
   968     uint32_t result;
       
   969 
       
   970 #if ERPC_PRE_POST_ACTION
       
   971     pre_post_action_cb preCB = m_clientManager->getPreCB();
       
   972     if (preCB)
       
   973     {
       
   974         preCB();
       
   975     }
       
   976 #endif
       
   977 
       
   978     // Get a new request.
       
   979     RequestContext request = m_clientManager->createRequest(false);
       
   980 
       
   981     // Encode the request.
       
   982     Codec * codec = request.getCodec();
       
   983 
       
   984     if (codec == NULL)
       
   985     {
       
   986         err = kErpcStatus_MemoryError;
       
   987     }
       
   988     else
       
   989     {
       
   990         codec->startWriteMessage(message_type_t::kInvocationMessage, m_serviceId, m_SeedBlobId, request.getSequence());
       
   991 
       
   992         write_binary_t_struct(codec, seed);
       
   993 
       
   994         // Send message to server
       
   995         // Codec status is checked inside this function.
       
   996         m_clientManager->performRequest(request);
       
   997 
       
   998         read_binary_t_struct(codec, blobID);
       
   999 
       
  1000         codec->read(result);
       
  1001 
       
  1002         err = codec->getStatus();
       
  1003     }
       
  1004 
       
  1005     // Dispose of the request.
       
  1006     m_clientManager->releaseRequest(request);
       
  1007 
       
  1008     // Invoke error handler callback function
       
  1009     m_clientManager->callErrorHandler(err, m_SeedBlobId);
       
  1010 
       
  1011 #if ERPC_PRE_POST_ACTION
       
  1012     pre_post_action_cb postCB = m_clientManager->getPostCB();
       
  1013     if (postCB)
       
  1014     {
       
  1015         postCB();
       
  1016     }
       
  1017 #endif
       
  1018 
       
  1019 
       
  1020     if (err != kErpcStatus_Success)
       
  1021     {
       
  1022         result = 0xFFFFFFFFU;
       
  1023     }
       
  1024 
       
  1025     return result;
       
  1026 }
       
  1027 
       
  1028 // BeremizPLCObjectService interface SetTraceVariablesList function client shim.
       
  1029 uint32_t BeremizPLCObjectService_client::SetTraceVariablesList(const list_trace_order_1_t * orders, uint32_t * debugtoken)
       
  1030 {
       
  1031     erpc_status_t err = kErpcStatus_Success;
       
  1032 
       
  1033     uint32_t result;
       
  1034 
       
  1035 #if ERPC_PRE_POST_ACTION
       
  1036     pre_post_action_cb preCB = m_clientManager->getPreCB();
       
  1037     if (preCB)
       
  1038     {
       
  1039         preCB();
       
  1040     }
       
  1041 #endif
       
  1042 
       
  1043     // Get a new request.
       
  1044     RequestContext request = m_clientManager->createRequest(false);
       
  1045 
       
  1046     // Encode the request.
       
  1047     Codec * codec = request.getCodec();
       
  1048 
       
  1049     if (codec == NULL)
       
  1050     {
       
  1051         err = kErpcStatus_MemoryError;
       
  1052     }
       
  1053     else
       
  1054     {
       
  1055         codec->startWriteMessage(message_type_t::kInvocationMessage, m_serviceId, m_SetTraceVariablesListId, request.getSequence());
       
  1056 
       
  1057         write_list_trace_order_1_t_struct(codec, orders);
       
  1058 
       
  1059         // Send message to server
       
  1060         // Codec status is checked inside this function.
       
  1061         m_clientManager->performRequest(request);
       
  1062 
       
  1063         codec->read(*debugtoken);
       
  1064 
       
  1065         codec->read(result);
       
  1066 
       
  1067         err = codec->getStatus();
       
  1068     }
       
  1069 
       
  1070     // Dispose of the request.
       
  1071     m_clientManager->releaseRequest(request);
       
  1072 
       
  1073     // Invoke error handler callback function
       
  1074     m_clientManager->callErrorHandler(err, m_SetTraceVariablesListId);
       
  1075 
       
  1076 #if ERPC_PRE_POST_ACTION
       
  1077     pre_post_action_cb postCB = m_clientManager->getPostCB();
       
  1078     if (postCB)
       
  1079     {
       
  1080         postCB();
       
  1081     }
       
  1082 #endif
       
  1083 
       
  1084 
       
  1085     if (err != kErpcStatus_Success)
       
  1086     {
       
  1087         result = 0xFFFFFFFFU;
       
  1088     }
       
  1089 
       
  1090     return result;
       
  1091 }
       
  1092 
       
  1093 // BeremizPLCObjectService interface StartPLC function client shim.
       
  1094 uint32_t BeremizPLCObjectService_client::StartPLC(void)
       
  1095 {
       
  1096     erpc_status_t err = kErpcStatus_Success;
       
  1097 
       
  1098     uint32_t result;
       
  1099 
       
  1100 #if ERPC_PRE_POST_ACTION
       
  1101     pre_post_action_cb preCB = m_clientManager->getPreCB();
       
  1102     if (preCB)
       
  1103     {
       
  1104         preCB();
       
  1105     }
       
  1106 #endif
       
  1107 
       
  1108     // Get a new request.
       
  1109     RequestContext request = m_clientManager->createRequest(false);
       
  1110 
       
  1111     // Encode the request.
       
  1112     Codec * codec = request.getCodec();
       
  1113 
       
  1114     if (codec == NULL)
       
  1115     {
       
  1116         err = kErpcStatus_MemoryError;
       
  1117     }
       
  1118     else
       
  1119     {
       
  1120         codec->startWriteMessage(message_type_t::kInvocationMessage, m_serviceId, m_StartPLCId, request.getSequence());
       
  1121 
       
  1122         // Send message to server
       
  1123         // Codec status is checked inside this function.
       
  1124         m_clientManager->performRequest(request);
       
  1125 
       
  1126         codec->read(result);
       
  1127 
       
  1128         err = codec->getStatus();
       
  1129     }
       
  1130 
       
  1131     // Dispose of the request.
       
  1132     m_clientManager->releaseRequest(request);
       
  1133 
       
  1134     // Invoke error handler callback function
       
  1135     m_clientManager->callErrorHandler(err, m_StartPLCId);
       
  1136 
       
  1137 #if ERPC_PRE_POST_ACTION
       
  1138     pre_post_action_cb postCB = m_clientManager->getPostCB();
       
  1139     if (postCB)
       
  1140     {
       
  1141         postCB();
       
  1142     }
       
  1143 #endif
       
  1144 
       
  1145 
       
  1146     if (err != kErpcStatus_Success)
       
  1147     {
       
  1148         result = 0xFFFFFFFFU;
       
  1149     }
       
  1150 
       
  1151     return result;
       
  1152 }
       
  1153 
       
  1154 // BeremizPLCObjectService interface StopPLC function client shim.
       
  1155 uint32_t BeremizPLCObjectService_client::StopPLC(bool * success)
       
  1156 {
       
  1157     erpc_status_t err = kErpcStatus_Success;
       
  1158 
       
  1159     uint32_t result;
       
  1160 
       
  1161 #if ERPC_PRE_POST_ACTION
       
  1162     pre_post_action_cb preCB = m_clientManager->getPreCB();
       
  1163     if (preCB)
       
  1164     {
       
  1165         preCB();
       
  1166     }
       
  1167 #endif
       
  1168 
       
  1169     // Get a new request.
       
  1170     RequestContext request = m_clientManager->createRequest(false);
       
  1171 
       
  1172     // Encode the request.
       
  1173     Codec * codec = request.getCodec();
       
  1174 
       
  1175     if (codec == NULL)
       
  1176     {
       
  1177         err = kErpcStatus_MemoryError;
       
  1178     }
       
  1179     else
       
  1180     {
       
  1181         codec->startWriteMessage(message_type_t::kInvocationMessage, m_serviceId, m_StopPLCId, request.getSequence());
       
  1182 
       
  1183         // Send message to server
       
  1184         // Codec status is checked inside this function.
       
  1185         m_clientManager->performRequest(request);
       
  1186 
       
  1187         codec->read(*success);
       
  1188 
       
  1189         codec->read(result);
       
  1190 
       
  1191         err = codec->getStatus();
       
  1192     }
       
  1193 
       
  1194     // Dispose of the request.
       
  1195     m_clientManager->releaseRequest(request);
       
  1196 
       
  1197     // Invoke error handler callback function
       
  1198     m_clientManager->callErrorHandler(err, m_StopPLCId);
       
  1199 
       
  1200 #if ERPC_PRE_POST_ACTION
       
  1201     pre_post_action_cb postCB = m_clientManager->getPostCB();
       
  1202     if (postCB)
       
  1203     {
       
  1204         postCB();
       
  1205     }
       
  1206 #endif
       
  1207 
       
  1208 
       
  1209     if (err != kErpcStatus_Success)
       
  1210     {
       
  1211         result = 0xFFFFFFFFU;
       
  1212     }
       
  1213 
       
  1214     return result;
       
  1215 }