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