MS API Programmers Reference Manual
MS API Programmers Reference Manual
SiPass® integrated
MP2.85
2 Introduction ............................................................................................. 6
7 Code Samples........................................................................................55
7.1 SiPass integrated Management Station Test Program ........................... 55
7.2 Source Files ............................................................................................ 55
Disclaimer
Although reasonable care was taken in producing this manual, no responsibility is
accepted by Siemens or its agents or employees for the accuracy or safety of the
material contained herein. None of the equipment described in this guide is
suitable for use in an application where life or health depends on its correct
operation. Siemens reserves the right to vary the specifications, standards and
method of operation of any or all of the equipment described herein at any time
without notice to any party.
No liability can be assumed for direct or consequential losses and third-party
damages arising from the purchase of this product. In all cases, liability is limited to
the purchase price of the product.
The information contained herein was up to date at the time of publication. We
reserve the right to make subsequent changes to technical or organizational
details. Siemens assumes no liability for problems resulting from the use of this
manual.
The information contained in this document may be changed without prior notice.
Siemens reserves the right to publicize any such changes by issuing updated
versions or new editions.
Siemens Fire Safety & Security Products confers upon the purchaser the right to
use the software.
It is not permitted to reproduce this manual in whole or in part or translate it into
another language without our written consent.
Contacting us
If you have questions or suggestions regarding the product or this documentation,
please contact your local SiPass integrated representative.
• A new MS-API EPointOpMode enum value has been added to support the new
Input Point Operation Mode - Door Frame Held Only.
The new EPointOpMode enum is eInpDCHeldOnlyMode = 122
Note: The RESTful MS-API utilizes the above for which, the RESTful MS-API
Object Model content has been updated.
• A new error code has been added to Appendix A: Error Codes table for a
message shown in SiPass integrated Configuration and Operation Clients when
Remote SQL service is stopped:
o ADV_E_SQL_STATUS_OFFLINE
7
Smart Infrastructure A-100026-1
3.2 MP2.76 SP2 to MP2.80
• To incorporate MS-API login to WCF service, new sample config files are
available, along with updated instructions in section 5.
• Enhancement to support MFI controller
o New ESubType “eMFI = 4024”
o New EDoorSetType enumerations:
▪ eMFI_2Single_0Dual = 36, // MFI 2 Single Reader Doors
▪ eMFI_4Single_0Dual = 37, // MFI 4 Single Reader Doors
▪ eMFI_0Single_2Dual = 38, // MFI 2 Dual Reader Doors
▪ eMFI_0Single_4Dual = 39, // MFI 4 Dual Reader Doors
▪ eMFI_TS_2Single_0Dual = 40, // MFI 2 Turnstiles, Single DC
▪ eMFI_TS_0Single_2Dual = 41, // MFI 2 Turnstiles, Dual DC
▪ eMFI_IO_Only = 42, // MFI I/O Only (No doors)
• Two new device object states (enums) have been added to EObjState:
eDeviceOnlineStandardComms, eDeviceOnlineLegacyComms
The described methods throughout this document will not change except under exceptional
circumstances, where clear notice will be provided. However, undocumented methods may be subject
to change without any prior notice
11
Smart Infrastructure A-100026-1
4.1 Object Model Overview
Object Description
Point Provides point information about points in the system: includes input
points, output points and access points.
Generic Event Contains the base properties that apply to all events and the
information that can be displayed in the audit trail.
Access Event In addition to the generic and state information it provides access
point specific event information.
13
Smart Infrastructure A-100026-1
Using the API
5 Using the API
This chapter and the next describe each object in detail and explain how to access
SiPass integrated data using the object model.
Note: If SiPass integrated has been installed with the high security option, the MS-
API Client can connect to the SiPass integrated server ONLY AS LOCAL client (on
Server site). See the SiPass integrated Installation Manual for more information.
Visual Studio 2015 (or later versions) can be used with .NET 4.8
for development as follows:
1. Open the Add References dialog and select the COM tab.
If SiPass integrated client has previously been installed, you will find an entry
called “COMClientAPI 1.0 Type Library”. Add this to your Management Station
API project.
2. Right-click the project in Solution Explorer and select Add Existing Item.
3. Add all the following files, which should exist in your SiPass integrated
installation folder:
a. behaviors.config
b. bindings.config
c. clients.config
d. extensions.config
e. ClientsShared.config
f. Si.Common.dll
g. Si.WcfClientServiceFactory.dll
h. Si.WcfServices.Interfaces.dll
i. SiPass.ClientServices.Interfaces.dll
j. SiPass.Common.dll
k. SiPass.Exception.dll
l. SiPass.Interfaces.dll
m. SiPass.WcfCoreServices.dll
n. WsSharedTypes.dll
o. Common.dll
p. Common.Logging.Interop.dll
q. Common.Unmanaged.dll
r. log4net.dll
s. Si.ClientServiceFactory.dll
t. SiPass.ClientServiceFactory.dll
4. For each of the newly added DLLs and config files above, ensure that the
property Build Action is set to Content, and the property Copy to Output
Directory is set to Copy Always.
5. Ensure the project's Platform Type is set to x86, since we are referencing
32-bit COM components.
6. Modify your Management Station Application configuration file by
following the template of the ms_api_sample_app.exe.config file available in
the SiPass integrated installation directory.
15
Smart Infrastructure A-100026-1
Using the API
5.2 Enumerator Explanation
Here is an explanation of the some of the less obvious enumerators used. The full
listing is available in the COMClientAPI.idl file. The COMClientAPI.idl file is
included with the Management Station Sample
As a general guide the Enumerators are written to match SiPass integrated
terminology and concepts as closely as possible. For any specific modes, states or
commands that you do not understand please refer to the SiPass integrated
Reference Manual and Audit Trail Manual.
Appendix B contains a list and descriptions of all the possible combinations of the
EObjType and ESubType enumerations
Enumerator Description
EDoorSetType The 15 possible states that describe the Door Set types.
The first part is the reader interface used, eg DRI, SRI, CX8,
NT8
The second part refers to the number of single and dual readers
that the door set reflects. Single refers to one reader per door,
whereas dual refers to two readers per door.
EObjState These states are grouped into the objects that they refer to. They
often match the audit trail messages generated when the states
are changed.
17
Smart Infrastructure A-100026-1
Object Reference
6 Object Reference
This section lists a description of each available object and its properties and
methods. A syntax and usage example can be found in each of the descriptions.
– Properties
EventMask ULONG The Event Mask settings determine what events are displayed in
the audit trail and which are ignored. The masks involve
changing the bits corresponding to what events you want set.
The Event Cache flag allows you to retrieve the audit trail from
SiPass integrated prior to logging in with your 3rd party
application. This needs to be set before connecting.
– Methods
Disconnect None Disconnects from SiPass integrated and logs the operator out.
ObjID The ID number of the object that the search is based on.
Note: If retrieving the status, using an ObjID value of 0 means
the status of all objects of specified type will be retrieved.
ERelation enum The relation between the objects that is required (child, parent or
value status)
EPrivLevel enum The privilege levels: View, Modify or Create. Not all levels are
value possible with all privileges (for example you cannot modify or
create alarms).
19
Smart Infrastructure A-100026-1
Object Reference
– Events
➔ Example
The basis for communication with the SiPass integrated server is the COMClient
object. This is the main class that provides access to all other objects. The sample
application creates an instance of the COMClient object and logon to the SiPass
integrated server before any other activities.
if(client.State == EClientState.eConnected)
{
// We are connected.
// Disconnect when finished.
client.Disconnect();
}
– Querying Objects
An object can be obtained by using the GetByID method of the COMClient object
as follows:
int objectID = 1;
EObjType type = EObjType.eBus;
– Alarm Notifications
Alarm notifications can be obtained via the OnAlarm event of the COMClient
object as follows:
client.OnAlarm += new _ _
_ICOMClientEvents_OnAlarmEventHandler(_client_OnAlarm);
}
else
{
// If already shown update alarm status,
// otherwise display alarm in alarm list.
}
}
21
Smart Infrastructure A-100026-1
Object Reference
– Properties
6.2.1 Example
The following example retrieves all objects configured in SiPass integrated and
displays the details for generic objects:
The Server Info object provides information about the SiPass integrated server.
The interface for this object is: IServer
All of its properties are inherited from the Generic object. They have been
reproduced here for convenience.
– Properties
6.3.1 Example
The following example shows the use of the Server Info object:
23
Smart Infrastructure A-100026-1
Object Reference
– Properties
6.4.1 Example
– Properties
6.5.1 Example
25
Smart Infrastructure A-100026-1
Object Reference
6.6 FLN Object
– Properties
6.6.1 Example
– Properties
DoorSet EDoorSetType The door set combination. For example Dual Reader DRI
– Methods
6.7.1 Example
27
Smart Infrastructure A-100026-1
Object Reference
6.8 Hub Object
The Hub object provides information about the selected Hub.
The interface for this object is: IHUB
All of its properties are inherited from the Generic object. They have been
reproduced here for convenience.
– Properties
– Properties
6.9.1 Example
The following example shows how to use the Door Set object:
29
Smart Infrastructure A-100026-1
Object Reference
– Properties
6.10.1 Example
– Properties
Type
- eArea
SubType can be
- eIntrusionArea
- eSintonyIntrusionArea
- eSPCIntrusionArea
6.11.1 Example
31
Smart Infrastructure A-100026-1
Object Reference
6.12 Flag Object
The Flag object provides information about the selected Flag.
The interface for this object is: IFlag
Most of its properties are inherited from the Generic object. They have been
reproduced here for convenience.
– Properties
UnitName BSTR The name of the unit the flag belongs to.
Type
- eFlag
SubType
- eNoSubType
6.12.1 Example
UnitName BSTR The name of the unit the counter belongs to.
Type
- eCounter
SubType
- eNoSubType
6.13.1 Example
33
Smart Infrastructure A-100026-1
Object Reference
6.14 Timer Object
The Timer object provides information about the selected Timer.
The interface for this object is: ITimer
This object inherits all the properties of the Generic Event object which have been
reproduced here for convenience.
– Properties
UnitName BSTR The name of the unit the timer belongs to.
TimerMode ETimerMode The behaviour of the timer while running. See the chapter
'Enumerator Explanation' for a description of ETimerMode
values.
Type
- eTimer
SubType
- eNoSubType
6.14.1 Example
– Properties
Type
- eAPBCluster
SubType
- eGeneric
6.15.1 Example
The Following example shows how to use the Anti-Passback Cluster Object:
35
Smart Infrastructure A-100026-1
Object Reference
6.16 Anti-Passback Area
The APBArea object provides information about the selected Anti-Passback Area.
The interface for this object is: IAPBArea
This object inherits all the properties of the Generic Event object which have been
reproduced here for convenience.
– Properties
Type
- eAPBArea
SubType
- eHardAntiPassbackArea
- eSoftAntiPassbackArea
- eFailSoftAntiPassbackArea
- eTimedReEntryArea
- eNoAntiPassbackArea
6.16.1 Example
The Following example shows how to use the Anti-Passback Area Object:
– Properties
Type
– eBanks
SubType
– eBankGeneric - native banks
6.17.1 Example
37
Smart Infrastructure A-100026-1
Object Reference
6.18 External System Object
The External System object provides information about the selected external
system.
The interface for this object is: IExternalSystem
All of its properties are inherited from the Generic object. They have been
reproduced here for convenience.
– Properties
`
– Properties
– Properties
6.20.1 Example
39
Smart Infrastructure A-100026-1
Object Reference
if (objState.SubType == ESubType.eAPBAreaModeValue)
{
EAPBAreaMode apbMode = EAPBAreaMode.eAPBAreaUnknownMode;
apbMode = (EAPBAreaMode)objState.ValueState;
currentMode.Text = apbMode.ToString();
}
else if (objState.SubType == ESubType.eAPBAreaCounterValue)
areaCounter.Text = objState.ValueState.ToString();}
Note:
– If either or both of APBAreaState changes (APB area count change or APB area runtime mode
change) occur, then two subscription events are dispatched. One that contains the APB area count
value and another that contains the APB area runtime mode.
Object Reference
6.21 Alarm Class Object
The Alarm Class object provides information about the Alarm Classes in the
system and associated Instructions.
The interface for this object is: IAlarmClass
Most of its properties are inherited from the Generic object. They have been
reproduced here for convenience.
– Properties
Instruction BSTR The instructions for the operator to take when the alarm
appears.
6.21.1 Example
The following example shows how to use the Alarm Class object:
41
Smart Infrastructure A-100026-1
Object Reference
6.22 Generic Event Object
The Generic Event Object provides all the details about generic events in the
system. This information is displayed in the audit trail and is the basis for other
event reporting.
The interface for this object is: IGenericObj
The Generic Event object has the following properties:
– Properties
6.22.1 Example
Event notifications can be obtained via the OnEvent event of the COMClient
object as follows:
client.OnEvent+= new _
_ICOMClientEvents_OnEventEventHandler(_client_OnEvent);
if(eventObject is IDBEvent)
{
// Process database event
}
else if(eventObject is IAccessEvent)
{
// Process access event
}
else if(eventObject is IObjState)
{
// Process state change event
}
}
}
Object Reference
6.23 Database Event Object
The Database Event object provides all the details about database events in the
system. This information is displayed in the audit trail if the event mask is set to
display it.
The interface for this object is: IDBEvent
This object inherits all the properties of the Generic Event object which have been
reproduced here for convenience.
– Properties
6.23.1 Example
Database events can be received via the IDBEvent object. The event provides
information related to database changes on SiPass integrated objects.
Use this event to update alarms when an Alarm class is modified and to keep the
component tree up to date with changes in the server.
case ESubType.eDBModify:
// Modify new object in component tree.
break;
case ESubType.eDBDelete:
// Remove the object from the tree.
break;
default:
break;
}
}
43
Smart Infrastructure A-100026-1
Object Reference
6.24 State Object
The State object provides all the details about state events in the system. This
information is displayed in the audit trail if the event mask is set to display it.
The interface for this object is: IObjState
This object inherits all the properties of the Generic object which have been
reproduced here for convenience.
– Properties
StateType EStateType The state type of the object. It can be either Alarm or
Normal.
6.24.1 Example
timestamp.Text = objState.Timestamp.ToString();
location.Text = objState.Location;
description.Text = objState.Description;
}
}
Object Reference
The state of an object (or multiple objects) can be queried by using the the
GetRelatives method of the COMClient object as follows:
45
Smart Infrastructure A-100026-1
Object Reference
6.25 APB Area State Object
The APB Area State object provides all the details about APB Area state events in
the system. This information is displayed in the audit trail if the event mask is set to
display state events.
The APB Area State object is used in the API as there can be multiple states held
by an APB area simultaneously. Multiple simultaneous states are not represented
in a normal State Object.
The interface for this object is: IAPBAreaObjState. This interface extends the
IObjState interface.
This object inherits all the properties of the State object, and the following 3
properties available in IAPBAreaObjState:
– Properties
FourEyesState EObjState Four Eyes Alarm/Normal State of the APB Area. This
could be eAPBAreaFourEyesAccessAlarm or
eAPBAreaFourEyesAccessNormal.
WorkgroupCapacityState EObjState Workgroup Capacity state of the APB Area. This could
be any of the following EObjState enums:
• eAPBAreaWorkgroupCapacityFull
• eAPBAreaWorkgroupCapacityExceeded
• eAPBAreaWorkgroupCapacityNotFull
• eAPBAreaWorkgroupCapacityEmpty
• eAPBAreaWorkgroupCapacityNotEmpty
GeneralApbAreaState EObjState All other states of an APB Area, mostly general area
capacity states
6.25.1 Example
47
Smart Infrastructure A-100026-1
Object Reference
6.26 Access Event Object
The Access Event Object provides all the details about access events in the
system. This information is displayed in the audit trail if the event mask is set to
display it.
The interface for this object is: IAccessEvent
This object inherits all the properties of the State object which have been
reproduced here for convenience.
– Properties
FirstName BSTR The First Name of the cardholder from the access
event.
LastName BSTR The Last Name of the cardholder from the access
event.
6.26.1 Example
The following example shows how to use the Access Event object:
if(eventObject is IAccessEvent)
{
IAccessEvent accessEvent = (IAccessEvent)eventObject;
Console.WriteLine("CardNumber:{0} CardTech:{1} Facility:{2}
FirstName:{3} LastName:{4}", accessEvent.CardNumber,
accessEvent.CardTech, accessEvent.Facility,
accessEvent.FirstName, accessEvent.LastName);
}
Object Reference
6.27 Alarm Object
The Alarm Object provides all the details about alarm events in the system. This
information is displayed in the audit trail if the event mask is set to display it.
The interface for this object is: IAlarm
This object inherits all the properties of the Generic Event object which have been
reproduced here for convenience.
– Properties
Count LONG The number of alarms triggered for this alarm event.
State EAlarmState The state of the alarm. States can be unknown, active, actioned,
restored, reactivated (after time), and normal.
AlarmClassID LONG The ID of the alarm class assosciated with this alarm.
6.27.1 Example
49
Smart Infrastructure A-100026-1
Object Reference
6.28 Alarm Action Object
The Alarm Action object is used by the operator to send an alarm
acknowledgement to the SiPass server.
The interface for this object is: IAlarmAction
– Properties
Action BSTR The alarm action description input by the operator. The maximum
supported length is 255 characters
6.28.1 Example
Alarm acknowledgments can be sent to the client via the Process method of the
COMClient object as follows:
action.Action = "Action";
action.AlarmID = Alarm.EventID();
3. Send acknowledgement.
client.Process(action);
Object Reference
6.29 Manual Command Object
The “Manual Command” Object allows the operator to send manual commands via
the Management Station API. These commands are processed by the client object.
The interface for this object is: IManualCommand
– Properties
ObjectID LONG The ID number associated with the object that is receiving the
command.
ObjectType EObjType The type of the object that is receiving the command.
6.29.1 Example
The following example shows how to use the Manual Command object:
Manual commands can be sent to the client via the Process method of the
COMClient object as follows:
2. Specify the command type, object id, object type and any optional arguments.
manualCommand.Command = ECommand.eOutAllowAccess;
manualCommand.ObjectID = objectID;
manualCommand.ObjectType = type;
3. Send command.
client.Process(manualCommand);
51
Smart Infrastructure A-100026-1
Object Reference
6.30 OSS-SO Sites Object
The “OSSSOSites” object provides information about the selected OSS-SO Sites
parent object.
The interface for this object is: IOSSSOSites
This object inherits all the properties of the Generic Event object which have been
reproduced here for convenience.
– Properties
– Type
eOSSSOSites
– SubType
eGeneric
Object Reference
6.31 OSS-SO Site Object
The “OSSSOSite” object provides information about the selected single OSS-SO
Site object.
The interface for this object is: IOSSSOSite
This object inherits all the properties of the Generic Event object which have been
reproduced here for convenience
– Properties
– Type
eOSSSOSite
– SubType
eNoSubType
53
Smart Infrastructure A-100026-1
Object Reference
6.32 OSS-SO Reader Object
The “OSSSOReader” object provides information about the selected
OSSSOReader object.
The interface for this object is: IOSSSOReader
This object inherits all the properties of the Generic Event object which have been
reproduced here for convenience
– Properties
– Type
eOSSSOReader
– SubType
eNoSubType
Code Samples
7 Code Samples
This section introduces a working application which uses the Management Station
API. The executable files and code samples supplied are in the form of Microsoft
Visual C#
Note:
– SiPass integrated must be installed on the computers on which you want to run the sample
application
The source for the sample application is available in the SiPass integrated API
and RESTful API folder in the SiPass integrated Software bundle.
55
Smart Infrastructure A-100026-1
8 Appendix A: Error Codes
The Management Station API can generate the following errors:
Name Value Description
ADV_E_USER_NAME 0x80040A01 Invalid username
ADV_E_PASSWORD 0x80040A02 Invalid password
ADV_E_LOCKOUT 0x80040A05 Operator lockout
ADV_E_RETRIES_EXCEEDED 0x80040A06 Operator exceeded allowed number of
incorrect logon attempts
ADV_E_EXPIRED 0x80040A07 Operator account expired
ADV_E_INTERVAL 0x80040A08 Operator not allowed to logon at this time
ADV_E_TOO_MANY_CLIENTS 0x80040A0B Too many workstations logged on
ADV_E_SELECT 0x80040A0D Database query error
ADV_E_FETCH 0x80040A0E Error in SQL fetch, no results
ADV_E_NO_LOGON 0x80040A0F No logon was performed
ADV_E_REQUIRED_LICENSE_MANAPI 0x80040A2E MS-API License is required
ADV_E_WRONG_VERSION 0x80040A2F Client/Server version mismatch
ADV_E_PASSWORD_EXPIRED 0x80040A30 Operator password expired
ADV_E_TEMPORARY_LOCKOUT 0x80040A31 Operator temporary lockout
ADV_E_RETRIES_EXCEEDED_TEMPORARY 0x80040A35 Operator exceeded allowed number of
incorrect logon attempts, and account is
temporarily locked.
ADV_E_PASSWORD_OLD_VERSION 0x80040A37 Old password version found in database.
Previous conversion probably failed.
ADV_E_CLIENT_NEEDS_UPDATE 0x80040A62 Client needs to be updated due to server
hotfix
ADV_W_NEW_CLIENT_HF_AVAILABLE 0x80040A63 New client hotfix is available
ADV_E_SQL_STATUS_OFFLINE 0x80040A71 The SiPass integrated server could not
establish a connection with SQL server
E_CCA_RANGE_START 0x80040C00 Start of Error Code Range. Not reported
during operation.
E_CCA_READ_CONFIG 0x80040C01 Error whilst trying to read the configuration
from the registry.
E_CCA_EVENT_HANDLER 0x80040C02 Error setting up the Audit Trail and Event
Handler.
E_CCA_NOT_CONNECTED 0x80040C03 Attempting to perform any operation when
the client is not yet connected or has been
disconnected.
E_CCA_INVALID_TYPE 0x80040C04 An operation has been attempted on a
type that does not support that action.
E_CCA_INVALID_CMD 0x80040C05 An invalid or erroneous manual command
was sent..
E_CCA_CMD_FAILED 0x80040C06 Manual command failed.
E_CCA_NO_PRIV 0x80040C07 Current operator does not have the
privileges to execute that command.
Appendix A: Error Codes
In addition, there are various Microsoft RPC and COM system error codes that can
be reported during runtime that are not SiPass specific. The most common ones
that may be encountered are listed below
For more information on various system error codes see these links:
COM system error codes
https://docs.microsoft.com/en-us/windows/desktop/com/com-error-codes-1
57
Smart Infrastructure A-100026-1
Appendix B: Enumeration Definitions
eDBEvent
eDBCreate Database event where an object was
created
eDBModify Database event where an object was
modified (e.g. name change)
eDBDelete Database event where an object was
deleted
59
Smart Infrastructure A-100026-1
Appendix B: Enumeration Definitions