summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIngo Huerner <ingo_huerner@mentor.com>2017-04-10 08:23:58 +0200
committerIngo Huerner <ingo_huerner@mentor.com>2017-04-10 08:23:58 +0200
commit87281e7cb8e47cace208a1b0cf3109b37156418a (patch)
tree9614c14a25f333fab3a4472a638e38814124dea3
parent8e564900fb6697056e69abf50da281a8401d3f2b (diff)
downloadpersistence-client-library-87281e7cb8e47cace208a1b0cf3109b37156418a.tar.gz
NSM interaction rework: Lifecycle request will be answered with pending (not OK anymore); LifecycleRequestComplete to NSM will be sent later
-rw-r--r--src/persistence_client_library_data_organization.h2
-rw-r--r--src/persistence_client_library_lc_interface.c9
2 files changed, 10 insertions, 1 deletions
diff --git a/src/persistence_client_library_data_organization.h b/src/persistence_client_library_data_organization.h
index e83023d..54f0b37 100644
--- a/src/persistence_client_library_data_organization.h
+++ b/src/persistence_client_library_data_organization.h
@@ -138,6 +138,8 @@ enum _PersistenceConstantDef
NsmErrorStatus_OK = 1,
/// lifecycle return failed indicator
NsmErrorStatus_Fail = -1,
+ /// lifecycle return that message is pending
+ NsmErrorStatus_ResponsePending = 7,
/// max checksum size
ChecksumBufSize = 64,
/// max character sub match size
diff --git a/src/persistence_client_library_lc_interface.c b/src/persistence_client_library_lc_interface.c
index 8b2265e..3a9e615 100644
--- a/src/persistence_client_library_lc_interface.c
+++ b/src/persistence_client_library_lc_interface.c
@@ -94,7 +94,7 @@ int msg_lifecycleRequest(DBusConnection *connection, DBusMessage *message)
DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("msg_lifecycleRequest"), DLT_UINT(request), DLT_UINT(requestID) );
- msgReturn = check_lc_request(request, requestID);
+ msgReturn = NsmErrorStatus_ResponsePending; // let NSM know that message response is pending,
reply = dbus_message_new_method_return(message);
@@ -116,6 +116,13 @@ int msg_lifecycleRequest(DBusConnection *connection, DBusMessage *message)
dbus_connection_flush(connection);
dbus_message_unref(reply);
+
+ // now prepare for shutdown and then send
+ if(check_lc_request(request, requestID) == NsmErrorStatus_Fail)
+ {
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msgLcReq - Failed write wo queue"));
+ }
+
return DBUS_HANDLER_RESULT_HANDLED;
}