Legrand / Raritan / Server Technology Xerus™ JSON-RPC API
Loading...
Searching...
No Matches
KeypadManager.idl
1/* SPDX-License-Identifier: BSD-3-Clause */
2/*
3 * Copyright 2020 Raritan Inc. All rights reserved.
4 */
5
6#ifndef __SMARTLOCK_KEYPAD_MANAGER_IDL__
7#define __SMARTLOCK_KEYPAD_MANAGER_IDL__
8
9#include <Keypad.idl>
10#include <Event.idl>
11#include <UserEvent.idl>
12
13/** Keypad Manager */
14module smartlock {
15
16 /** Keypad Manager Interface */
17 interface KeypadManager {
18
19 /*
20 * Keypad setting
21 */
22 structure KeypadSettings {
23 string name; ///< User-defined name
24 string description; ///< User-defined description
25 };
26
27 /**
28 * Keypad base event
29 */
30 valueobject KeypadEvent extends idl.Event {
31 Keypad keypad; ///< Affected keypad
32 Keypad.MetaData metaData; ///< MetaData of affected keypad
33 };
34
35 /**
36 * Keypad attached event
37 */
38 valueobject KeypadAttachedEvent extends KeypadEvent {};
39
40 /**
41 * Keypad detached event
42 */
43 valueobject KeypadDetachedEvent extends KeypadEvent {};
44
45 /*
46 * Event: A keypad's settings have been changed
47 */
48 valueobject KeypadSettingsChangedEvent extends event.UserEvent {
49 Keypad keypad; ///< affected keypad
50 KeypadSettings oldSettings; ///< Settings before change
51 KeypadSettings newSettings; ///< Settings after change
52 string position; ///< Position of the keypad (see Keypad.MetaData)
53 };
54
55 /**
56 * Retrieve the list of connected keypads.
57 *
58 * @return Keypads list
59 */
60 vector<Keypad> getKeypads();
61
62 /**
63 * Get keypad for a specific id.
64 *
65 * @param keypadId keypad id
66 *
67 * @return Keypad with given id or null
68 */
69 Keypad getKeypadById(in string keypadId);
70
71 /**
72 * Set settings for a keypad.
73 *
74 * @param position position of keypad (see Keypad.MetaData)
75 * @param settings new settings for keypad
76 *
77 * @return NO_ERROR if OK
78 * @return ERR_INVALID_PARAMS if any setting is invalid
79 */
80 int setKeypadSettings(in string position, in KeypadSettings setting);
81
82 /**
83 * Get settings for all keypads.
84 *
85 * @return Map of settings by keypad position (see Keypad.MetaData)
86 */
87 map<string, KeypadSettings> getAllKeypadSettings();
88 };
89
90}
91
92#endif /* __SMARTLOCK_KEYPAD_MANAGER_IDL__ */
Keypad Manager Interface.
int setKeypadSettings(in string position, in KeypadSettings setting)
Set settings for a keypad.
vector< Keypad > getKeypads()
Retrieve the list of connected keypads.
Keypad getKeypadById(in string keypadId)
Get keypad for a specific id.
map< string, KeypadSettings > getAllKeypadSettings()
Get settings for all keypads.
Keypad Interface.
Definition: Keypad.idl:15
Basic IDL definitions.
Definition: Event.idl:10
Common base for all events.
Definition: Event.idl:13
Keypad::MetaData metaData
MetaData of affected keypad.
KeypadSettings oldSettings
Settings before change.
KeypadSettings newSettings
Settings after change.
string position
Position of the keypad (see Keypad::MetaData)
string description
User-defined description.
Keypad Metadata.
Definition: Keypad.idl:24