summaryrefslogtreecommitdiff
path: root/src/daemon/dlt_daemon_client.c
diff options
context:
space:
mode:
authorAlexander Wenzel <Alexander.AW.Wenzel@bmw.de>2014-09-11 16:14:07 +0200
committerAlexander Wenzel <Alexander.AW.Wenzel@bmw.de>2014-09-11 16:24:43 +0200
commitc8d990b893838b3263ac020b095f1a520908e815 (patch)
treedbc8f21021a6c478b4f0e5ddcf79afcd8c700646 /src/daemon/dlt_daemon_client.c
parent406f947a0f8dca7ac1fbdc6b1df2bbe37af1b669 (diff)
downloadDLT-daemon-c8d990b893838b3263ac020b095f1a520908e815.tar.gz
Added new API to send marker message from application.
Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
Diffstat (limited to 'src/daemon/dlt_daemon_client.c')
-rw-r--r--src/daemon/dlt_daemon_client.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/daemon/dlt_daemon_client.c b/src/daemon/dlt_daemon_client.c
index 5f85b15..b0a11c9 100644
--- a/src/daemon/dlt_daemon_client.c
+++ b/src/daemon/dlt_daemon_client.c
@@ -1183,6 +1183,57 @@ int dlt_daemon_control_message_timezone(int sock, DltDaemon *daemon, DltDaemonLo
return 0;
}
+int dlt_daemon_control_message_marker(int sock, DltDaemon *daemon, DltDaemonLocal *daemon_local, int verbose)
+{
+ DltMessage msg;
+ DltServiceMarker *resp;
+
+ PRINT_FUNCTION_VERBOSE(verbose);
+
+ if (daemon==0)
+ {
+ return -1;
+ }
+
+ /* initialise new message */
+ if (dlt_message_init(&msg,0)==-1)
+ {
+ return -1;
+ }
+
+ /* prepare payload of data */
+ msg.datasize = sizeof(DltServiceMarker);
+ if (msg.databuffer && (msg.databuffersize < msg.datasize))
+ {
+ free(msg.databuffer);
+ msg.databuffer=0;
+ }
+ if (msg.databuffer == 0){
+ msg.databuffer = (uint8_t *) malloc(msg.datasize);
+ msg.databuffersize = msg.datasize;
+ }
+ if (msg.databuffer==0)
+ {
+ return -1;
+ }
+
+ resp = (DltServiceMarker*) msg.databuffer;
+ resp->service_id = DLT_SERVICE_ID_MARKER;
+ resp->status = DLT_SERVICE_RESPONSE_OK;
+
+ /* send message */
+ if(dlt_daemon_client_send_control_message(sock,daemon,daemon_local,&msg,"","", verbose))
+ {
+ dlt_message_free(&msg,0);
+ return -1;
+ }
+
+ /* free message */
+ dlt_message_free(&msg,0);
+
+ return 0;
+}
+
void dlt_daemon_control_callsw_cinjection(int sock, DltDaemon *daemon, DltDaemonLocal *daemon_local, DltMessage *msg, int verbose)
{
char apid[DLT_ID_SIZE],ctid[DLT_ID_SIZE];