Raritan PX2/PX3 JSON-RPC API
CardReader.idl
1 /* SPDX-License-Identifier: BSD-3-Clause */
2 /*
3  * Copyright 2013 Raritan Inc. All rights reserved.
4  */
5 
6 #ifndef __SMARTCARD_CARD_READER_IDL__
7 #define __SMARTCARD_CARD_READER_IDL__
8 
9 #include <Event.idl>
10 
11 /** Card Reader */
12 module smartcard {
13 
14  /** Card Reader Interface */
15  interface CardReader_1_0_3 {
16 
17  /** Error codes */
18  constant int NO_ERROR = 0; ///< operation successful, no error
19  constant int ERR_SLOT_EMPTY = 1; ///< no card present in reader
20 
21  /**
22  * Reader Metadata
23  */
24  structure MetaData {
25  string id; ///< Card reader ID used in events and traps
26  string manufacturer; ///< manufacturer
27  string product; ///< product
28  string serialNumber; ///< serial number (S/N)
29  int channel; ///< one device (S/N) can provide multiple readers
30  string position; ///< Position of the card reader.
31  ///< Contains either the position in the 1-wire topology and the
32  ///< channel (e.g. D1:H1:C1-1) or, for usb card readers, a string like
33  ///< usb:<n> where n is a number increasing with usb card readers.
34  };
35 
36  /**
37  * Card Information
38  */
39  structure CardInformation {
40  string type; ///< card type
41  string uid; ///< card id
42  };
43 
44  /**
45  * Card base event
46  */
47  valueobject CardEvent extends idl.Event {
48  CardInformation cardInfo; ///< card info of affected card
49  };
50 
51  /**
52  * Card inserted event
53  */
54  valueobject CardInsertedEvent extends CardEvent {};
55 
56  /**
57  * Card removed event
58  */
59  valueobject CardRemovedEvent extends CardEvent {};
60 
61  /**
62  * Retrieve reader metadata.
63  *
64  * @return metadata
65  */
66  MetaData getMetaData();
67 
68  /**
69  * Retrieve card information from reader.
70  *
71  * @param cardInfo Card Information
72  *
73  * @return NO_ERROR if OK
74  * @return ERR_SLOT_EMPTY if reader sees no card
75  */
76  int getCardInformation(out CardInformation cardInfo);
77 
78  };
79 
80 }
81 
82 #endif /* __SMARTCARD_CARD_READER_IDL__ */
Card Information.
Definition: CardReader.idl:39
string type
card type
Definition: CardReader.idl:40
string manufacturer
manufacturer
Definition: CardReader.idl:26
Reader Metadata.
Definition: CardReader.idl:24
int channel
one device (S/N) can provide multiple readers
Definition: CardReader.idl:29
Basic IDL definitions.
Definition: Event.idl:10
string product
product
Definition: CardReader.idl:27
string uid
card id
Definition: CardReader.idl:41
Card Reader.
Definition: CardReader.idl:12
string id
Card reader ID used in events and traps.
Definition: CardReader.idl:25
string serialNumber
serial number (S/N)
Definition: CardReader.idl:28
string position
Position of the card reader.
Definition: CardReader.idl:30
Card Reader Interface.
Definition: CardReader.idl:15