edouard@3937: /* edouard@3946: * Generated by erpcgen 1.12.0 on Mon May 20 17:54:19 2024. edouard@3937: * edouard@3937: * AUTOGENERATED - DO NOT EDIT edouard@3937: */ edouard@3937: edouard@3937: edouard@3937: #if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC edouard@3937: #include "erpc_port.h" edouard@3937: #endif edouard@3937: #include "erpc_codec.hpp" edouard@3937: #include "erpc_PLCObject_client.hpp" edouard@3937: #include "erpc_manually_constructed.hpp" edouard@3937: edouard@3946: #if 11200 != ERPC_VERSION_NUMBER edouard@3937: #error "The generated shim code version is different to the rest of eRPC code." edouard@3937: #endif edouard@3937: edouard@3937: using namespace erpc; edouard@3937: using namespace std; edouard@3937: using namespace erpcShim; edouard@3937: edouard@3937: //! @brief Function to write struct binary_t edouard@3937: static void write_binary_t_struct(erpc::Codec * codec, const binary_t * data); edouard@3937: edouard@3937: //! @brief Function to write struct extra_file edouard@3937: static void write_extra_file_struct(erpc::Codec * codec, const extra_file * data); edouard@3937: edouard@3937: //! @brief Function to write struct list_extra_file_1_t edouard@3937: static void write_list_extra_file_1_t_struct(erpc::Codec * codec, const list_extra_file_1_t * data); edouard@3937: edouard@3937: //! @brief Function to write struct trace_order edouard@3937: static void write_trace_order_struct(erpc::Codec * codec, const trace_order * data); edouard@3937: edouard@3937: //! @brief Function to write struct list_trace_order_1_t edouard@3937: static void write_list_trace_order_1_t_struct(erpc::Codec * codec, const list_trace_order_1_t * data); edouard@3937: edouard@3937: edouard@3937: // Write struct binary_t function implementation edouard@3937: static void write_binary_t_struct(erpc::Codec * codec, const binary_t * data) edouard@3937: { edouard@3937: if(NULL == data) edouard@3937: { edouard@3937: return; edouard@3937: } edouard@3937: edouard@3937: codec->writeBinary(data->dataLength, data->data); edouard@3937: } edouard@3937: edouard@3937: // Write struct extra_file function implementation edouard@3937: static void write_extra_file_struct(erpc::Codec * codec, const extra_file * data) edouard@3937: { edouard@3937: if(NULL == data) edouard@3937: { edouard@3937: return; edouard@3937: } edouard@3937: edouard@3937: { edouard@3937: uint32_t fname_len = strlen((const char*)data->fname); edouard@3937: edouard@3937: codec->writeString(fname_len, (const char*)data->fname); edouard@3937: } edouard@3937: edouard@3937: write_binary_t_struct(codec, &(data->blobID)); edouard@3937: } edouard@3937: edouard@3937: // Write struct list_extra_file_1_t function implementation edouard@3937: static void write_list_extra_file_1_t_struct(erpc::Codec * codec, const list_extra_file_1_t * data) edouard@3937: { edouard@3937: if(NULL == data) edouard@3937: { edouard@3937: return; edouard@3937: } edouard@3937: edouard@3937: codec->startWriteList(data->elementsCount); edouard@3937: for (uint32_t listCount = 0U; listCount < data->elementsCount; ++listCount) edouard@3937: { edouard@3937: write_extra_file_struct(codec, &(data->elements[listCount])); edouard@3937: } edouard@3937: } edouard@3937: edouard@3937: // Write struct trace_order function implementation edouard@3937: static void write_trace_order_struct(erpc::Codec * codec, const trace_order * data) edouard@3937: { edouard@3937: if(NULL == data) edouard@3937: { edouard@3937: return; edouard@3937: } edouard@3937: edouard@3937: codec->write(data->idx); edouard@3937: edouard@3937: write_binary_t_struct(codec, &(data->force)); edouard@3937: } edouard@3937: edouard@3937: // Write struct list_trace_order_1_t function implementation edouard@3937: static void write_list_trace_order_1_t_struct(erpc::Codec * codec, const list_trace_order_1_t * data) edouard@3937: { edouard@3937: if(NULL == data) edouard@3937: { edouard@3937: return; edouard@3937: } edouard@3937: edouard@3937: codec->startWriteList(data->elementsCount); edouard@3937: for (uint32_t listCount = 0U; listCount < data->elementsCount; ++listCount) edouard@3937: { edouard@3937: write_trace_order_struct(codec, &(data->elements[listCount])); edouard@3937: } edouard@3937: } edouard@3937: edouard@3937: edouard@3937: //! @brief Function to read struct binary_t edouard@3937: static void read_binary_t_struct(erpc::Codec * codec, binary_t * data); edouard@3937: edouard@3937: //! @brief Function to read struct log_message edouard@3937: static void read_log_message_struct(erpc::Codec * codec, log_message * data); edouard@3937: edouard@3937: //! @brief Function to read struct PSKID edouard@3937: static void read_PSKID_struct(erpc::Codec * codec, PSKID * data); edouard@3937: edouard@3937: //! @brief Function to read struct PLCstatus edouard@3937: static void read_PLCstatus_struct(erpc::Codec * codec, PLCstatus * data); edouard@3937: edouard@3937: //! @brief Function to read struct trace_sample edouard@3937: static void read_trace_sample_struct(erpc::Codec * codec, trace_sample * data); edouard@3937: edouard@3937: //! @brief Function to read struct TraceVariables edouard@3937: static void read_TraceVariables_struct(erpc::Codec * codec, TraceVariables * data); edouard@3937: edouard@3937: //! @brief Function to read struct list_trace_sample_1_t edouard@3937: static void read_list_trace_sample_1_t_struct(erpc::Codec * codec, list_trace_sample_1_t * data); edouard@3937: edouard@3937: edouard@3937: // Read struct binary_t function implementation edouard@3937: static void read_binary_t_struct(erpc::Codec * codec, binary_t * data) edouard@3937: { edouard@3937: if(NULL == data) edouard@3937: { edouard@3937: return; edouard@3937: } edouard@3937: edouard@3937: uint8_t * data_local; edouard@3937: codec->readBinary(data->dataLength, &data_local); edouard@3937: if (data->dataLength > 0) edouard@3937: { edouard@3937: data->data = (uint8_t *) erpc_malloc(data->dataLength * sizeof(uint8_t)); edouard@3937: if (data->data == NULL) edouard@3937: { edouard@3937: codec->updateStatus(kErpcStatus_MemoryError); edouard@3937: } edouard@3937: else edouard@3937: { edouard@3937: memcpy(data->data, data_local, data->dataLength); edouard@3937: } edouard@3937: } edouard@3937: else edouard@3937: { edouard@3937: data->data = NULL; edouard@3937: } edouard@3937: } edouard@3937: edouard@3937: // Read struct log_message function implementation edouard@3937: static void read_log_message_struct(erpc::Codec * codec, log_message * data) edouard@3937: { edouard@3937: if(NULL == data) edouard@3937: { edouard@3937: return; edouard@3937: } edouard@3937: edouard@3937: { edouard@3937: uint32_t msg_len; edouard@3937: char * msg_local; edouard@3937: codec->readString(msg_len, &msg_local); edouard@3937: data->msg = (char*) erpc_malloc((msg_len + 1) * sizeof(char)); edouard@3937: if ((data->msg == NULL) || (msg_local == NULL)) edouard@3937: { edouard@3937: codec->updateStatus(kErpcStatus_MemoryError); edouard@3937: } edouard@3937: else edouard@3937: { edouard@3937: memcpy(data->msg, msg_local, msg_len); edouard@3937: (data->msg)[msg_len] = 0; edouard@3937: } edouard@3937: } edouard@3937: edouard@3937: codec->read(data->tick); edouard@3937: edouard@3937: codec->read(data->sec); edouard@3937: edouard@3937: codec->read(data->nsec); edouard@3937: } edouard@3937: edouard@3937: // Read struct PSKID function implementation edouard@3937: static void read_PSKID_struct(erpc::Codec * codec, PSKID * data) edouard@3937: { edouard@3937: if(NULL == data) edouard@3937: { edouard@3937: return; edouard@3937: } edouard@3937: edouard@3937: { edouard@3937: uint32_t ID_len; edouard@3937: char * ID_local; edouard@3937: codec->readString(ID_len, &ID_local); edouard@3937: data->ID = (char*) erpc_malloc((ID_len + 1) * sizeof(char)); edouard@3937: if ((data->ID == NULL) || (ID_local == NULL)) edouard@3937: { edouard@3937: codec->updateStatus(kErpcStatus_MemoryError); edouard@3937: } edouard@3937: else edouard@3937: { edouard@3937: memcpy(data->ID, ID_local, ID_len); edouard@3937: (data->ID)[ID_len] = 0; edouard@3937: } edouard@3937: } edouard@3937: edouard@3937: { edouard@3937: uint32_t PSK_len; edouard@3937: char * PSK_local; edouard@3937: codec->readString(PSK_len, &PSK_local); edouard@3937: data->PSK = (char*) erpc_malloc((PSK_len + 1) * sizeof(char)); edouard@3937: if ((data->PSK == NULL) || (PSK_local == NULL)) edouard@3937: { edouard@3937: codec->updateStatus(kErpcStatus_MemoryError); edouard@3937: } edouard@3937: else edouard@3937: { edouard@3937: memcpy(data->PSK, PSK_local, PSK_len); edouard@3937: (data->PSK)[PSK_len] = 0; edouard@3937: } edouard@3937: } edouard@3937: } edouard@3937: edouard@3937: // Read struct PLCstatus function implementation edouard@3937: static void read_PLCstatus_struct(erpc::Codec * codec, PLCstatus * data) edouard@3937: { edouard@3937: int32_t _tmp_local_i32; edouard@3937: edouard@3937: if(NULL == data) edouard@3937: { edouard@3937: return; edouard@3937: } edouard@3937: edouard@3937: codec->read(_tmp_local_i32); edouard@3937: data->PLCstatus = static_cast(_tmp_local_i32); edouard@3937: edouard@3937: for (uint32_t arrayCount0 = 0U; arrayCount0 < 4U; ++arrayCount0) edouard@3937: { edouard@3937: codec->read(data->logcounts[arrayCount0]); edouard@3937: } edouard@3937: } edouard@3937: edouard@3937: // Read struct trace_sample function implementation edouard@3937: static void read_trace_sample_struct(erpc::Codec * codec, trace_sample * data) edouard@3937: { edouard@3937: if(NULL == data) edouard@3937: { edouard@3937: return; edouard@3937: } edouard@3937: edouard@3937: codec->read(data->tick); edouard@3937: edouard@3937: read_binary_t_struct(codec, &(data->TraceBuffer)); edouard@3937: } edouard@3937: edouard@3937: // Read struct TraceVariables function implementation edouard@3937: static void read_TraceVariables_struct(erpc::Codec * codec, TraceVariables * data) edouard@3937: { edouard@3937: int32_t _tmp_local_i32; edouard@3937: edouard@3937: if(NULL == data) edouard@3937: { edouard@3937: return; edouard@3937: } edouard@3937: edouard@3937: codec->read(_tmp_local_i32); edouard@3937: data->PLCstatus = static_cast(_tmp_local_i32); edouard@3937: edouard@3937: read_list_trace_sample_1_t_struct(codec, &(data->traces)); edouard@3937: } edouard@3937: edouard@3937: // Read struct list_trace_sample_1_t function implementation edouard@3937: static void read_list_trace_sample_1_t_struct(erpc::Codec * codec, list_trace_sample_1_t * data) edouard@3937: { edouard@3937: if(NULL == data) edouard@3937: { edouard@3937: return; edouard@3937: } edouard@3937: edouard@3937: codec->startReadList(data->elementsCount); edouard@3937: data->elements = (trace_sample *) erpc_malloc(data->elementsCount * sizeof(trace_sample)); edouard@3937: if ((data->elements == NULL) && (data->elementsCount > 0)) edouard@3937: { edouard@3937: codec->updateStatus(kErpcStatus_MemoryError); edouard@3937: } edouard@3937: for (uint32_t listCount = 0U; listCount < data->elementsCount; ++listCount) edouard@3937: { edouard@3937: read_trace_sample_struct(codec, &(data->elements[listCount])); edouard@3937: } edouard@3937: } edouard@3937: edouard@3937: edouard@3937: edouard@3937: edouard@3937: BeremizPLCObjectService_client::BeremizPLCObjectService_client(ClientManager *manager) edouard@3937: :m_clientManager(manager) edouard@3937: { edouard@3937: } edouard@3937: edouard@3937: BeremizPLCObjectService_client::~BeremizPLCObjectService_client() edouard@3937: { edouard@3937: } edouard@3937: edouard@3937: // BeremizPLCObjectService interface AppendChunkToBlob function client shim. edouard@3937: uint32_t BeremizPLCObjectService_client::AppendChunkToBlob(const binary_t * data, const binary_t * blobID, binary_t * newBlobID) edouard@3937: { edouard@3937: erpc_status_t err = kErpcStatus_Success; edouard@3937: edouard@3937: uint32_t result; edouard@3937: edouard@3937: #if ERPC_PRE_POST_ACTION edouard@3937: pre_post_action_cb preCB = m_clientManager->getPreCB(); edouard@3937: if (preCB) edouard@3937: { edouard@3937: preCB(); edouard@3937: } edouard@3937: #endif edouard@3937: edouard@3937: // Get a new request. edouard@3937: RequestContext request = m_clientManager->createRequest(false); edouard@3937: edouard@3937: // Encode the request. edouard@3937: Codec * codec = request.getCodec(); edouard@3937: edouard@3937: if (codec == NULL) edouard@3937: { edouard@3937: err = kErpcStatus_MemoryError; edouard@3937: } edouard@3937: else edouard@3937: { edouard@3937: codec->startWriteMessage(message_type_t::kInvocationMessage, m_serviceId, m_AppendChunkToBlobId, request.getSequence()); edouard@3937: edouard@3937: write_binary_t_struct(codec, data); edouard@3937: edouard@3937: write_binary_t_struct(codec, blobID); edouard@3937: edouard@3937: // Send message to server edouard@3937: // Codec status is checked inside this function. edouard@3937: m_clientManager->performRequest(request); edouard@3937: edouard@3937: read_binary_t_struct(codec, newBlobID); edouard@3937: edouard@3937: codec->read(result); edouard@3937: edouard@3937: err = codec->getStatus(); edouard@3937: } edouard@3937: edouard@3937: // Dispose of the request. edouard@3937: m_clientManager->releaseRequest(request); edouard@3937: edouard@3937: // Invoke error handler callback function edouard@3937: m_clientManager->callErrorHandler(err, m_AppendChunkToBlobId); edouard@3937: edouard@3937: #if ERPC_PRE_POST_ACTION edouard@3937: pre_post_action_cb postCB = m_clientManager->getPostCB(); edouard@3937: if (postCB) edouard@3937: { edouard@3937: postCB(); edouard@3937: } edouard@3937: #endif edouard@3937: edouard@3937: edouard@3937: if (err != kErpcStatus_Success) edouard@3937: { edouard@3937: result = 0xFFFFFFFFU; edouard@3937: } edouard@3937: edouard@3937: return result; edouard@3937: } edouard@3937: edouard@3937: // BeremizPLCObjectService interface GetLogMessage function client shim. edouard@3937: uint32_t BeremizPLCObjectService_client::GetLogMessage(uint8_t level, uint32_t msgID, log_message * message) edouard@3937: { edouard@3937: erpc_status_t err = kErpcStatus_Success; edouard@3937: edouard@3937: uint32_t result; edouard@3937: edouard@3937: #if ERPC_PRE_POST_ACTION edouard@3937: pre_post_action_cb preCB = m_clientManager->getPreCB(); edouard@3937: if (preCB) edouard@3937: { edouard@3937: preCB(); edouard@3937: } edouard@3937: #endif edouard@3937: edouard@3937: // Get a new request. edouard@3937: RequestContext request = m_clientManager->createRequest(false); edouard@3937: edouard@3937: // Encode the request. edouard@3937: Codec * codec = request.getCodec(); edouard@3937: edouard@3937: if (codec == NULL) edouard@3937: { edouard@3937: err = kErpcStatus_MemoryError; edouard@3937: } edouard@3937: else edouard@3937: { edouard@3937: codec->startWriteMessage(message_type_t::kInvocationMessage, m_serviceId, m_GetLogMessageId, request.getSequence()); edouard@3937: edouard@3937: codec->write(level); edouard@3937: edouard@3937: codec->write(msgID); edouard@3937: edouard@3937: // Send message to server edouard@3937: // Codec status is checked inside this function. edouard@3937: m_clientManager->performRequest(request); edouard@3937: edouard@3937: read_log_message_struct(codec, message); edouard@3937: edouard@3937: codec->read(result); edouard@3937: edouard@3937: err = codec->getStatus(); edouard@3937: } edouard@3937: edouard@3937: // Dispose of the request. edouard@3937: m_clientManager->releaseRequest(request); edouard@3937: edouard@3937: // Invoke error handler callback function edouard@3937: m_clientManager->callErrorHandler(err, m_GetLogMessageId); edouard@3937: edouard@3937: #if ERPC_PRE_POST_ACTION edouard@3937: pre_post_action_cb postCB = m_clientManager->getPostCB(); edouard@3937: if (postCB) edouard@3937: { edouard@3937: postCB(); edouard@3937: } edouard@3937: #endif edouard@3937: edouard@3937: edouard@3937: if (err != kErpcStatus_Success) edouard@3937: { edouard@3937: result = 0xFFFFFFFFU; edouard@3937: } edouard@3937: edouard@3937: return result; edouard@3937: } edouard@3937: edouard@3937: // BeremizPLCObjectService interface GetPLCID function client shim. edouard@3937: uint32_t BeremizPLCObjectService_client::GetPLCID(PSKID * plcID) edouard@3937: { edouard@3937: erpc_status_t err = kErpcStatus_Success; edouard@3937: edouard@3937: uint32_t result; edouard@3937: edouard@3937: #if ERPC_PRE_POST_ACTION edouard@3937: pre_post_action_cb preCB = m_clientManager->getPreCB(); edouard@3937: if (preCB) edouard@3937: { edouard@3937: preCB(); edouard@3937: } edouard@3937: #endif edouard@3937: edouard@3937: // Get a new request. edouard@3937: RequestContext request = m_clientManager->createRequest(false); edouard@3937: edouard@3937: // Encode the request. edouard@3937: Codec * codec = request.getCodec(); edouard@3937: edouard@3937: if (codec == NULL) edouard@3937: { edouard@3937: err = kErpcStatus_MemoryError; edouard@3937: } edouard@3937: else edouard@3937: { edouard@3937: codec->startWriteMessage(message_type_t::kInvocationMessage, m_serviceId, m_GetPLCIDId, request.getSequence()); edouard@3937: edouard@3937: // Send message to server edouard@3937: // Codec status is checked inside this function. edouard@3937: m_clientManager->performRequest(request); edouard@3937: edouard@3937: read_PSKID_struct(codec, plcID); edouard@3937: edouard@3937: codec->read(result); edouard@3937: edouard@3937: err = codec->getStatus(); edouard@3937: } edouard@3937: edouard@3937: // Dispose of the request. edouard@3937: m_clientManager->releaseRequest(request); edouard@3937: edouard@3937: // Invoke error handler callback function edouard@3937: m_clientManager->callErrorHandler(err, m_GetPLCIDId); edouard@3937: edouard@3937: #if ERPC_PRE_POST_ACTION edouard@3937: pre_post_action_cb postCB = m_clientManager->getPostCB(); edouard@3937: if (postCB) edouard@3937: { edouard@3937: postCB(); edouard@3937: } edouard@3937: #endif edouard@3937: edouard@3937: edouard@3937: if (err != kErpcStatus_Success) edouard@3937: { edouard@3937: result = 0xFFFFFFFFU; edouard@3937: } edouard@3937: edouard@3937: return result; edouard@3937: } edouard@3937: edouard@3937: // BeremizPLCObjectService interface GetPLCstatus function client shim. edouard@3937: uint32_t BeremizPLCObjectService_client::GetPLCstatus(PLCstatus * status) edouard@3937: { edouard@3937: erpc_status_t err = kErpcStatus_Success; edouard@3937: edouard@3937: uint32_t result; edouard@3937: edouard@3937: #if ERPC_PRE_POST_ACTION edouard@3937: pre_post_action_cb preCB = m_clientManager->getPreCB(); edouard@3937: if (preCB) edouard@3937: { edouard@3937: preCB(); edouard@3937: } edouard@3937: #endif edouard@3937: edouard@3937: // Get a new request. edouard@3937: RequestContext request = m_clientManager->createRequest(false); edouard@3937: edouard@3937: // Encode the request. edouard@3937: Codec * codec = request.getCodec(); edouard@3937: edouard@3937: if (codec == NULL) edouard@3937: { edouard@3937: err = kErpcStatus_MemoryError; edouard@3937: } edouard@3937: else edouard@3937: { edouard@3937: codec->startWriteMessage(message_type_t::kInvocationMessage, m_serviceId, m_GetPLCstatusId, request.getSequence()); edouard@3937: edouard@3937: // Send message to server edouard@3937: // Codec status is checked inside this function. edouard@3937: m_clientManager->performRequest(request); edouard@3937: edouard@3937: read_PLCstatus_struct(codec, status); edouard@3937: edouard@3937: codec->read(result); edouard@3937: edouard@3937: err = codec->getStatus(); edouard@3937: } edouard@3937: edouard@3937: // Dispose of the request. edouard@3937: m_clientManager->releaseRequest(request); edouard@3937: edouard@3937: // Invoke error handler callback function edouard@3937: m_clientManager->callErrorHandler(err, m_GetPLCstatusId); edouard@3937: edouard@3937: #if ERPC_PRE_POST_ACTION edouard@3937: pre_post_action_cb postCB = m_clientManager->getPostCB(); edouard@3937: if (postCB) edouard@3937: { edouard@3937: postCB(); edouard@3937: } edouard@3937: #endif edouard@3937: edouard@3937: edouard@3937: if (err != kErpcStatus_Success) edouard@3937: { edouard@3937: result = 0xFFFFFFFFU; edouard@3937: } edouard@3937: edouard@3937: return result; edouard@3937: } edouard@3937: edouard@3937: // BeremizPLCObjectService interface GetTraceVariables function client shim. edouard@3937: uint32_t BeremizPLCObjectService_client::GetTraceVariables(uint32_t debugToken, TraceVariables * traces) edouard@3937: { edouard@3937: erpc_status_t err = kErpcStatus_Success; edouard@3937: edouard@3937: uint32_t result; edouard@3937: edouard@3937: #if ERPC_PRE_POST_ACTION edouard@3937: pre_post_action_cb preCB = m_clientManager->getPreCB(); edouard@3937: if (preCB) edouard@3937: { edouard@3937: preCB(); edouard@3937: } edouard@3937: #endif edouard@3937: edouard@3937: // Get a new request. edouard@3937: RequestContext request = m_clientManager->createRequest(false); edouard@3937: edouard@3937: // Encode the request. edouard@3937: Codec * codec = request.getCodec(); edouard@3937: edouard@3937: if (codec == NULL) edouard@3937: { edouard@3937: err = kErpcStatus_MemoryError; edouard@3937: } edouard@3937: else edouard@3937: { edouard@3937: codec->startWriteMessage(message_type_t::kInvocationMessage, m_serviceId, m_GetTraceVariablesId, request.getSequence()); edouard@3937: edouard@3937: codec->write(debugToken); edouard@3937: edouard@3937: // Send message to server edouard@3937: // Codec status is checked inside this function. edouard@3937: m_clientManager->performRequest(request); edouard@3937: edouard@3937: read_TraceVariables_struct(codec, traces); edouard@3937: edouard@3937: codec->read(result); edouard@3937: edouard@3937: err = codec->getStatus(); edouard@3937: } edouard@3937: edouard@3937: // Dispose of the request. edouard@3937: m_clientManager->releaseRequest(request); edouard@3937: edouard@3937: // Invoke error handler callback function edouard@3937: m_clientManager->callErrorHandler(err, m_GetTraceVariablesId); edouard@3937: edouard@3937: #if ERPC_PRE_POST_ACTION edouard@3937: pre_post_action_cb postCB = m_clientManager->getPostCB(); edouard@3937: if (postCB) edouard@3937: { edouard@3937: postCB(); edouard@3937: } edouard@3937: #endif edouard@3937: edouard@3937: edouard@3937: if (err != kErpcStatus_Success) edouard@3937: { edouard@3937: result = 0xFFFFFFFFU; edouard@3937: } edouard@3937: edouard@3937: return result; edouard@3937: } edouard@3937: edouard@3937: // BeremizPLCObjectService interface MatchMD5 function client shim. edouard@3937: uint32_t BeremizPLCObjectService_client::MatchMD5(const char * MD5, bool * match) edouard@3937: { edouard@3937: erpc_status_t err = kErpcStatus_Success; edouard@3937: edouard@3937: uint32_t result; edouard@3937: edouard@3937: #if ERPC_PRE_POST_ACTION edouard@3937: pre_post_action_cb preCB = m_clientManager->getPreCB(); edouard@3937: if (preCB) edouard@3937: { edouard@3937: preCB(); edouard@3937: } edouard@3937: #endif edouard@3937: edouard@3937: // Get a new request. edouard@3937: RequestContext request = m_clientManager->createRequest(false); edouard@3937: edouard@3937: // Encode the request. edouard@3937: Codec * codec = request.getCodec(); edouard@3937: edouard@3937: if (codec == NULL) edouard@3937: { edouard@3937: err = kErpcStatus_MemoryError; edouard@3937: } edouard@3937: else edouard@3937: { edouard@3937: codec->startWriteMessage(message_type_t::kInvocationMessage, m_serviceId, m_MatchMD5Id, request.getSequence()); edouard@3937: edouard@3937: { edouard@3937: uint32_t MD5_len = strlen((const char*)MD5); edouard@3937: edouard@3937: codec->writeString(MD5_len, (const char*)MD5); edouard@3937: } edouard@3937: edouard@3937: // Send message to server edouard@3937: // Codec status is checked inside this function. edouard@3937: m_clientManager->performRequest(request); edouard@3937: edouard@3937: codec->read(*match); edouard@3937: edouard@3937: codec->read(result); edouard@3937: edouard@3937: err = codec->getStatus(); edouard@3937: } edouard@3937: edouard@3937: // Dispose of the request. edouard@3937: m_clientManager->releaseRequest(request); edouard@3937: edouard@3937: // Invoke error handler callback function edouard@3937: m_clientManager->callErrorHandler(err, m_MatchMD5Id); edouard@3937: edouard@3937: #if ERPC_PRE_POST_ACTION edouard@3937: pre_post_action_cb postCB = m_clientManager->getPostCB(); edouard@3937: if (postCB) edouard@3937: { edouard@3937: postCB(); edouard@3937: } edouard@3937: #endif edouard@3937: edouard@3937: edouard@3937: if (err != kErpcStatus_Success) edouard@3937: { edouard@3937: result = 0xFFFFFFFFU; edouard@3937: } edouard@3937: edouard@3937: return result; edouard@3937: } edouard@3937: edouard@3937: // BeremizPLCObjectService interface NewPLC function client shim. edouard@3937: uint32_t BeremizPLCObjectService_client::NewPLC(const char * md5sum, const binary_t * plcObjectBlobID, const list_extra_file_1_t * extrafiles, bool * success) edouard@3937: { edouard@3937: erpc_status_t err = kErpcStatus_Success; edouard@3937: edouard@3937: uint32_t result; edouard@3937: edouard@3937: #if ERPC_PRE_POST_ACTION edouard@3937: pre_post_action_cb preCB = m_clientManager->getPreCB(); edouard@3937: if (preCB) edouard@3937: { edouard@3937: preCB(); edouard@3937: } edouard@3937: #endif edouard@3937: edouard@3937: // Get a new request. edouard@3937: RequestContext request = m_clientManager->createRequest(false); edouard@3937: edouard@3937: // Encode the request. edouard@3937: Codec * codec = request.getCodec(); edouard@3937: edouard@3937: if (codec == NULL) edouard@3937: { edouard@3937: err = kErpcStatus_MemoryError; edouard@3937: } edouard@3937: else edouard@3937: { edouard@3937: codec->startWriteMessage(message_type_t::kInvocationMessage, m_serviceId, m_NewPLCId, request.getSequence()); edouard@3937: edouard@3937: { edouard@3937: uint32_t md5sum_len = strlen((const char*)md5sum); edouard@3937: edouard@3937: codec->writeString(md5sum_len, (const char*)md5sum); edouard@3937: } edouard@3937: edouard@3937: write_binary_t_struct(codec, plcObjectBlobID); edouard@3937: edouard@3937: write_list_extra_file_1_t_struct(codec, extrafiles); edouard@3937: edouard@3937: // Send message to server edouard@3937: // Codec status is checked inside this function. edouard@3937: m_clientManager->performRequest(request); edouard@3937: edouard@3937: codec->read(*success); edouard@3937: edouard@3937: codec->read(result); edouard@3937: edouard@3937: err = codec->getStatus(); edouard@3937: } edouard@3937: edouard@3937: // Dispose of the request. edouard@3937: m_clientManager->releaseRequest(request); edouard@3937: edouard@3937: // Invoke error handler callback function edouard@3937: m_clientManager->callErrorHandler(err, m_NewPLCId); edouard@3937: edouard@3937: #if ERPC_PRE_POST_ACTION edouard@3937: pre_post_action_cb postCB = m_clientManager->getPostCB(); edouard@3937: if (postCB) edouard@3937: { edouard@3937: postCB(); edouard@3937: } edouard@3937: #endif edouard@3937: edouard@3937: edouard@3937: if (err != kErpcStatus_Success) edouard@3937: { edouard@3937: result = 0xFFFFFFFFU; edouard@3937: } edouard@3937: edouard@3937: return result; edouard@3937: } edouard@3937: edouard@3937: // BeremizPLCObjectService interface PurgeBlobs function client shim. edouard@3937: uint32_t BeremizPLCObjectService_client::PurgeBlobs(void) edouard@3937: { edouard@3937: erpc_status_t err = kErpcStatus_Success; edouard@3937: edouard@3937: uint32_t result; edouard@3937: edouard@3937: #if ERPC_PRE_POST_ACTION edouard@3937: pre_post_action_cb preCB = m_clientManager->getPreCB(); edouard@3937: if (preCB) edouard@3937: { edouard@3937: preCB(); edouard@3937: } edouard@3937: #endif edouard@3937: edouard@3937: // Get a new request. edouard@3937: RequestContext request = m_clientManager->createRequest(false); edouard@3937: edouard@3937: // Encode the request. edouard@3937: Codec * codec = request.getCodec(); edouard@3937: edouard@3937: if (codec == NULL) edouard@3937: { edouard@3937: err = kErpcStatus_MemoryError; edouard@3937: } edouard@3937: else edouard@3937: { edouard@3937: codec->startWriteMessage(message_type_t::kInvocationMessage, m_serviceId, m_PurgeBlobsId, request.getSequence()); edouard@3937: edouard@3937: // Send message to server edouard@3937: // Codec status is checked inside this function. edouard@3937: m_clientManager->performRequest(request); edouard@3937: edouard@3937: codec->read(result); edouard@3937: edouard@3937: err = codec->getStatus(); edouard@3937: } edouard@3937: edouard@3937: // Dispose of the request. edouard@3937: m_clientManager->releaseRequest(request); edouard@3937: edouard@3937: // Invoke error handler callback function edouard@3937: m_clientManager->callErrorHandler(err, m_PurgeBlobsId); edouard@3937: edouard@3937: #if ERPC_PRE_POST_ACTION edouard@3937: pre_post_action_cb postCB = m_clientManager->getPostCB(); edouard@3937: if (postCB) edouard@3937: { edouard@3937: postCB(); edouard@3937: } edouard@3937: #endif edouard@3937: edouard@3937: edouard@3937: if (err != kErpcStatus_Success) edouard@3937: { edouard@3937: result = 0xFFFFFFFFU; edouard@3937: } edouard@3937: edouard@3937: return result; edouard@3937: } edouard@3937: edouard@3937: // BeremizPLCObjectService interface RepairPLC function client shim. edouard@3937: uint32_t BeremizPLCObjectService_client::RepairPLC(void) edouard@3937: { edouard@3937: erpc_status_t err = kErpcStatus_Success; edouard@3937: edouard@3937: uint32_t result; edouard@3937: edouard@3937: #if ERPC_PRE_POST_ACTION edouard@3937: pre_post_action_cb preCB = m_clientManager->getPreCB(); edouard@3937: if (preCB) edouard@3937: { edouard@3937: preCB(); edouard@3937: } edouard@3937: #endif edouard@3937: edouard@3937: // Get a new request. edouard@3937: RequestContext request = m_clientManager->createRequest(false); edouard@3937: edouard@3937: // Encode the request. edouard@3937: Codec * codec = request.getCodec(); edouard@3937: edouard@3937: if (codec == NULL) edouard@3937: { edouard@3937: err = kErpcStatus_MemoryError; edouard@3937: } edouard@3937: else edouard@3937: { edouard@3937: codec->startWriteMessage(message_type_t::kInvocationMessage, m_serviceId, m_RepairPLCId, request.getSequence()); edouard@3937: edouard@3937: // Send message to server edouard@3937: // Codec status is checked inside this function. edouard@3937: m_clientManager->performRequest(request); edouard@3937: edouard@3937: codec->read(result); edouard@3937: edouard@3937: err = codec->getStatus(); edouard@3937: } edouard@3937: edouard@3937: // Dispose of the request. edouard@3937: m_clientManager->releaseRequest(request); edouard@3937: edouard@3937: // Invoke error handler callback function edouard@3937: m_clientManager->callErrorHandler(err, m_RepairPLCId); edouard@3937: edouard@3937: #if ERPC_PRE_POST_ACTION edouard@3937: pre_post_action_cb postCB = m_clientManager->getPostCB(); edouard@3937: if (postCB) edouard@3937: { edouard@3937: postCB(); edouard@3937: } edouard@3937: #endif edouard@3937: edouard@3937: edouard@3937: if (err != kErpcStatus_Success) edouard@3937: { edouard@3937: result = 0xFFFFFFFFU; edouard@3937: } edouard@3937: edouard@3937: return result; edouard@3937: } edouard@3937: edouard@3937: // BeremizPLCObjectService interface ResetLogCount function client shim. edouard@3937: uint32_t BeremizPLCObjectService_client::ResetLogCount(void) edouard@3937: { edouard@3937: erpc_status_t err = kErpcStatus_Success; edouard@3937: edouard@3937: uint32_t result; edouard@3937: edouard@3937: #if ERPC_PRE_POST_ACTION edouard@3937: pre_post_action_cb preCB = m_clientManager->getPreCB(); edouard@3937: if (preCB) edouard@3937: { edouard@3937: preCB(); edouard@3937: } edouard@3937: #endif edouard@3937: edouard@3937: // Get a new request. edouard@3937: RequestContext request = m_clientManager->createRequest(false); edouard@3937: edouard@3937: // Encode the request. edouard@3937: Codec * codec = request.getCodec(); edouard@3937: edouard@3937: if (codec == NULL) edouard@3937: { edouard@3937: err = kErpcStatus_MemoryError; edouard@3937: } edouard@3937: else edouard@3937: { edouard@3937: codec->startWriteMessage(message_type_t::kInvocationMessage, m_serviceId, m_ResetLogCountId, request.getSequence()); edouard@3937: edouard@3937: // Send message to server edouard@3937: // Codec status is checked inside this function. edouard@3937: m_clientManager->performRequest(request); edouard@3937: edouard@3937: codec->read(result); edouard@3937: edouard@3937: err = codec->getStatus(); edouard@3937: } edouard@3937: edouard@3937: // Dispose of the request. edouard@3937: m_clientManager->releaseRequest(request); edouard@3937: edouard@3937: // Invoke error handler callback function edouard@3937: m_clientManager->callErrorHandler(err, m_ResetLogCountId); edouard@3937: edouard@3937: #if ERPC_PRE_POST_ACTION edouard@3937: pre_post_action_cb postCB = m_clientManager->getPostCB(); edouard@3937: if (postCB) edouard@3937: { edouard@3937: postCB(); edouard@3937: } edouard@3937: #endif edouard@3937: edouard@3937: edouard@3937: if (err != kErpcStatus_Success) edouard@3937: { edouard@3937: result = 0xFFFFFFFFU; edouard@3937: } edouard@3937: edouard@3937: return result; edouard@3937: } edouard@3937: edouard@3937: // BeremizPLCObjectService interface SeedBlob function client shim. edouard@3937: uint32_t BeremizPLCObjectService_client::SeedBlob(const binary_t * seed, binary_t * blobID) edouard@3937: { edouard@3937: erpc_status_t err = kErpcStatus_Success; edouard@3937: edouard@3937: uint32_t result; edouard@3937: edouard@3937: #if ERPC_PRE_POST_ACTION edouard@3937: pre_post_action_cb preCB = m_clientManager->getPreCB(); edouard@3937: if (preCB) edouard@3937: { edouard@3937: preCB(); edouard@3937: } edouard@3937: #endif edouard@3937: edouard@3937: // Get a new request. edouard@3937: RequestContext request = m_clientManager->createRequest(false); edouard@3937: edouard@3937: // Encode the request. edouard@3937: Codec * codec = request.getCodec(); edouard@3937: edouard@3937: if (codec == NULL) edouard@3937: { edouard@3937: err = kErpcStatus_MemoryError; edouard@3937: } edouard@3937: else edouard@3937: { edouard@3937: codec->startWriteMessage(message_type_t::kInvocationMessage, m_serviceId, m_SeedBlobId, request.getSequence()); edouard@3937: edouard@3937: write_binary_t_struct(codec, seed); edouard@3937: edouard@3937: // Send message to server edouard@3937: // Codec status is checked inside this function. edouard@3937: m_clientManager->performRequest(request); edouard@3937: edouard@3937: read_binary_t_struct(codec, blobID); edouard@3937: edouard@3937: codec->read(result); edouard@3937: edouard@3937: err = codec->getStatus(); edouard@3937: } edouard@3937: edouard@3937: // Dispose of the request. edouard@3937: m_clientManager->releaseRequest(request); edouard@3937: edouard@3937: // Invoke error handler callback function edouard@3937: m_clientManager->callErrorHandler(err, m_SeedBlobId); edouard@3937: edouard@3937: #if ERPC_PRE_POST_ACTION edouard@3937: pre_post_action_cb postCB = m_clientManager->getPostCB(); edouard@3937: if (postCB) edouard@3937: { edouard@3937: postCB(); edouard@3937: } edouard@3937: #endif edouard@3937: edouard@3937: edouard@3937: if (err != kErpcStatus_Success) edouard@3937: { edouard@3937: result = 0xFFFFFFFFU; edouard@3937: } edouard@3937: edouard@3937: return result; edouard@3937: } edouard@3937: edouard@3937: // BeremizPLCObjectService interface SetTraceVariablesList function client shim. edouard@3941: uint32_t BeremizPLCObjectService_client::SetTraceVariablesList(const list_trace_order_1_t * orders, int32_t * debugtoken) edouard@3937: { edouard@3937: erpc_status_t err = kErpcStatus_Success; edouard@3937: edouard@3937: uint32_t result; edouard@3937: edouard@3937: #if ERPC_PRE_POST_ACTION edouard@3937: pre_post_action_cb preCB = m_clientManager->getPreCB(); edouard@3937: if (preCB) edouard@3937: { edouard@3937: preCB(); edouard@3937: } edouard@3937: #endif edouard@3937: edouard@3937: // Get a new request. edouard@3937: RequestContext request = m_clientManager->createRequest(false); edouard@3937: edouard@3937: // Encode the request. edouard@3937: Codec * codec = request.getCodec(); edouard@3937: edouard@3937: if (codec == NULL) edouard@3937: { edouard@3937: err = kErpcStatus_MemoryError; edouard@3937: } edouard@3937: else edouard@3937: { edouard@3937: codec->startWriteMessage(message_type_t::kInvocationMessage, m_serviceId, m_SetTraceVariablesListId, request.getSequence()); edouard@3937: edouard@3937: write_list_trace_order_1_t_struct(codec, orders); edouard@3937: edouard@3937: // Send message to server edouard@3937: // Codec status is checked inside this function. edouard@3937: m_clientManager->performRequest(request); edouard@3937: edouard@3937: codec->read(*debugtoken); edouard@3937: edouard@3937: codec->read(result); edouard@3937: edouard@3937: err = codec->getStatus(); edouard@3937: } edouard@3937: edouard@3937: // Dispose of the request. edouard@3937: m_clientManager->releaseRequest(request); edouard@3937: edouard@3937: // Invoke error handler callback function edouard@3937: m_clientManager->callErrorHandler(err, m_SetTraceVariablesListId); edouard@3937: edouard@3937: #if ERPC_PRE_POST_ACTION edouard@3937: pre_post_action_cb postCB = m_clientManager->getPostCB(); edouard@3937: if (postCB) edouard@3937: { edouard@3937: postCB(); edouard@3937: } edouard@3937: #endif edouard@3937: edouard@3937: edouard@3937: if (err != kErpcStatus_Success) edouard@3937: { edouard@3937: result = 0xFFFFFFFFU; edouard@3937: } edouard@3937: edouard@3937: return result; edouard@3937: } edouard@3937: edouard@3937: // BeremizPLCObjectService interface StartPLC function client shim. edouard@3937: uint32_t BeremizPLCObjectService_client::StartPLC(void) edouard@3937: { edouard@3937: erpc_status_t err = kErpcStatus_Success; edouard@3937: edouard@3937: uint32_t result; edouard@3937: edouard@3937: #if ERPC_PRE_POST_ACTION edouard@3937: pre_post_action_cb preCB = m_clientManager->getPreCB(); edouard@3937: if (preCB) edouard@3937: { edouard@3937: preCB(); edouard@3937: } edouard@3937: #endif edouard@3937: edouard@3937: // Get a new request. edouard@3937: RequestContext request = m_clientManager->createRequest(false); edouard@3937: edouard@3937: // Encode the request. edouard@3937: Codec * codec = request.getCodec(); edouard@3937: edouard@3937: if (codec == NULL) edouard@3937: { edouard@3937: err = kErpcStatus_MemoryError; edouard@3937: } edouard@3937: else edouard@3937: { edouard@3937: codec->startWriteMessage(message_type_t::kInvocationMessage, m_serviceId, m_StartPLCId, request.getSequence()); edouard@3937: edouard@3937: // Send message to server edouard@3937: // Codec status is checked inside this function. edouard@3937: m_clientManager->performRequest(request); edouard@3937: edouard@3937: codec->read(result); edouard@3937: edouard@3937: err = codec->getStatus(); edouard@3937: } edouard@3937: edouard@3937: // Dispose of the request. edouard@3937: m_clientManager->releaseRequest(request); edouard@3937: edouard@3937: // Invoke error handler callback function edouard@3937: m_clientManager->callErrorHandler(err, m_StartPLCId); edouard@3937: edouard@3937: #if ERPC_PRE_POST_ACTION edouard@3937: pre_post_action_cb postCB = m_clientManager->getPostCB(); edouard@3937: if (postCB) edouard@3937: { edouard@3937: postCB(); edouard@3937: } edouard@3937: #endif edouard@3937: edouard@3937: edouard@3937: if (err != kErpcStatus_Success) edouard@3937: { edouard@3937: result = 0xFFFFFFFFU; edouard@3937: } edouard@3937: edouard@3937: return result; edouard@3937: } edouard@3937: edouard@3937: // BeremizPLCObjectService interface StopPLC function client shim. edouard@3937: uint32_t BeremizPLCObjectService_client::StopPLC(bool * success) edouard@3937: { edouard@3937: erpc_status_t err = kErpcStatus_Success; edouard@3937: edouard@3937: uint32_t result; edouard@3937: edouard@3937: #if ERPC_PRE_POST_ACTION edouard@3937: pre_post_action_cb preCB = m_clientManager->getPreCB(); edouard@3937: if (preCB) edouard@3937: { edouard@3937: preCB(); edouard@3937: } edouard@3937: #endif edouard@3937: edouard@3937: // Get a new request. edouard@3937: RequestContext request = m_clientManager->createRequest(false); edouard@3937: edouard@3937: // Encode the request. edouard@3937: Codec * codec = request.getCodec(); edouard@3937: edouard@3937: if (codec == NULL) edouard@3937: { edouard@3937: err = kErpcStatus_MemoryError; edouard@3937: } edouard@3937: else edouard@3937: { edouard@3937: codec->startWriteMessage(message_type_t::kInvocationMessage, m_serviceId, m_StopPLCId, request.getSequence()); edouard@3937: edouard@3937: // Send message to server edouard@3937: // Codec status is checked inside this function. edouard@3937: m_clientManager->performRequest(request); edouard@3937: edouard@3937: codec->read(*success); edouard@3937: edouard@3937: codec->read(result); edouard@3937: edouard@3937: err = codec->getStatus(); edouard@3937: } edouard@3937: edouard@3937: // Dispose of the request. edouard@3937: m_clientManager->releaseRequest(request); edouard@3937: edouard@3937: // Invoke error handler callback function edouard@3937: m_clientManager->callErrorHandler(err, m_StopPLCId); edouard@3937: edouard@3937: #if ERPC_PRE_POST_ACTION edouard@3937: pre_post_action_cb postCB = m_clientManager->getPostCB(); edouard@3937: if (postCB) edouard@3937: { edouard@3937: postCB(); edouard@3937: } edouard@3937: #endif edouard@3937: edouard@3937: edouard@3937: if (err != kErpcStatus_Success) edouard@3937: { edouard@3937: result = 0xFFFFFFFFU; edouard@3937: } edouard@3937: edouard@3937: return result; edouard@3937: }