代码拉取完成,页面将自动刷新
同步操作将从 10km/erpcdemo 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
/* 定义项目名称,也是所有生成的源码文件名前缀 */
/*
* Generated by erpcgen 1.7.3 on Sat Apr 18 09:33:42 2020.
*
* AUTOGENERATED - DO NOT EDIT
*/
#include "erpc_client_manager.h"
#include "erpc_port.h"
#include "erpc_codec.h"
extern "C"
{
#include "erpcdemo.h"
}
#if 10703 != ERPC_VERSION_NUMBER
#error "The generated shim code version is different to the rest of eRPC code."
#endif
using namespace erpc;
using namespace std;
extern ClientManager *g_client;
//! @brief Function to write struct binary_t
static void write_binary_t_struct(erpc::Codec * codec, const binary_t * data);
// Write struct binary_t function implementation
static void write_binary_t_struct(erpc::Codec * codec, const binary_t * data)
{
codec->writeBinary(data->dataLength, data->data);
}
//! @brief Function to read struct binary_t
static void read_binary_t_struct(erpc::Codec * codec, binary_t * data);
// Read struct binary_t function implementation
static void read_binary_t_struct(erpc::Codec * codec, binary_t * data)
{
uint8_t * data_local;
codec->readBinary(&data->dataLength, &data_local);
data->data = (uint8_t *) erpc_malloc(data->dataLength * sizeof(uint8_t));
if (data->data == NULL)
{
codec->updateStatus(kErpcStatus_MemoryError);
}
else
{
memcpy(data->data, data_local, data->dataLength);
}
}
// DEMO interface RD_demoHello function client shim.
binary_t * RD_demoHello(const binary_t * txInput)
{
erpc_status_t err = kErpcStatus_Success;
binary_t * result = NULL;
// Get a new request.
RequestContext request = g_client->createRequest(false);
// Encode the request.
Codec * codec = request.getCodec();
if (codec == NULL)
{
err = kErpcStatus_MemoryError;
}
else
{
codec->startWriteMessage(kInvocationMessage, kDEMO_service_id, kDEMO_RD_demoHello_id, request.getSequence());
write_binary_t_struct(codec, txInput);
// Send message to server
// Codec status is checked inside this function.
g_client->performRequest(request);
result = (binary_t *) erpc_malloc(sizeof(binary_t));
if (result == NULL)
{
codec->updateStatus(kErpcStatus_MemoryError);
}
read_binary_t_struct(codec, result);
err = codec->getStatus();
}
// Dispose of the request.
g_client->releaseRequest(request);
// Invoke error handler callback function
g_client->callErrorHandler(err, kDEMO_RD_demoHello_id);
return result;
}
// DEMO interface RD_demoHello2 function client shim.
lockErrors_t RD_demoHello2(const binary_t * txInput, binary_t * txOutput)
{
erpc_status_t err = kErpcStatus_Success;
lockErrors_t result;
// Get a new request.
RequestContext request = g_client->createRequest(false);
// Encode the request.
Codec * codec = request.getCodec();
if (codec == NULL)
{
err = kErpcStatus_MemoryError;
}
else
{
codec->startWriteMessage(kInvocationMessage, kDEMO_service_id, kDEMO_RD_demoHello2_id, request.getSequence());
write_binary_t_struct(codec, txInput);
// Send message to server
// Codec status is checked inside this function.
g_client->performRequest(request);
int32_t _tmp_local;
read_binary_t_struct(codec, txOutput);
codec->read(&_tmp_local);
result = static_cast<lockErrors_t>(_tmp_local);
err = codec->getStatus();
}
// Dispose of the request.
g_client->releaseRequest(request);
// Invoke error handler callback function
g_client->callErrorHandler(err, kDEMO_RD_demoHello2_id);
if (err)
{
return (lockErrors_t) -1;
}
return result;
}
// DEMO interface RD_demoHello3 function client shim.
lockErrors_t RD_demoHello3(const binary_t * txInput, int8_t txOutput[64], int32_t * size)
{
erpc_status_t err = kErpcStatus_Success;
lockErrors_t result;
// Get a new request.
RequestContext request = g_client->createRequest(false);
// Encode the request.
Codec * codec = request.getCodec();
if (codec == NULL)
{
err = kErpcStatus_MemoryError;
}
else
{
codec->startWriteMessage(kInvocationMessage, kDEMO_service_id, kDEMO_RD_demoHello3_id, request.getSequence());
write_binary_t_struct(codec, txInput);
// Send message to server
// Codec status is checked inside this function.
g_client->performRequest(request);
int32_t _tmp_local;
for (uint32_t arrayCount0 = 0; arrayCount0 < 64; ++arrayCount0)
{
codec->read(&txOutput[arrayCount0]);
}
codec->read(size);
codec->read(&_tmp_local);
result = static_cast<lockErrors_t>(_tmp_local);
err = codec->getStatus();
}
// Dispose of the request.
g_client->releaseRequest(request);
// Invoke error handler callback function
g_client->callErrorHandler(err, kDEMO_RD_demoHello3_id);
if (err)
{
return (lockErrors_t) -1;
}
return result;
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。