-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
43 changed files
with
998 additions
and
320 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Generated by erpcgen 1.7.4 on Wed Nov 4 11:07:47 2020. | ||
* | ||
* AUTOGENERATED - DO NOT EDIT | ||
*/ | ||
|
||
|
||
#if !defined(_rpc_system_h_) | ||
#define _rpc_system_h_ | ||
|
||
// Common types header file | ||
#include "rpc_system_header.h" | ||
|
||
/*! @brief rpc_system identifiers */ | ||
enum _rpc_system_ids | ||
{ | ||
krpc_system_service_id = 1, | ||
krpc_system_rpc_system_version_id = 1, | ||
krpc_system_rpc_system_ack_id = 2, | ||
}; | ||
|
||
#if defined(__cplusplus) | ||
extern "C" { | ||
#endif | ||
|
||
//! @name rpc_system | ||
//@{ | ||
char * rpc_system_version(void); | ||
|
||
uint8_t rpc_system_ack(uint8_t c); | ||
//@} | ||
|
||
#if defined(__cplusplus) | ||
} | ||
#endif | ||
|
||
#endif // _rpc_system_h_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
/* | ||
* Generated by erpcgen 1.7.4 on Wed Nov 4 11:07:47 2020. | ||
* | ||
* AUTOGENERATED - DO NOT EDIT | ||
*/ | ||
|
||
|
||
#include "erpc_client_manager.h" | ||
#include "erpc_port.h" | ||
#include "erpc_codec.h" | ||
extern "C" | ||
{ | ||
#include "rpc_system.h" | ||
// import callbacks declaration from other groups | ||
#include "rpc_ble_api.h" | ||
#include "rpc_ble_callback.h" | ||
#include "rpc_wifi_api.h" | ||
#include "rpc_wifi_callback.h" | ||
} | ||
|
||
#if 10704 != 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; | ||
|
||
|
||
// rpc_system interface rpc_system_version function client shim. | ||
char * rpc_system_version(void) | ||
{ | ||
erpc_status_t err = kErpcStatus_Success; | ||
|
||
char * 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, krpc_system_service_id, krpc_system_rpc_system_version_id, request.getSequence()); | ||
|
||
// Send message to server | ||
// Codec status is checked inside this function. | ||
g_client->performRequest(request); | ||
|
||
uint32_t return_len; | ||
char * return_local; | ||
codec->readString(&return_len, &return_local); | ||
result = (char *) erpc_malloc((return_len + 1) * sizeof(char)); | ||
if (result == NULL) | ||
{ | ||
codec->updateStatus(kErpcStatus_MemoryError); | ||
} | ||
else | ||
{ | ||
memcpy(result, return_local, return_len); | ||
(result)[return_len] = 0; | ||
} | ||
|
||
err = codec->getStatus(); | ||
} | ||
|
||
// Dispose of the request. | ||
g_client->releaseRequest(request); | ||
|
||
// Invoke error handler callback function | ||
g_client->callErrorHandler(err, krpc_system_rpc_system_version_id); | ||
|
||
return result; | ||
} | ||
|
||
// rpc_system interface rpc_system_ack function client shim. | ||
uint8_t rpc_system_ack(uint8_t c) | ||
{ | ||
erpc_status_t err = kErpcStatus_Success; | ||
|
||
uint8_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, krpc_system_service_id, krpc_system_rpc_system_ack_id, request.getSequence()); | ||
|
||
codec->write(c); | ||
|
||
// Send message to server | ||
// Codec status is checked inside this function. | ||
g_client->performRequest(request); | ||
|
||
codec->read(&result); | ||
|
||
err = codec->getStatus(); | ||
} | ||
|
||
// Dispose of the request. | ||
g_client->releaseRequest(request); | ||
|
||
// Invoke error handler callback function | ||
g_client->callErrorHandler(err, krpc_system_rpc_system_ack_id); | ||
|
||
if (err) | ||
{ | ||
return 0xFFU; | ||
} | ||
|
||
return result; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.