@@ -159,6 +159,64 @@ uint32_t L2TestMocks::InvokeServiceMethod(const char *callsign, const char *meth
159
159
return status;
160
160
}
161
161
162
+ /* *
163
+ * @brief Invoke a service method
164
+ *
165
+ * @param[in] callsign Service callsign
166
+ * @param[in] method Method name
167
+ * @param[in] params Method parameters
168
+ * @param[out] results Method results
169
+ * @return Zero (Core::ERROR_NONE) on succes or another value on error
170
+ */
171
+ uint32_t L2TestMocks::InvokeServiceMethod (const char *callsign, const char *method, JsonObject ¶ms, Core::JSON::String &results)
172
+ {
173
+
174
+ JSONRPC::LinkType<Core::JSON::IElement> jsonrpc (std::string (callsign), TEST_CALLSIGN);
175
+ std::string message;
176
+ std::string reply;
177
+ uint32_t status = Core::ERROR_NONE;
178
+
179
+ params.ToString (message);
180
+ TEST_LOG (" Invoking %s.%s, parameters %s\n " , callsign, method, message.c_str ());
181
+
182
+ status = jsonrpc.Invoke <JsonObject, Core::JSON::String>(INVOKE_TIMEOUT, std::string (method), params, results);
183
+
184
+ results.ToString (reply);
185
+ TEST_LOG (" Status %u, results %s" , status, reply.c_str ());
186
+
187
+ return status;
188
+
189
+ }
190
+
191
+ /* *
192
+ * @brief Invoke a service method
193
+ *
194
+ * @param[in] callsign Service callsign
195
+ * @param[in] method Method name
196
+ * @param[in] params Method parameters
197
+ * @param[out] results Method results with string format
198
+ * @return Zero (Core::ERROR_NONE) on succes or another value on error
199
+ */
200
+ uint32_t L2TestMocks::InvokeServiceMethod (const char *callsign, const char *method, JsonObject ¶ms, Core::JSON::Boolean &results)
201
+ {
202
+
203
+ JSONRPC::LinkType<Core::JSON::IElement> jsonrpc (std::string (callsign), TEST_CALLSIGN);
204
+ std::string message;
205
+ std::string reply;
206
+ uint32_t status = Core::ERROR_NONE;
207
+
208
+ params.ToString (message);
209
+ TEST_LOG (" Invoking %s.%s, parameters %s\n " , callsign, method, message.c_str ());
210
+
211
+ status = jsonrpc.Invoke <JsonObject, Core::JSON::Boolean>(INVOKE_TIMEOUT, std::string (method), params, results);
212
+
213
+ results.ToString (reply);
214
+ TEST_LOG (" Status %u, results %s" , status, reply.c_str ());
215
+
216
+ return status;
217
+
218
+ }
219
+
162
220
/* *
163
221
* @brief Invoke a service method
164
222
*
@@ -206,6 +264,23 @@ uint32_t L2TestMocks::InvokeServiceMethod(const char *callsign, const char *meth
206
264
results.ToString (reply);
207
265
TEST_LOG (" Status %u, results %s" , status, reply.c_str ());
208
266
267
+ return status;
268
+
269
+ }
270
+
271
+ uint32_t L2TestMocks::InvokeServiceMethod (const char *callsign, const char *method, Core::JSON::Double &results)
272
+ {
273
+ JSONRPC::LinkType<Core::JSON::IElement> jsonrpc (std::string (callsign), TEST_CALLSIGN);
274
+ std::string reply;
275
+ uint32_t status = Core::ERROR_NONE;
276
+
277
+ TEST_LOG (" Invoking %s.%s \n " , callsign, method);
278
+
279
+ status = jsonrpc.Invoke <void , Core::JSON::Double>(INVOKE_TIMEOUT, std::string (method), results);
280
+
281
+ results.ToString (reply);
282
+ TEST_LOG (" Status %u, results %s" , status, reply.c_str ());
283
+
209
284
return status;
210
285
}
211
286
0 commit comments