Open Core Interface - MLPI
MLPI-MotionLogicProgrammingInterface(mlpi4LabVIEW)  1.26.2
mlpiApiLib.h
Go to the documentation of this file.
1 #ifndef __MLPIAPILIB_H__
2 #define __MLPIAPILIB_H__
3 
4 // -----------------------------------------------------------------------
5 // MLPI - <mlpiApiLib.h>
6 // -----------------------------------------------------------------------
7 // Copyright (c) 2013 Bosch Rexroth. All rights reserved.
8 // Redistribution and use in source and binary forms of this MLPI software
9 // (SW) provided to you, with or without modification, are permitted
10 // without prior approval provided that the following conditions are met:
11 //
12 // 1. Redistributions of source code of SW must retain the above copyright
13 // notice, this list of conditions and the following disclaimer.
14 //
15 // 2. Redistributions in binary form of SW must reproduce the above copyright
16 // notice, this list of conditions and the following disclaimer in the
17 // documentation and/or other materials provided with the distribution.
18 //
19 // 3. User recognizes and acknowledges that it acquires no right,
20 // title or interest in or to any of the names or trademarks used in
21 // connection with the SW ("names") by virtue of this License and waives
22 // any right to or interest in the names. User recognizes and acknowledges
23 // that names of companies or names or products of companies displayed
24 // in the documentation of SW to indicate the interoperability of products
25 // with the SW are the names of their respective owners. The use of such
26 // names in the documentation of SW does not imply any sponsorship,
27 // approval, or endorsement by such companies of this product.
28 //
29 // 4. Modified code versions, i.e. any addition to or deletion from
30 // the substance or structure of the original code of the SW running
31 // the MLPI must be plainly marked as such and must not be misrepresented
32 // as being original SW.
33 //
34 // 5. The SW may only be used in connection with a Bosch Rexroth product.
35 //
36 // THIS INFORMATION IS PROVIDED BY BOSCH REXROTH CORPORATION "AS IS"
37 // AND WITHOUT WARRANTY OF ANY KIND, EXPRESSED OR IMPLIED, INCLUDING
38 // (BUT NOTLIMITED TO) ANY IMPLIED WARRANTIES OF MERCHANTABILITY,
39 // FITNESS FOR ANY PARTICULAR PURPOSE, OR NON-INFRINGEMENT. WHILE THE
40 // INFORMATION PROVIDED IS BELIEVED TO BE ACCURATE, IT MAY INCLUDE
41 // ERRORS OR INACCURACIES.
42 // SUBJECT TO COMPULSORY STATUTORY PROVISIONS OF THE GERMAN LAW AS
43 // THE APPLICABLE LAW FOR THIS LICENSE BOSCH REXROTH CORPORATION WILL
44 // NOT BE LIABLE FOR ANY DAMAGES OF ANY KIND ARISING FROM THE USE OF
45 // THE SOFTWARE DISTRIBUTED HEREUNDER, INCLUDING BUT NOT LIMITED TO
46 // DIRECT, INDIRECT, INCIDENTAL, PUNITIVE, AND CONSEQUENTIAL DAMAGES.
47 // -----------------------------------------------------------------------
48 //
58 //
59 // -----------------------------------------------------------------------
60 
61 
82 
90 
96 
171 
237 
242 
243 
244 // -----------------------------------------------------------------------
245 // GLOBAL INCLUDES
246 // -----------------------------------------------------------------------
247 #include "mlpiGlobal.h"
248 
249 
250 // -----------------------------------------------------------------------
251 // GLOBAL CONSTANTS
252 // -----------------------------------------------------------------------
253 #define MLPI_CONNECT_IDENT_LENGTH (1024)
254 #define MLPI_DEFAULTPORT (5300)
255 #define MLPI_DEFAULTSECUREPORT (5335)
256 #define MLPI_INFINITE (0xFFFFFFFF)
257 #define MLPI_TIMEOUT_OS (0)
258 #define MLPI_MAX_PAYLOAD (500000)
259 
260 #define MLPI_API_CONNECTION_NAME_LEN (128)
261 #define MLPI_API_CONNECTION_URI_LEN (128)
262 #define MLPI_API_CONNECTION_LABEL_LEN (254)
263 #define MLPI_API_CONNECTION_USER_LEN (128)
264 #define MLPI_API_CONNECTION_PWD_LEN (128)
265 
266 #define MLPI_API_LIBRARY_NAME_LEN (64)
267 
268 #define MLPI_API_MAX_NUMBER_OF_CONNECTIONS (50)
269 
270 static const WCHAR16 MLPI_LOCALHOST[] = {'L','O','C','A','L','H','O','S','T', '\0'};
271 static const WCHAR16 MLPI_ACCOUNT_EMPTY_NAME[] = {'_','A','C','C','O','U','N','T','_','E','M','P','T','Y','_','N','A','M','E','_','\0'};
272 
273 
274 // -----------------------------------------------------------------------
275 // GLOBAL ENUMERATIONS
276 // -----------------------------------------------------------------------
279 typedef enum MlpiApiProtection
280 {
285 
286 
287 // -----------------------------------------------------------------------
288 // GLOBAL TYPEDEFS
289 // -----------------------------------------------------------------------
290 
291 // message packing follows 8 byte natural alignment
292 #if !defined(TARGET_OS_VXWORKS)
293 #pragma pack(push,8)
294 #endif
295 
307 typedef struct MlpiConnectionInfo
308 {
309  DOUBLE minimum;
310  DOUBLE maximum;
311  DOUBLE average;
312  DOUBLE variance;
313  DOUBLE standardDeviation;
315 
333 typedef struct MlpiConnectionDescription
334 {
335  ULLONG uid;
340  MlpiDateAndTime dateTime;
341  ULONG requestCounter;
342  ULONG lastRequest;
343  MlpiApiProtection protection;
344  ULONG watchdog;
346 
355 typedef struct MlpiLibrary
356 {
358  ULONG id;
359 } MlpiLibrary;
360 
361 
362 #if !defined(TARGET_OS_VXWORKS)
363 #pragma pack(pop)
364 #endif
365 
367 
368 
369 // -----------------------------------------------------------------------
370 // GLOBAL EXPORTS
371 // -----------------------------------------------------------------------
372 #ifdef MLPI_API
373 #undef MLPI_API
374 #endif
375 
376 
377 #if defined(TARGET_OS_WINNT)
378 #if defined(MLPI_EXPORTS)
379 #define MLPI_API __declspec(dllexport)
380 #elif defined(MLPI_IMPORTS)
381 #define MLPI_API __declspec(dllimport)
382 #else
383 #define MLPI_API
384 #endif
385 #else
386 #if defined(MLPI_EXPORTS)
387 #define MLPI_API __attribute__ ((visibility("default")))
388 #elif defined(MLPI_IMPORTS)
389 #define MLPI_API
390 #else
391 #define MLPI_API
392 #endif
393 #endif
394 
395 
396 #ifdef __cplusplus
397 extern "C" {
398 #endif
399 
400 
575 MLPI_API MLPIRESULT mlpiApiConnect(const WCHAR16* connectionIdentifier, MLPIHANDLE* connection);
576 
577 
607 MLPI_API MLPIRESULT mlpiApiDisconnect(MLPIHANDLE *connection);
608 
609 
619 MLPI_API MLPIRESULT mlpiApiSetDefaultTimeout(const ULONG timeout);
620 
621 
627 MLPI_API MLPIRESULT mlpiApiGetDefaultTimeout(ULONG *timeout);
628 
629 
649 MLPI_API MLPIRESULT mlpiApiIsConnected(const MLPIHANDLE connection, BOOL8 *isConnected);
650 
651 
686 MLPI_API MLPIRESULT mlpiApiTestConnection(const MLPIHANDLE connection, const ULONG payload, const ULONG numMeasurements, MlpiConnectionInfo *info);
687 
688 
710 MLPI_API MLPIRESULT mlpiApiNotifyAlive(const MLPIHANDLE connection);
711 
712 
722 MLPI_API MLPIRESULT mlpiApiDelay(const MLPIHANDLE connection, const ULONG delayMilliseconds);
723 
724 
747 MLPI_API MLPIRESULT mlpiApiGetClientCoreVersion(MlpiVersion *versionInfo);
748 
749 
773 MLPI_API MLPIRESULT mlpiApiGetServerCoreVersion(const MLPIHANDLE connection, MlpiVersion *versionInfo);
774 
775 
792 MLPI_API MLPIRESULT mlpiApiSetNameOfConnection(const MLPIHANDLE connection, const WCHAR16 *name);
793 
794 
811 MLPI_API MLPIRESULT mlpiApiSetLabelOfConnection(const MLPIHANDLE connection, const WCHAR16 *label);
812 
813 
848 
849 
888 MLPI_API MLPIRESULT mlpiApiGetAllConnectionDescription(const MLPIHANDLE connection, MlpiConnectionDescription *description, const ULONG numElements, ULONG *numElementsRet);
889 
890 
911 MLPI_API MLPIRESULT mlpiApiCloseConnectionByUid(const MLPIHANDLE connection, const ULLONG uid);
912 
913 
933 MLPI_API MLPIRESULT mlpiApiCloseConnectionsByUser(const MLPIHANDLE connection, const WCHAR16 *user);
934 
935 
956 MLPI_API MLPIRESULT mlpiApiCloseConnectionsByUri(const MLPIHANDLE connection, const WCHAR16 *uri);
957 
958 
981 MLPI_API MLPIRESULT mlpiApiUserAccountControlReload(const MLPIHANDLE connection);
982 
983 
1013 MLPI_API MLPIRESULT mlpiApiUserAccountControlLoadAccounts(const MLPIHANDLE connection, const WCHAR16 *path);
1014 
1015 
1017 
1047 MLPI_API MLPIRESULT mlpiApiUserAccountControlUnloadAccounts(const MLPIHANDLE connection, const WCHAR16 *path);
1048 
1049 
1121 MLPI_API MLPIRESULT mlpiApiGetOwnPermissions(const MLPIHANDLE connection, WCHAR16 *permissions, const ULONG numElements, ULONG *numElementsRet);
1122 
1123 
1180 MLPI_API MLPIRESULT mlpiApiGetAccounts(const MLPIHANDLE connection, WCHAR16 *accounts, const ULONG numElements, ULONG *numElementsRet);
1181 
1182 
1231 MLPI_API MLPIRESULT mlpiApiGetAccountPermissions(const MLPIHANDLE connection, const WCHAR16 *account, WCHAR16 *permissions, const ULONG numElements, ULONG *numElementsRet);
1232 
1262 MLPI_API MLPIRESULT mlpiApiGetLibrarySupport(const MLPIHANDLE connection, MlpiLibrary *library, const ULONG numElements, ULONG *numElementsRet);
1263 
1264 #ifdef __cplusplus
1265 }
1266 #endif
1267 
1268 
1269 
1270 #endif // endof: #ifndef __MLPIAPILIB_H__
MLPIRESULT mlpiApiConnect(const WCHAR16 *connectionIdentifier, MLPIHANDLE *connection)
This function connects the user application with a specified MLC/MLP/XLC. The first argument of the c...
MLPIRESULT mlpiApiGetAllConnectionDescription(const MLPIHANDLE connection, MlpiConnectionDescription *description, const ULONG numElements, ULONG *numElementsRet)
This function will return information about all established connections of the device.
long MLPIRESULT
common MLPI-API return value
Definition: mlpiGlobal.h:200
MLPIRESULT mlpiApiGetClientCoreVersion(MlpiVersion *versionInfo)
This function returns the version info of the MLPI client library.
MLPIRESULT mlpiApiGetServerCoreVersion(const MLPIHANDLE connection, MlpiVersion *versionInfo)
This function returns the version info of the MLPI server library.
struct MlpiVersion MlpiVersion
Describes the API version information. The build number counts continuously within a major release...
struct MlpiLibrary MlpiLibrary
This structure is used by the function mlpiApiGetLibrarySupport to return information about available...
MLPIRESULT mlpiApiSetLabelOfConnection(const MLPIHANDLE connection, const WCHAR16 *label)
Using this function, you can assign a long descriptive label to your connection. It is not necessary ...
unsigned long long ULLONG
8 byte unsigned integer
Definition: mlpiGlobal.h:171
#define MLPI_API_CONNECTION_LABEL_LEN
Length of user-defined label of connection.
Definition: mlpiApiLib.h:262
MLPIRESULT mlpiApiUserAccountControlReload(const MLPIHANDLE connection)
This function provides the reloading of all currently loaded account manifests know as &#39;accounts...
signed char BOOL8
1 byte boolean
Definition: mlpiGlobal.h:158
MLPIRESULT mlpiApiIsConnected(const MLPIHANDLE connection, BOOL8 *isConnected)
This function returns the current state of the MLPI connection. If FALSE is returned, then the connection is either not yet established or closed because of an error in communication or because mlpiApiDisconnect has been called. In all cases a reconnect using mlpiApiConnect has to be made to make new MLPI function calls. If connection is lost for unknown reason, try increasing the connection timeout using mlpiApiSetDefaultTimeout.
#define MLPI_API_CONNECTION_URI_LEN
Length of URI of connection.
Definition: mlpiApiLib.h:261
MLPIRESULT mlpiApiGetAccounts(const MLPIHANDLE connection, WCHAR16 *accounts, const ULONG numElements, ULONG *numElementsRet)
MLPIRESULT mlpiApiUserAccountControlLoadAccounts(const MLPIHANDLE connection, const WCHAR16 *path)
The connection is protected against closing by an other connection completely.
Definition: mlpiApiLib.h:283
MLPIRESULT mlpiApiDisconnect(MLPIHANDLE *connection)
This function disconnects the user application from the target.
static const WCHAR16 MLPI_LOCALHOST[]
String for local host connection when client application and target are on the same device...
Definition: mlpiApiLib.h:270
wchar_t WCHAR16
UTF16 string.
Definition: mlpiGlobal.h:193
MLPIRESULT mlpiApiSetNameOfConnection(const MLPIHANDLE connection, const WCHAR16 *name)
Using this function, you can assign a short descriptive name to your connection. It is not necessary ...
MLPIRESULT mlpiApiTestConnection(const MLPIHANDLE connection, const ULONG payload, const ULONG numMeasurements, MlpiConnectionInfo *info)
This function performs a benchmark on the MLPI communication mechanism. Use it to measure the duratio...
MLPIRESULT mlpiApiSetDefaultTimeout(const ULONG timeout)
This function sets the default timeout for remote procedure calls done by the API. The timeout is used for connecting, sending and receiving data. During the debugging of your application, you might want to set this value to MLPI_INFINITE.
struct MlpiConnectionInfo MlpiConnectionInfo
This structure is used by the function mlpiApiTestConnection to return the results of the timing meas...
The connection is not protected and can be closed by an other connection.
Definition: mlpiApiLib.h:281
static const WCHAR16 MLPI_ACCOUNT_EMPTY_NAME[]
Surrogate string of account with empty name defined in account manifest &#39;accounts.xml&#39;.
Definition: mlpiApiLib.h:271
#define MLPI_API_CONNECTION_USER_LEN
Length of login user name of connection.
Definition: mlpiApiLib.h:263
#define MLPI_API_CONNECTION_NAME_LEN
Length of user-defined name of connection.
Definition: mlpiApiLib.h:260
MLPIRESULT mlpiApiGetAccountPermissions(const MLPIHANDLE connection, const WCHAR16 *account, WCHAR16 *permissions, const ULONG numElements, ULONG *numElementsRet)
This function provides the reading of the permissions of an account based on account manifest &#39;accoun...
struct MlpiDateAndTime MlpiDateAndTime
This structure defines the broken date and time information.
#define MLPI_API_LIBRARY_NAME_LEN
Length of library name.
Definition: mlpiApiLib.h:266
MLPIRESULT mlpiApiGetOwnPermissions(const MLPIHANDLE connection, WCHAR16 *permissions, const ULONG numElements, ULONG *numElementsRet)
This function provides the reading of own permissions based on account manifest &#39;accounts.xml&#39;.
MLPIRESULT mlpiApiDelay(const MLPIHANDLE connection, const ULONG delayMilliseconds)
This function does a simple delay on the server side. All this function performs is a blocking delay ...
MLPIRESULT mlpiApiNotifyAlive(const MLPIHANDLE connection)
This function notifies the MLPI server that the client is still alive. You may need this function if ...
MLPIRESULT mlpiApiCloseConnectionsByUri(const MLPIHANDLE connection, const WCHAR16 *uri)
This function closes one or multiple connections selected by a combination of the uniform resource id...
MLPIRESULT mlpiApiCloseConnectionByUid(const MLPIHANDLE connection, const ULLONG uid)
This function closes a connection selected by the unique identifier (uid) of a connection. You can determine the uid by using the function mlpiApiGetOwnConnectionDescription.
MLPIRESULT mlpiApiGetLibrarySupport(const MLPIHANDLE connection, MlpiLibrary *library, const ULONG numElements, ULONG *numElementsRet)
This function provides names and IDs of supported libraries.
unsigned long ULONG
4 byte unsigned integer
Definition: mlpiGlobal.h:168
MlpiApiProtection
This enumeration defines the protection levels of a connection.
Definition: mlpiApiLib.h:279
MLPIRESULT mlpiApiGetDefaultTimeout(ULONG *timeout)
This function reads the default timeout for remote procedure calls done by the API. This might not be the value that is set for a currently active connection.
double DOUBLE
8 byte floating point
Definition: mlpiGlobal.h:177
MLPIRESULT mlpiApiCloseConnectionsByUser(const MLPIHANDLE connection, const WCHAR16 *user)
This function closes one or multiple connections selected by the user.
unsigned long MLPIHANDLE
common MLPI-API handle value
Definition: mlpiGlobal.h:206
The connection is protected against closing by an other connection if the connection watchdog is acti...
Definition: mlpiApiLib.h:282
MLPIRESULT mlpiApiUserAccountControlUnloadAccounts(const MLPIHANDLE connection, const WCHAR16 *path)
struct MlpiConnectionDescription MlpiConnectionDescription
This structure is used by the functions mlpiApiGetOwnConnectionDescription and mlpiApiGetAllConnectio...
MLPIRESULT mlpiApiGetOwnConnectionDescription(const MLPIHANDLE connection, MlpiConnectionDescription *description)
This function will return information about the own connection.