Raritan / Server Technology Xerus™ PDU JSON-RPC API
CardReaderManager.idl
1 /* SPDX-License-Identifier: BSD-3-Clause */
2 /*
3  * Copyright 2013 Raritan Inc. All rights reserved.
4  */
5 
6 #ifndef __SMARTCARD_CARD_READER_MANAGER_IDL__
7 #define __SMARTCARD_CARD_READER_MANAGER_IDL__
8 
9 #include <CardReader.idl>
10 #include <Event.idl>
11 #include <UserEvent.idl>
12 
13 /** Card Reader Manager */
14 module smartcard {
15 
16  /** Card Reader Manager Interface */
17  interface CardReaderManager {
18 
19  /**
20  * Card Reader Settings
21  */
22  [sparse_in]
23  structure CardReaderSettings {
24  string name; ///< User-defined name
25  string description; ///< User-defined description
26  string cardFormat; ///< Card format, must be one of the values returned by
27  ///< getSupportedCardFormats(); use "RAW" for plain
28  ///< hexadecimal representation.
29  };
30 
31  /**
32  * Card Reader base event
33  */
34  valueobject CardReaderEvent extends idl.Event {
35  CardReader cardReader; ///< Affected card reader
36  CardReader.MetaData metaData; ///< Metadata of affected card reader
37  };
38 
39  /**
40  * Card Reader attached event
41  */
42  valueobject CardReaderAttachedEvent extends CardReaderEvent {};
43 
44  /**
45  * Card Reader detached event
46  */
47  valueobject CardReaderDetachedEvent extends CardReaderEvent {};
48 
49  /*
50  * Event: A card reader's settings have been changed
51  */
52  valueobject CardReaderSettingsChangedEvent extends event.UserEvent {
53  CardReader cardReader; ///< affected card reader
54  CardReaderSettings oldSettings; ///< Settings before change
55  CardReaderSettings newSettings; ///< Settings after change
56  string position; ///< Position of the card reader (see CardReader.MetaData)
57  };
58 
59  /**
60  * Retrieve the list of connected card readers.
61  *
62  * @return Card Readers list
63  */
64  vector<CardReader> getCardReaders();
65 
66  /**
67  * Get card reader for a specific id.
68  *
69  * @param readerId card reader id
70  *
71  * @return Card Reader with given id or null
72  */
73  CardReader getCardReaderById(in string readerId);
74 
75  /**
76  * Set settings for a card reader.
77  *
78  * @param position position of card reader (see CardReader.MetaData)
79  * @param settings new settings for card reader
80  *
81  * @return NO_ERROR if OK
82  * @return ERR_INVALID_PARAMS if any setting is invalid
83  *
84  * @note The CardReaderSettings structure can be "sparse"; fields missing
85  * in the JSON representation will remain unchanged.
86  */
87  int setCardReaderSettings(in string position, in CardReaderSettings setting);
88 
89  /**
90  * Get settings for all card readers.
91  *
92  * @return Map of settings by card reader position (see CardReader.MetaData)
93  */
94  map<string, CardReaderSettings> getAllCardReaderSettings();
95 
96  /**
97  * Retrieve the list of supported card formats like "RAW", "H10301", etc.
98  *
99  * @return Card Formats list
100  */
101  vector<string> getSupportedCardFormats();
102  };
103 
104 }
105 
106 #endif /* __SMARTCARD_CARD_READER_MANAGER_IDL__ */
Card Reader Manager Interface.
Definition: CardReaderManager.idl:17
int setCardReaderSettings(in string position, in CardReaderSettings setting)
Set settings for a card reader.
CardReader getCardReaderById(in string readerId)
Get card reader for a specific id.
vector< string > getSupportedCardFormats()
Retrieve the list of supported card formats like "RAW", "H10301", etc.
vector< CardReader > getCardReaders()
Retrieve the list of connected card readers.
map< string, CardReaderSettings > getAllCardReaderSettings()
Get settings for all card readers.
Card Reader Interface.
Definition: CardReader.idl:15
Basic IDL definitions.
Definition: Event.idl:10
Card Reader.
Definition: CardReader.idl:12
Common base for all events.
Definition: Event.idl:13
Card Reader attached event.
Definition: CardReaderManager.idl:42
Card Reader detached event.
Definition: CardReaderManager.idl:47
Card Reader base event.
Definition: CardReaderManager.idl:34
CardReader::MetaData metaData
Metadata of affected card reader.
Definition: CardReaderManager.idl:36
CardReader cardReader
Affected card reader.
Definition: CardReaderManager.idl:35
CardReaderSettings oldSettings
Settings before change.
Definition: CardReaderManager.idl:54
CardReader cardReader
affected card reader
Definition: CardReaderManager.idl:53
string position
Position of the card reader (see CardReader::MetaData)
Definition: CardReaderManager.idl:56
CardReaderSettings newSettings
Settings after change.
Definition: CardReaderManager.idl:55
Card Reader Settings.
Definition: CardReaderManager.idl:23
string name
User-defined name.
Definition: CardReaderManager.idl:24
string description
User-defined description.
Definition: CardReaderManager.idl:25
string cardFormat
Card format, must be one of the values returned by getSupportedCardFormats(); use "RAW" for plain hex...
Definition: CardReaderManager.idl:26
Reader Metadata.
Definition: CardReader.idl:24