Missing files for prevoius commitID; updated header documentation
[profile/ivi/persistence-client-library.git] / src / persistence_client_library_dbus_cmd.c
index 4698909..89c019c 100644 (file)
@@ -40,6 +40,7 @@
         extern int pfcWriteBackAndSync(int handle);
 #endif
 
+
 // function prototype
 void msg_pending_func(DBusPendingCall *call, void *data);
 
@@ -127,7 +128,7 @@ void process_send_notification_signal(DBusConnection* conn, unsigned int notifyL
       snprintf(userArray,  DbusSubMatchSize, "%u", notifyUserNo);
       snprintf(seatArray,  DbusSubMatchSize, "%u", notifySeatNo);
 
-      //printf("process_send_Notification_Signal => key: %s | lbid: %d | gUserNo: %d | gSeatNo: %d | gReason: %d \n", gNotifykey, gLdbid, gUserNo, gSeatNo, gReason);
+      //printf("process_send_Notification_Signal => key: %s | lbid: %d | gUserNo: %d | gSeatNo: %d | gReason: %d \n", notifyKey, notifyLdbid, notifyUserNo, notifySeatNo, notifyReason);
       message = dbus_message_new_signal(gPersAdminConsumerPath,
                                            gDbusPersAdminConsInterface,
                                         notifyReasonString);
@@ -149,22 +150,22 @@ void process_send_notification_signal(DBusConnection* conn, unsigned int notifyL
             }
             else
             {
-               DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("process_send_Notification_Signal ==> failed to send dbus message!!"));
+               DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("process_send_Notification_Signal - failed to send dbus message!!"));
             }
          }
          else
          {
-            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("process_send_Notification_Signal ==> E R R O R  C O N E C T I O N  NULL!!"));
+            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("process_send_Notification_Signal - C O N E C T I O N  NULL!!"));
          }
       }
       else
       {
-         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("process_send_Notification_Signal ==> ERROR dbus_message_append_args"));
+         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("process_send_Notification_Signal - dbus_message_append_args"));
       }
    }
    else
    {
-      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("process_send_Notification_Signal ==> ERROR invalid notification reason"));
+      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("process_send_Notification_Signal - invalid notification reason"));
    }
 }
 
@@ -185,6 +186,8 @@ void process_prepare_shutdown(int complete)
 {
    int i = 0, rval = 0;
 
+   DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("process_prepare_shutdown - writing down all changed data and closing all handles"));
+
    // block write
    pers_lock_access();
 
@@ -215,7 +218,7 @@ void process_prepare_shutdown(int complete)
 #endif
          if(rval == -1)
          {
-               DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("process_prepare_shutdown => failed to close file: "), DLT_STRING(strerror(errno)) );
+               DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("process_prepare_shutdown - failed to close file: "), DLT_STRING(strerror(errno)) );
          }
 
       }
@@ -272,7 +275,7 @@ void process_send_pas_request(DBusConnection* conn, unsigned int requestID, int
 
          if(!dbus_connection_send(conn, message, 0))
          {
-            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_lifecycle_register => Access denied"), DLT_STRING(error.message) );
+            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_lifecycle_register - Access denied"), DLT_STRING(error.message) );
          }
 
          dbus_connection_flush(conn);
@@ -280,12 +283,12 @@ void process_send_pas_request(DBusConnection* conn, unsigned int requestID, int
       }
       else
       {
-         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_pas_request => ERROR: Invalid message") );
+         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_pas_request - Invalid message") );
       }
    }
    else
    {
-      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_pas_request => ERROR: Invalid connection") );
+      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_pas_request - Invalid connection") );
    }
 }
 
@@ -331,24 +334,24 @@ void process_send_pas_register(DBusConnection* conn, int regType, int notificati
 
             if(!dbus_pending_call_set_notify(pending, msg_pending_func, method, NULL))
             {
-               DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("process_send_pas_register => dbus_pending_call_set_notify: FAILED\n") );
+               DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("process_send_pas_register - dbus_pending_call_set_notify: FAILED\n") );
             }
             dbus_pending_call_unref(pending);
          }
          else
          {
-            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_pas_register =>  ERROR: Invalid message") );
+            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_pas_register - Invalid message") );
          }
          dbus_message_unref(message);
       }
       else
       {
-         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_pas_register =>  ERROR: Invalid busname") );
+         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_pas_register - Invalid busname") );
       }
    }
    else
    {
-      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_pas_register =>  ERROR: Invalid connection") );
+      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_pas_register - Invalid connection") );
    }
 }
 
@@ -369,8 +372,6 @@ void process_send_lifecycle_register(DBusConnection* conn, int regType, int shut
    {
       const char* busName = dbus_bus_get_unique_name(conn);
 
-      printf("process_send_lifecycle_register => busName: %s\n", busName);
-
       DBusMessage* message = dbus_message_new_method_call(gDbusLcConsDest,           // destination
                                                              gDbusLcCons, // path
                                                              gDbusLcInterface,  // interface
@@ -393,19 +394,19 @@ void process_send_lifecycle_register(DBusConnection* conn, int regType, int shut
 
                   if(!dbus_connection_send(conn, message, 0))
                   {
-                     DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_lifecycle_register => Access denied"), DLT_STRING(error.message) );
+                     DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_lifecycle_register - Access denied"), DLT_STRING(error.message) );
                   }
                   dbus_connection_flush(conn);
          dbus_message_unref(message);
       }
       else
       {
-         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_lifecycle_register => ERROR: Invalid message"));
+         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_lifecycle_register - Invalid message"));
       }
    }
    else
    {
-      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_lifecycle_register => ERROR: connection isn NULL"));
+      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_lifecycle_register - connection isn NULL"));
    }
 }
 
@@ -431,7 +432,7 @@ void process_send_lifecycle_request(DBusConnection* conn, unsigned int requestId
 
          if(!dbus_connection_send(conn, message, 0))
          {
-            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_lifecycle_request => Access denied"), DLT_STRING(error.message) );
+            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_lifecycle_request - Access denied"), DLT_STRING(error.message) );
           }
 
           dbus_connection_flush(conn);
@@ -439,12 +440,12 @@ void process_send_lifecycle_request(DBusConnection* conn, unsigned int requestId
       }
       else
       {
-         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_lifecycle_request => ERROR: Invalid message"));
+         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_lifecycle_request - Invalid message"));
       }
    }
    else
    {
-      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_lifecycle_request => ERROR: connection isn NULL"));
+      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_lifecycle_request - connection isn NULL"));
    }
 }
 
@@ -462,7 +463,7 @@ void msg_pending_func(DBusPendingCall *call, void *data)
 
    if (dbus_set_error_from_message(&err, message))
    {
-      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_pending_func ==> Access denied") );
+      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_pending_func - Access denied") );
    }
    else
    {