diff options
author | Vo Trung Chi <Chi.VoTrung@vn.bosch.com> | 2019-07-25 10:40:14 +0700 |
---|---|---|
committer | Saya Sugiura <39760799+ssugiura@users.noreply.github.com> | 2019-09-13 08:48:31 +0900 |
commit | fca93d9445c9714b5e266996e43dba349ae43e3a (patch) | |
tree | 9c42e5319702a2fa922335612b6d073929957ad9 /src/daemon/dlt_daemon_client.c | |
parent | b1193fa1f3b48587666202f513d9bfba719fdc6a (diff) | |
download | DLT-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/dlt_daemon_client.c')
-rw-r--r-- | src/daemon/dlt_daemon_client.c | 5 |
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); |