variables
{
dword gMc; // global method call handle
}
on key 'e'
{
dword csi; // consumed Service Instance handle
dword mc; // method call
// open Application Endpoint
aep = AREthOpenLocalApplicationEndpoint(0x11, 50002);
csi = AREthCreateConsumedServiceInstance(aep,11,1);
// create method call
gMc = AREthCreateMethodCall(csi,31,"OnMethodResponse");
// set the two input parameters of the method and call the method
AREthSetValueDWord(gMc,"Member_value1",11);
AREthSetValueDWord(gMc,"Member_value2",22);
AREthCallMethod(gMc);
}
on key 'r'
{
// remove method call
AREthRemoveMethodCall(gMc);
}
void OnMethodResponse(dword methodCallHandle, dword messageResponseHandle )
{
dword res; // value of return parameter
// get the returned parameter values
res = AREthGetValueDWord(messageResponseHandle,"Result");
write("The method call returned value: %d",res);
}