Skip to content

Commit c313d54

Browse files
authored
Return back missing g_client variable. (#312)
Signed-off-by: Cervenka Dusan <[email protected]> Signed-off-by: Cervenka Dusan <[email protected]>
1 parent 68963ab commit c313d54

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

erpc_c/setup/erpc_arbitrated_client_setup.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ using namespace erpc;
3131

3232
// global client variables
3333
ERPC_MANUALLY_CONSTRUCTED_STATIC(ArbitratedClientManager, s_client);
34+
ClientManager *g_client;
35+
#pragma weak g_client
36+
3437
ERPC_MANUALLY_CONSTRUCTED_STATIC(BasicCodecFactory, s_codecFactory);
3538
ERPC_MANUALLY_CONSTRUCTED_STATIC(TransportArbitrator, s_arbitrator);
3639
ERPC_MANUALLY_CONSTRUCTED_STATIC(BasicCodec, s_codec);
@@ -143,6 +146,8 @@ erpc_client_t erpc_arbitrated_client_init(erpc_transport_t transport, erpc_mbf_t
143146
*arbitrator = reinterpret_cast<erpc_transport_t>(transportArbitrator);
144147
}
145148

149+
g_client = dynamic_cast<ClientManager *>(client);
150+
146151
return reinterpret_cast<erpc_client_t>(client);
147152
}
148153

erpc_c/setup/erpc_client_setup.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ using namespace erpc;
2929

3030
// global client variables
3131
ERPC_MANUALLY_CONSTRUCTED_STATIC(ClientManager, s_client);
32+
ClientManager *g_client;
33+
#pragma weak g_client
3234
ERPC_MANUALLY_CONSTRUCTED_STATIC(BasicCodecFactory, s_codecFactory);
3335
ERPC_MANUALLY_CONSTRUCTED_STATIC(Crc16, s_crc16);
3436

@@ -103,6 +105,8 @@ erpc_client_t erpc_client_init(erpc_transport_t transport, erpc_mbf_t message_bu
103105
client->setMessageBufferFactory(reinterpret_cast<MessageBufferFactory *>(message_buffer_factory));
104106
}
105107

108+
g_client = client;
109+
106110
return reinterpret_cast<erpc_client_t>(client);
107111
}
108112

0 commit comments

Comments
 (0)