diff options
author | Alexander Wenzel <Alexander.AW.Wenzel@bmw.de> | 2011-09-29 15:24:54 +0200 |
---|---|---|
committer | Alexander Wenzel <Alexander.AW.Wenzel@bmw.de> | 2011-09-29 15:24:54 +0200 |
commit | c37ecb5031eebc36bfba8be0d741ec858e8898f7 (patch) | |
tree | f5ab98bf34fb9e70522386a8625d54425a6fb5d2 /include | |
parent | 8fd55260f1d572939f185e014aef34a53b50de8b (diff) | |
download | DLT-daemon-c37ecb5031eebc36bfba8be0d741ec858e8898f7.tar.gz |
Fixed filetransfer to use shm status for flow control.
Added new function to dlt user library.
Diffstat (limited to 'include')
-rw-r--r-- | include/dlt/dlt_shm.h | 21 | ||||
-rwxr-xr-x | include/dlt/dlt_user.h | 10 |
2 files changed, 31 insertions, 0 deletions
diff --git a/include/dlt/dlt_shm.h b/include/dlt/dlt_shm.h index fc37117..e3608c3 100644 --- a/include/dlt/dlt_shm.h +++ b/include/dlt/dlt_shm.h @@ -177,6 +177,27 @@ extern void dlt_shm_status(DltShm *buf); extern int dlt_shm_free_client(DltShm *buf); /** + * Returns the total size of the shm. + * @param buf pointer to shm structure + * @return size of the shared memory. + */ +extern int dlt_shm_get_total_size(DltShm *buf); + +/** + * Returns the used size in the shm. + * @param buf pointer to shm structure + * @return size of the shared memory. + */ +extern int dlt_shm_get_used_size(DltShm *buf); + +/** + * Returns the number of messages in the shm. + * @param buf pointer to shm structure + * @return size of the shared memory. + */ +extern int dlt_shm_get_message_count(DltShm *buf); + +/** * Deinitialise the shared memory on the server side. * @param buf pointer to shm structure * @return negative value if there was an error diff --git a/include/dlt/dlt_user.h b/include/dlt/dlt_user.h index 1ea46cc..f2a1400 100755 --- a/include/dlt/dlt_user.h +++ b/include/dlt/dlt_user.h @@ -540,6 +540,16 @@ int dlt_log_raw(DltContext *handle,DltLogLevelType loglevel, void *data,uint16_t */ int dlt_forward_msg(void *msgdata,size_t size); +/** + * Get the total size and available size of the shared memory buffer between daemon and applications. + * This information is useful to control the flow control between applications and daemon. + * For example only 50% of the buffer should be used for file transfer. + * @param total_size total size of buffer in bytes + * @param used_size used size of buffer in bytes + * @return negative value if there was an error + */ +int dlt_user_check_buffer(int *total_size, int *used_size); + #ifdef __cplusplus } #endif |