cancel
Showing results for 
Search instead for 
Did you mean: 
Security Alert Log4j Security Vulnerability. Click here to know more.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to trigger C SDK service from another C SDK service?

grahadian
3-Visitor

How to trigger C SDK service from another C SDK service?

Hi all,

 

I have two services named 'StartRecording' and 'StopRecording' that I define in my C SDK. Both services are tied to remote thing "Recorder" in Thingworx composer.

 

In one of the use-cases, I want 'StartRecording' to trigger 'StopRecording' and another 'StartRecording' during the execution (it is coded in such a way that it won't make infinite loop). I code it this way:

 

twInfoTable * result = NULL;
twApi_InvokeService(TW_THING, "Recorder", "StopRecording", params, &result, -1, FALSE);
result = NULL;
twApi_InvokeService(TW_THING, "Recorder", "StartRecording", params, &result, -1, FALSE);

'params' is the input from the definition of 'StopRecording' and 'StartRecording'

 

When I do this, however, the execution stops until time out. Afterwards, it continues but the input is not passed. My question: Do you know where I do things wrongly? And is there any more efficient way to call C SDK service from another C SDK service?

 

Thank you in advance

0 REPLIES 0
Announcements