Changed file and key-value API according GENIVI naming conventions
[profile/ivi/persistence-client-library.git] / src / persistence_client_library_pas_interface.h
1 #ifndef PERSISTENCE_CLIENT_LIBRARY_PAS_INTERFACE_H
2 #define PERSISTENCE_CLIENT_LIBRARY_PAS_INTERFACE_H
3
4 /******************************************************************************
5  * Project         Persistency
6  * (c) copyright   2012
7  * Company         XS Embedded GmbH
8  *****************************************************************************/
9 /******************************************************************************
10  * This Source Code Form is subject to the terms of the
11  * Mozilla Public License, v. 2.0. If a  copy of the MPL was not distributed
12  * with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
13 ******************************************************************************/
14  /**
15  * @file           persistence_client_library_pas_interface.h
16  * @ingroup        Persistence client library
17  * @author         Ingo Huerner
18  * @brief          Definition of the persistence client library persistence
19  *                 administration service interface.
20  * @see
21  */
22
23 #include <dbus/dbus.h>
24
25
26 /**
27  * @brief Check if a org.genivi.persistence.admin message has been received
28  *
29  * @param connection the debus connection
30  * @param message the dbus message
31  * @param user_data data handed over to this function
32  *
33  * @return DBUS_HANDLER_RESULT_HANDLED or DBUS_HANDLER_RESULT_NOT_YET_HANDLED
34  */
35 DBusHandlerResult checkPersAdminMsg(DBusConnection * connection, DBusMessage * message, void * user_data);
36
37 //DBusHandlerResult checkPersAdminSignal(DBusConnection * connection, DBusMessage * message, void * user_data);
38
39
40 int signal_persModeChange(DBusConnection *connection, DBusMessage *message);
41
42 /// synchronize data back to memory device
43 int pers_data_sync(void);
44
45
46 /// lock access to persistence data
47 void pers_lock_access(void);
48
49
50 /// unlock access to persistent data
51 void pers_unlock_access(void);
52
53
54 /**
55  * @brief check if access to persistent data is locked
56  *
57  * @return 1 if access is locked, 0 if access is possible
58  */
59 int isAccessLocked(void);
60
61
62 /// block persistence access and write data back to device
63 void process_block_and_write_data_back(unsigned int requestID);
64
65
66 /**
67  * @brief send registration message 'RegisterPersAdminNotification' to org.genivi.persistence.admin
68  *
69  * @return 0 on success or -1 on error
70  */
71 int register_pers_admin_service(void);
72
73
74 /**
75  * @brief send registration message 'UnRegisterPersAdminNotification' to org.genivi.persistence.admin
76  *
77  * @return 0 on success or -1 on error
78  */
79 int unregister_pers_admin_service(void);
80
81
82
83 #endif /* PERSISTENCE_CLIENT_LIBRARY_PAS_INTERFACE_H */