1211 result = 0xFFFFFFFFU; |
1211 result = 0xFFFFFFFFU; |
1212 } |
1212 } |
1213 |
1213 |
1214 return result; |
1214 return result; |
1215 } |
1215 } |
|
1216 |
|
1217 // BeremizPLCObjectService interface ExtendedCall function client shim. |
|
1218 uint32_t BeremizPLCObjectService_client::ExtendedCall(const char * method, const binary_t * argument, binary_t * answer) |
|
1219 { |
|
1220 erpc_status_t err = kErpcStatus_Success; |
|
1221 |
|
1222 uint32_t result; |
|
1223 |
|
1224 #if ERPC_PRE_POST_ACTION |
|
1225 pre_post_action_cb preCB = m_clientManager->getPreCB(); |
|
1226 if (preCB) |
|
1227 { |
|
1228 preCB(); |
|
1229 } |
|
1230 #endif |
|
1231 |
|
1232 // Get a new request. |
|
1233 RequestContext request = m_clientManager->createRequest(false); |
|
1234 |
|
1235 // Encode the request. |
|
1236 Codec * codec = request.getCodec(); |
|
1237 |
|
1238 if (codec == NULL) |
|
1239 { |
|
1240 err = kErpcStatus_MemoryError; |
|
1241 } |
|
1242 else |
|
1243 { |
|
1244 codec->startWriteMessage(message_type_t::kInvocationMessage, m_serviceId, m_ExtendedCallId, request.getSequence()); |
|
1245 |
|
1246 { |
|
1247 uint32_t method_len = strlen((const char*)method); |
|
1248 |
|
1249 codec->writeString(method_len, (const char*)method); |
|
1250 } |
|
1251 |
|
1252 write_binary_t_struct(codec, argument); |
|
1253 |
|
1254 // Send message to server |
|
1255 // Codec status is checked inside this function. |
|
1256 m_clientManager->performRequest(request); |
|
1257 |
|
1258 read_binary_t_struct(codec, answer); |
|
1259 |
|
1260 codec->read(result); |
|
1261 |
|
1262 err = codec->getStatus(); |
|
1263 } |
|
1264 |
|
1265 // Dispose of the request. |
|
1266 m_clientManager->releaseRequest(request); |
|
1267 |
|
1268 // Invoke error handler callback function |
|
1269 m_clientManager->callErrorHandler(err, m_ExtendedCallId); |
|
1270 |
|
1271 #if ERPC_PRE_POST_ACTION |
|
1272 pre_post_action_cb postCB = m_clientManager->getPostCB(); |
|
1273 if (postCB) |
|
1274 { |
|
1275 postCB(); |
|
1276 } |
|
1277 #endif |
|
1278 |
|
1279 |
|
1280 if (err != kErpcStatus_Success) |
|
1281 { |
|
1282 result = 0xFFFFFFFFU; |
|
1283 } |
|
1284 |
|
1285 return result; |
|
1286 } |