MCPcopy Create free account
hub / github.com/EmbeddedRPC/erpc / sendReceivedString

Function sendReceivedString

test/test_lists/test_lists_server_impl.cpp:195–213  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

193}
194
195list_string_1_t *sendReceivedString(const list_string_1_t *received_list)
196{
197 list_string_1_t *send_list = (list_string_1_t *)erpc_malloc(sizeof(list_string_1_t));
198 char *stringValue = (char *)" World!";
199 send_list->elementsCount = received_list->elementsCount;
200 char **list_s = send_list->elements = (char **)erpc_malloc(send_list->elementsCount * sizeof(char *));
201 char **list_r = received_list->elements;
202
203 for (uint32_t i = 0; i < send_list->elementsCount; ++i)
204 {
205 *list_s = (char *)erpc_malloc((strlen(*list_r) + strlen(stringValue) + 1) * sizeof(char));
206 strcpy(*list_s, *list_r);
207 strcat(*list_s, stringValue);
208 ++list_s;
209 ++list_r;
210 }
211
212 return send_list;
213}
214
215list_string_2_t *sendReceived2String(const list_string_2_t *received_list)
216{

Callers 4

sendReceivedStringMethod · 0.85
TESTFunction · 0.85
TESTFunction · 0.85

Calls 1

erpc_mallocFunction · 0.50

Tested by

no test coverage detected