summaryrefslogtreecommitdiff
path: root/src/daemon
diff options
context:
space:
mode:
authorVo Trung Chi <Chi.VoTrung@vn.bosch.com>2019-07-25 10:40:14 +0700
committerSaya Sugiura <39760799+ssugiura@users.noreply.github.com>2019-09-13 08:48:31 +0900
commitfca93d9445c9714b5e266996e43dba349ae43e3a (patch)
tree9c42e5319702a2fa922335612b6d073929957ad9 /src/daemon
parentb1193fa1f3b48587666202f513d9bfba719fdc6a (diff)
downloadDLT-daemon-fca93d9445c9714b5e266996e43dba349ae43e3a.tar.gz
console: Add get sw version control msg
dlt-control command is extended to send get software version control message. e.g: dlt-control -k localhost Signed-off-by: Vo Trung Chi <Chi.VoTrung@vn.bosch.com>
Diffstat (limited to 'src/daemon')
-rw-r--r--src/daemon/dlt_daemon_client.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/daemon/dlt_daemon_client.c b/src/daemon/dlt_daemon_client.c
index 324f6b1..0a8aeb0 100644
--- a/src/daemon/dlt_daemon_client.c
+++ b/src/daemon/dlt_daemon_client.c
@@ -708,7 +708,8 @@ void dlt_daemon_control_get_software_version(int sock, DltDaemon *daemon, DltDae
/* prepare payload of data */
len = strlen(daemon->ECUVersionString);
- msg.datasize = sizeof(DltServiceGetSoftwareVersionResponse) + len;
+ /* msg.datasize = sizeof(serviceID) + sizeof(status) + sizeof(length) + len */
+ msg.datasize = sizeof(uint32_t) + sizeof(uint8_t) + sizeof(uint32_t) + len;
if (msg.databuffer && (msg.databuffersize < msg.datasize)) {
free(msg.databuffer);
@@ -734,7 +735,7 @@ void dlt_daemon_control_get_software_version(int sock, DltDaemon *daemon, DltDae
resp->service_id = DLT_SERVICE_ID_GET_SOFTWARE_VERSION;
resp->status = DLT_SERVICE_RESPONSE_OK;
resp->length = len;
- memcpy(msg.databuffer + sizeof(DltServiceGetSoftwareVersionResponse), daemon->ECUVersionString, len);
+ memcpy(msg.databuffer + msg.datasize - len, daemon->ECUVersionString, len);
/* send message */
dlt_daemon_client_send_control_message(sock, daemon, daemon_local, &msg, "", "", verbose);