cli: add formating option (json and key/value) for created SMS

Fixes #657

Signed-off-by: Frederic Martinsons <frederic.martinsons@gmail.com>
This commit is contained in:
Frederic Martinsons
2023-01-01 08:40:27 +01:00
committed by Aleksander Morgado
parent 3b56efed0b
commit 766962167c
3 changed files with 5 additions and 1 deletions

View File

@@ -277,7 +277,9 @@ create_process_reply (MMSms *sms,
exit (EXIT_FAILURE);
}
g_print ("Successfully created new SMS: %s\n", mm_sms_get_path (sms));
mmcli_output_string (MMC_F_MESSAGING_CREATED_SMS, mm_sms_get_path (sms));
mmcli_output_dump ();
g_object_unref (sms);
}

View File

@@ -169,6 +169,7 @@ static FieldInfo field_infos[] = {
[MMC_F_TIMEZONE_LEAP_SECONDS] = { "modem.time.leap-seconds", "leap seconds", MMC_S_MODEM_TIMEZONE, },
[MMC_F_MESSAGING_SUPPORTED_STORAGES] = { "modem.messaging.supported-storages", "supported storages", MMC_S_MODEM_MESSAGING, },
[MMC_F_MESSAGING_DEFAULT_STORAGES] = { "modem.messaging.default-storages", "default storages", MMC_S_MODEM_MESSAGING, },
[MMC_F_MESSAGING_CREATED_SMS] = { "modem.messaging.created-sms", "created sms", MMC_S_MODEM_MESSAGING, },
[MMC_F_SIGNAL_REFRESH_RATE] = { "modem.signal.refresh.rate", "refresh rate", MMC_S_MODEM_SIGNAL, },
[MMC_F_SIGNAL_RSSI_THRESHOLD] = { "modem.signal.threshold.rssi", "rssi threshold", MMC_S_MODEM_SIGNAL, },
[MMC_F_SIGNAL_ERROR_RATE_THRESHOLD] = { "modem.signal.threshold.error-rate", "error rate threshold", MMC_S_MODEM_SIGNAL, },

View File

@@ -179,6 +179,7 @@ typedef enum {
/* Messaging section */
MMC_F_MESSAGING_SUPPORTED_STORAGES,
MMC_F_MESSAGING_DEFAULT_STORAGES,
MMC_F_MESSAGING_CREATED_SMS,
/* Signal section */
MMC_F_SIGNAL_REFRESH_RATE,
MMC_F_SIGNAL_RSSI_THRESHOLD,