|
| typedef bool(* | LogEntryCallback) (void *parameter, uint64_t timestamp, uint64_t entryID, bool moreFollow) |
| | Will be called for each new LogEntry by the getEntries and getEntriesAfter functions. More...
|
| |
| typedef bool(* | LogEntryDataCallback) (void *parameter, const char *dataRef, uint8_t *data, int dataSize, uint8_t reasonCode, bool moreFollow) |
| | Will be called for each new LogEntryData by the getEntries and getEntriesAfter functions. More...
|
| |
|
| void | LogStorage_setMaxLogEntries (LogStorage self, int maxEntries) |
| | Set the maximum number of log entries for this log. More...
|
| |
| uint64_t | LogStorage_addEntry (LogStorage self, uint64_t timestamp) |
| | Add an entry to the log. More...
|
| |
| bool | LogStorage_addEntryData (LogStorage self, uint64_t entryID, const char *dataRef, uint8_t *data, int dataSize, uint8_t reasonCode) |
| | Add new entry data to an existing log entry. More...
|
| |
| bool | LogStorage_getEntries (LogStorage self, uint64_t startingTime, uint64_t endingTime, LogEntryCallback entryCallback, LogEntryDataCallback entryDataCallback, void *parameter) |
| | Get log entries specified by a time range. More...
|
| |
| bool | LogStorage_getEntriesAfter (LogStorage self, uint64_t startingTime, uint64_t entryID, LogEntryCallback entryCallback, LogEntryDataCallback entryDataCallback, void *parameter) |
| | Get log entries specified by a start log entry. More...
|
| |
| bool | LogStorage_getOldestAndNewestEntries (LogStorage self, uint64_t *newEntry, uint64_t *newEntryTime, uint64_t *oldEntry, uint64_t *oldEntryTime) |
| | Get the entry time and entryID of the oldest and the newest log entries. More...
|
| |
| void | LogStorage_destroy (LogStorage self) |
| | Destroy the LogStorage instance and free all related resources. More...
|
| |
This interface has to be implemented by the log storage provider. The Log storage provider has to provide a specific constructor that creates an instance of LogStorage by allocating the required memory for the struct sLogStorage data structure and populate the function pointers with provider specific implementation functions.
| typedef bool(* LogEntryCallback) (void *parameter, uint64_t timestamp, uint64_t entryID, bool moreFollow) |
Will be called for each new LogEntry by the getEntries and getEntriesAfter functions.
- Parameters
-
| parameter | - a user provided parameter that is passed to the callback handler |
| timestamp | - the entry timestamp of the LogEntry |
| entryID | - the entryID of the LogEntry |
| moreFollow | - more data will follow - if false, the data is not valid and no more data will follow |
- Returns
- true ready to receive new data, false abort operation
| typedef bool(* LogEntryDataCallback) (void *parameter, const char *dataRef, uint8_t *data, int dataSize, uint8_t reasonCode, bool moreFollow) |
Will be called for each new LogEntryData by the getEntries and getEntriesAfter functions.
- Parameters
-
| parameter | - a user provided parameter that is passed to the callback handler |
| dataRef | - the data reference of the LogEntryData |
| data | - the data content as an unstructured binary data block |
| dataSize | - the size of the binary data block |
| reasonCode | - the reasonCode of the LogEntryData |
| moreFollow | - more data will follow - if false, the data is not valid and no more data will follow |
- Returns
- true ready to receive new data, false abort operation
| uint64_t LogStorage_addEntry |
( |
LogStorage |
self, |
|
|
uint64_t |
timestamp |
|
) |
| |
Add an entry to the log.
- Parameters
-
| self | the pointer of the LogStorage instance |
| timestamp | the entry time of the new entry |
- Returns
- the entryID of the new entry
| bool LogStorage_addEntryData |
( |
LogStorage |
self, |
|
|
uint64_t |
entryID, |
|
|
const char * |
dataRef, |
|
|
uint8_t * |
data, |
|
|
int |
dataSize, |
|
|
uint8_t |
reasonCode |
|
) |
| |
Add new entry data to an existing log entry.
- Parameters
-
| self | the pointer of the LogStorage instance |
| entryID | the ID of the log entry where the data will be added |
| dataRef | the data reference of the log entry data |
| data | the data content as an unstructured binary data block |
| dataSize | - the size of the binary data block |
| reasonCode | - the reasonCode of the LogEntryData |
- Returns
- true if the entry data was successfully added, false otherwise
| void LogStorage_destroy |
( |
LogStorage |
self | ) |
|
Destroy the LogStorage instance and free all related resources.
- Parameters
-
| self | the pointer of the LogStorage instance |
| bool LogStorage_getEntries |
( |
LogStorage |
self, |
|
|
uint64_t |
startingTime, |
|
|
uint64_t |
endingTime, |
|
|
LogEntryCallback |
entryCallback, |
|
|
LogEntryDataCallback |
entryDataCallback, |
|
|
void * |
parameter |
|
) |
| |
Get log entries specified by a time range.
- Parameters
-
| self | the pointer of the LogStorage instance |
| startingTime | start time of the time range |
| endingTime | end time of the time range |
| entryCallback | callback function to be called for each new log entry |
| entryDataCallback | callback function to be called for each new log entry data |
| parameter | - a user provided parameter that is passed to the callback handler |
- Returns
- true if the request has been successful, false otherwise
| bool LogStorage_getEntriesAfter |
( |
LogStorage |
self, |
|
|
uint64_t |
startingTime, |
|
|
uint64_t |
entryID, |
|
|
LogEntryCallback |
entryCallback, |
|
|
LogEntryDataCallback |
entryDataCallback, |
|
|
void * |
parameter |
|
) |
| |
Get log entries specified by a start log entry.
The request will return all log entries that where entered into the log after the log entry specified by startingTime and entryID.
- Parameters
-
| self | the pointer of the LogStorage instance |
| startingTime | timestamp of the start log entry |
| entryID | entryID of the start log entry |
| entryCallback | callback function to be called for each new log entry |
| entryDataCallback | callback function to be called for each new log entry data |
| parameter | - a user provided parameter that is passed to the callback handler |
- Returns
- true if the request has been successful, false otherwise
| bool LogStorage_getOldestAndNewestEntries |
( |
LogStorage |
self, |
|
|
uint64_t * |
newEntry, |
|
|
uint64_t * |
newEntryTime, |
|
|
uint64_t * |
oldEntry, |
|
|
uint64_t * |
oldEntryTime |
|
) |
| |
Get the entry time and entryID of the oldest and the newest log entries.
This function is used to update the log status information in the LCB
- Parameters
-
| self | the pointer of the LogStorage instance |
| newEntry | pointer to store the entryID of the newest entry |
| newEntryTime | pointer to store the entry time of the newest entry |
| oldEntry | pointer to store the entryID of the oldest entry |
| oldEntryTime | pointer to store the entry time of the oldest entry |
| void LogStorage_setMaxLogEntries |
( |
LogStorage |
self, |
|
|
int |
maxEntries |
|
) |
| |
Set the maximum number of log entries for this log.
- Parameters
-
| self | the pointer of the LogStorage instance |
| maxEntries | the maximum number of log entries |