summaryrefslogtreecommitdiff
path: root/src/offlinelogstorage/dlt_offline_logstorage.h
diff options
context:
space:
mode:
authorChristoph Lipka <clipka@jp.adit-jv.com>2016-03-16 16:05:53 +0900
committerGernot Wirschal <gernot.wirschal@bmw.de>2016-04-25 14:34:34 +0200
commitbc09757d465d4ee5728157dce4fed0f71841daa7 (patch)
treec65dbe20fe43dc36e480ca85b74b41aa812e5de2 /src/offlinelogstorage/dlt_offline_logstorage.h
parentab443bc109f1d6a957fc5a85cd0efc566299bd4d (diff)
downloadDLT-daemon-bc09757d465d4ee5728157dce4fed0f71841daa7.tar.gz
Offline logstorage: On Demand triggering for syncing Logstorage cache and support long options
Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com> Change-Id: I2bac5e48a5d210b544a96fe96dc322f28ac472fe
Diffstat (limited to 'src/offlinelogstorage/dlt_offline_logstorage.h')
-rw-r--r--src/offlinelogstorage/dlt_offline_logstorage.h24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/offlinelogstorage/dlt_offline_logstorage.h b/src/offlinelogstorage/dlt_offline_logstorage.h
index 843fef2..df232b7 100644
--- a/src/offlinelogstorage/dlt_offline_logstorage.h
+++ b/src/offlinelogstorage/dlt_offline_logstorage.h
@@ -65,6 +65,8 @@
#define DLT_OFFLINE_LOGSTORAGE_DEVICE_DISCONNECTED 0
#define DLT_OFFLINE_LOGSTORAGE_CONFIG_DONE 1
+#define DLT_OFFLINE_LOGSTORAGE_SYNC_CACHES 2 /* sync logstorage caches */
+
#define DLT_OFFLINE_LOGSTORAGE_MAX_KEY_LEN 10 /* Maximum size for key */
#define DLT_OFFLINE_LOGSTORAGE_MAX_FILE_NAME_LEN 50 /* Maximum file name length of the log file */
@@ -114,9 +116,13 @@
#define DLT_OFFLINE_LOGSTORAGE_GENERAL_CONFIG_SECTION "GENERAL"
/* Offline Logstorage sync strategies */
-#define DLT_LOGSTORAGE_SYNC_ON_MSG 0x00 /* default, on message sync */
-#define DLT_LOGSTORAGE_SYNC_ON_DAEMON_EXIT 0x01 /* sync on daemon exit */
+#define DLT_LOGSTORAGE_SYNC_ON_ERROR -1 /* error case */
+#define DLT_LOGSTORAGE_SYNC_ON_MSG 1 /* default, on message sync */
+#define DLT_LOGSTORAGE_SYNC_ON_DAEMON_EXIT (1<<1) /* sync on daemon exit */
+#define DLT_LOGSTORAGE_SYNC_ON_DEMAND (1<<2) /* sync on demand */
+#define DLT_LOGSTORAGE_SYNC_ON_DEVICE_DISCONNECT (1<<3) /* sync on device disconnect*/
+#define DLT_OFFLINE_LOGSTORAGE_IS_STRATEGY_SET(S, s) ((S) & (s))
/* logstorage max cache */
unsigned int g_logstorage_cache_max;
@@ -223,9 +229,10 @@ extern int dlt_logstorage_load_config(DltLogStorage *handle);
* De-Initializes DLT Offline Logstorage with respect to device status
*
* @param handle DLT Logstorage handle
+ * @param reason Reason for device disconnection
* @return 0 on success, -1 on error
*/
-extern int dlt_logstorage_device_disconnected(DltLogStorage *handle);
+extern int dlt_logstorage_device_disconnected(DltLogStorage *handle, int reason);
/**
* dlt_logstorage_get_config
*
@@ -276,4 +283,15 @@ extern int dlt_logstorage_write(DltLogStorage *handle,
int size2,
unsigned char *data3,
int size3);
+
+/**
+ * dlt_logstorage_sync_caches
+ *
+ * Sync all caches inside the specified logstorage device.
+ *
+ * @param handle DltLogStorage handle
+ * @return 0 on success, -1 otherwise
+ */
+extern int dlt_logstorage_sync_caches(DltLogStorage *handle);
+
#endif /* DLT_OFFLINE_LOGSTORAGE_H */