I am trying to enable events for SIU device like this:
LPWFSRESULT lpWfsResult;
WFSSIUENABLE commandData;
commandData.fwSensors[WFS_SIU_OPERATORSWITCH] = WFS_SIU_ENABLE_EVENT;
commandData.fwIndicators[WFS_SIU_OPENCLOSE] = WFS_SIU_ENABLE_EVENT;
HRESULT hResult = WFSExecute(hService, WFS_CMD_SIU_ENABLE_EVENTS, &commandData, 10000, &lpWfsResult);
cout << "Events enabled?:" << hResult << endl;
WFSFreeResult(lpWfsResult);
This works as expected (hResult = 0) in one of the test ATMs. However on another test ATM, this returns WFS_ERR_SIU_INVALID_PORT (-801).
As per the XFS doc, this means:
An attempt to set a port to a new value was invalid because the port does not exist or the port is pre-configured as an input port.
I don't really understand the document's description. Can someone explain why this status is returned and what should be done?
Thank you.
I think you need to initialize WFSSIUENABLE struct before WFSExecute. You are only setting values for Operator Switch and Open/close, but what about the others? Try to do a memset to set all the others to zero (WFS_SIU_NO_CHANGE):
memset( commandData, 0, sizeof( WFSSIUENABLE));
Another thing to do is to know whitch of the ports are available in this ATM asking first the SIU Capabilities. If you try to enable a Port not available in the ATM you have this error. Not all AMTs have the same ports available.