Knox Tizen Wearable SDK
misc.h
1 /*
2  * Copyright (c) 2000-2017 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * PROPRIETARY/CONFIDENTIAL
5  *
6  * This software is the confidential and proprietary information of
7  * SAMSUNG ELECTRONICS ("Confidential Information").
8  * You shall not disclose such Confidential Information and shall
9  * use it only in accordance with the terms of the license agreement
10  * you entered into with SAMSUNG ELECTRONICS.
11  * SAMSUNG make no representations or warranties about the suitability
12  * of the software, either express or implied, including but not
13  * limited to the implied warranties of merchantability, fitness for
14  * a particular purpose, or non-infringement.
15  * SAMSUNG shall not be liable for any damages suffered by licensee as
16  * a result of using, modifying or distributing this software or its derivatives.
17  */
18 
19 #ifndef LIBMDM_MDM_MISC_H
20 #define LIBMDM_MDM_MISC_H
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 #include <stdbool.h>
27 
28 #include "mdm_client_type.h"
29 #include "misc/browser.h"
30 #include "misc/camera.h"
31 #include "misc/email.h"
32 #include "misc/external_storage.h"
33 #include "misc/microphone.h"
34 #include "misc/ringtone.h"
35 
45 typedef enum {
46  SIM_CHANGED,
51 
57 typedef struct {
59  char *sim_operator;
63  char *sim_slot;
64  long timestamp;
65 } sim_info_t;
66 
72 typedef struct {
73  sim_change_type_t change_type;
74  long change_time;
78 
79 /*
80  * @brief Type of integrity check status.
81  * @since_tizen 2.3.2.3
82  * @since_mdm 1.0.0
83  */
84 typedef enum {
87  MDM_INTEGRITY_CHECK_STATUS_CHECK_ERROR = TIZEN_ERROR_NONE - 2,
90 
91 /*
92  * @brief Type of struct passed as argument to the MISC callbacks.
93  * @since_tizen 2.3.2.3
94  * @since_mdm 1.0.0
95  */
96 typedef struct {
97  bool integrity_check_status; /* Status of the integrity process only. In case of integrity
98  item add callback the field should be ignore */
99  mdm_misc_integrity_check_error error_code; /* Code of error detected during the verification process. */
100  char * error_description; /* Description of the error code. */
101 } mdm_misc_integrity_check_info_cb_t;
102 
103 /*
104  * @brief Integrity checking callback types. The enum should be used when mdm_register_client_callback()
105  * MDM SDK API call is used to register on Integrity Check callback.
106  * @since_tizen 2.3.2.3
107  * @since_mdm 1.0.0
108  */
109 typedef enum {
110  MDM_CB_MISC_INTEGRITY_CHECK = 0, /* Checking integrity callback. */
111  MDM_CB_MISC_INTEGRITY_CHECK_ADD_ITEM = 1 /* Add check item callback. */
112 } mdm_misc_cb;
113 
114 /*
115  * @brief API to start checking integrity process.
116  *
117  * @since_mdm 1.0.0
118  *
119  * @since_tizen 2.3.2.3
120  *
121  * @feature %http://developer.samsung.com/tizen/feature/mdm.misc
122  *
123  * @par Usage:
124  * Admin can use this function to start the integrity verification for items (files/directories)
125  * previously added to the checklist using #mdm_integrity_check_add_item. Final integrity status
126  * is returned in #MDM_CB_MISC_INTEGRITY_CHECK callback type.
127  *
128  * @param[in] cb_function callback function
129  * @param[in] user_data user data that will be pass to the callback function
130  * @code{.c}
131 
132  //
133  // Integrity check callback
134  //
135  static void __integrity_check_callback__(void *cb_data, void *user_data)
136  {
137  mdm_misc_integrity_check_info_cb_t *cb_info = (mdm_misc_integrity_check_info_cb_t *)cb_data;
138  // ...
139  }
140 
141  int fun()
142  {
143  // Connect to the MDM
144  mdm_get_service();
145 
146  mdm_result_t ret = mdm_integrity_check_start(__integrity_check_callback__, NULL);
147 
148  if (ret == MDM_RESULT_SUCCESS) {
149  // integrity checking started
150  } else {
151  // error occured
152  }
153  // ...
154  }
155 
156  * @endcode
157  *
158  * @privlevel public
159  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.misc
160  *
161  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
162  *
163  * @retval #MDM_RESULT_SUCCESS The integrity checking process started successfully.
164  * @retval #MDM_RESULT_FAIL General failure. Refer to #mdm_get_last_error for more details.
165  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported.
166  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
167  *
168  * @par Permission:
169  * Usage of this API is restricted to registered clients only.
170  *
171  * @see mdm_integrity_check_add_item
172  *
173  */
174 mdm_result_t mdm_integrity_check_start(mdm_client_callback_function_ext cb_function, void *user_data);
175 
176 /*
177  * @brief API to add an item to integrity checklist.
178  *
179  * @since_mdm 1.0.0
180  *
181  * @since_tizen 2.3.2.3
182  *
183  * @feature %http://developer.samsung.com/tizen/feature/mdm.misc
184  *
185  * @par Usage:
186  * Admin can use this function to add a file/folder to the list of integrity items.
187  * If the argument does not stand for a correct destination in the file system #MDM_RESULT_INVALID_PARAM is returned.
188  *
189  * @param[in] item File or directory to be added to the checklist.
190  * @param[in] cb_function callback function
191  * @param[in] user_data user data that will be pass to the callback function
192  *
193  * @code{.c}
194 
195  //
196  // Integrity check callback
197  //
198  static void __integrity_check_callback__(void *cb_data, void *user_data)
199  {
200  mdm_misc_integrity_check_info_cb_t *cb_info = (mdm_misc_integrity_check_info_cb_t *)cb_data;
201  // ...
202  }
203 
204  int fun()
205  {
206  // Connect to the MDM
207  mdm_get_service();
208 
209  mdm_result_t ret = mdm_integrity_check_add_item("/opt/etc/mdm", __integrity_check_callback__, NULL);
210 
211  if (ret == MDM_RESULT_SUCCESS) {
212  // integrity checking started
213  } else {
214  // error occured
215  }
216  }
217 
218  * @endcode
219  *
220  * @privlevel public
221  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.misc
222  *
223  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
224  *
225  * @retval #MDM_RESULT_SUCCESS The item added successfully.
226  * @retval #MDM_RESULT_FAIL General failure. Refer to #mdm_get_last_error for more details.
227  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter.
228  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported.
229  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
230  *
231  * @par Permission:
232  * Usage of this API is restricted to registered clients only.
233  *
234  * @see mdm_integrity_check_test_item
235  *
236  */
237 mdm_result_t mdm_integrity_check_add_item(const char *item, mdm_client_callback_function_ext cb_function,
238  void *user_data);
239 
240 /*
241  * @brief API to delete an item from integrity checklist.
242  *
243  * @since_mdm 1.0.0
244  *
245  * @since_tizen 2.3.2.3
246  *
247  * @feature %http://developer.samsung.com/tizen/feature/mdm.misc
248  *
249  * @par Usage:
250  * Admin can use this function to remove a file/folder from the list of integrity items.
251  * If the argument does not stand for an existing destination on the checklist #MDM_RESULT_INVALID_PARAM is generated.
252  *
253  * @param[in] item File or directory to be removed from the checklist.
254  *
255  * @code{.c}
256 
257  mdm_result_t ret = mdm_integrity_check_delete_item("/opt/etc/mdm");
258 
259  if (ret == MDM_RESULT_SUCCESS) {
260  // item deleted successfully
261  } else {
262  // error occured
263  }
264 
265  * @endcode
266  *
267  * @privlevel public
268  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.misc
269  *
270  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
271  *
272  * @retval #MDM_RESULT_SUCCESS The item deleted successfully.
273  * @retval #MDM_RESULT_FAIL General failure. Refer to #mdm_get_last_error for more details.
274  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter.
275  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported.
276  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
277  *
278  * @par Permission:
279  * Usage of this API is restricted to registered clients only.
280  *
281  * @see mdm_integrity_check_test_item
282  *
283  */
284 mdm_result_t mdm_integrity_check_delete_item(const char *item);
285 
286 /*
287  * @brief API to check if an item figures on integrity checklist.
288  *
289  * @since_mdm 1.0.0
290  *
291  * @since_tizen 2.3.2.3
292  *
293  * @feature %http://developer.samsung.com/tizen/feature/mdm.misc
294  *
295  * @par Usage:
296  * Admin can use this function to verify a file/folder whether it exists on the list of integrity items.
297  *
298  * @param[in] item File or directory to be checked.
299  *
300  * @code{.c}
301 
302  mdm_status_t stat = mdm_integrity_check_test_item("/opt/etc/mdm");
303 
304  if (stat == MDM_TRUE || stat == MDM_FALSE) {
305  // function executed successfully
306  } else {
307  // error occured
308  }
309 
310  * @endcode
311  *
312  * @privlevel public
313  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.misc
314  *
315  * @return #mdm_status_t : One of below values:
316  * @retval #MDM_TRUE The item exists on the checklist.
317  * @retval #MDM_FALSE The item does not exist on the checklist.
318  * @retval #MDM_STATUS_ERROR General failure.
319  *
320  * @par Permission:
321  * Usage of this API is restricted to registered clients only.
322  *
323  * @see mdm_integrity_check_add_item
324  * @see mdm_integrity_check_delete_item
325  *
326  */
327 mdm_status_t mdm_integrity_check_test_item(const char *item);
328 
329 /*
330  * @brief API to get defined by in the system check items from RO list.
331  *
332  * @since_mdm 1.0.0
333  *
334  * @since_tizen 2.3.2.3
335  *
336  * @feature %http://developer.samsung.com/tizen/feature/mdm.misc
337  *
338  * @par Usage:
339  * Admin can use this function get list of integrity check items defined in the system.
340  * The API will return check items that belong to RO list only.
341  * List of items will be returned as list (GList) of strings.
342  *
343  * @code{.c}
344 
345  mdm_data_t *data = mdm_integrity_check_get_ro_list();
346 
347  if(data != NULL) {
348  // ...
349  } else {
350  // ...
351  }
352 
353  * @endcode
354  *
355  * @privlevel public
356  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.misc
357  *
358  * @return #mdm_data_t : One of below values:
359  * @retval (mdm_data_t *) -> data != NULL - a list of RO items,
360  * @retval (mdm_data_t *) -> data == NULL - if RO list is empty
361  * @retval (mdm_data_t *) -> ret == #MDM_RESULT_SUCCESS – Success
362  * @retval (mdm_data_t *) -> ret == #MDM_RESULT_FAIL – General failure
363  * @retval (mdm_data_t *) -> ret == #MDM_RESULT_NOT_SUPPORTED – Not supported
364  * @retval (mdm_data_t *) -> ret == #MDM_RESULT_ACCESS_DENIED – The application does not have the privilege to call this
365  function.
366 
367  * @par Permission:
368  * Usage of this API is restricted to registered clients only.
369  *
370  * @see mdm_integrity_check_add_item, mdm_integrity_check_delete_item, mdm_integrity_check_test_item
371  */
372 mdm_data_t *mdm_integrity_check_get_ro_list(void);
373 
374 /*
375  * @brief API to get defined by in the system check items from RW list.
376  *
377  * @since_mdm 1.0.0
378  *
379  * @since_tizen 2.3.2.3
380  *
381  * @feature %http://developer.samsung.com/tizen/feature/mdm.misc
382  *
383  * @par Usage:
384  * Admin can use this function get list of integrity check items defined in the system.
385  * The API will return check items that belong to RW list only.
386  * List of items will be returned as list (GList) of strings.
387  *
388  * @code{.c}
389 
390  mdm_data_t *data = mdm_integrity_check_get_rw_list();
391 
392  if(data != NULL) {
393  // ...
394  } else {
395  // ...
396  }
397 
398  * @endcode
399  *
400  * @privlevel public
401  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.misc
402  *
403  * @return #mdm_data_t : One of below values:
404  * @retval (mdm_data_t *) -> data != NULL - a list of RW items,
405  * @retval (mdm_data_t *) -> data == NULL - if RW list is empty
406  * @retval (mdm_data_t *) -> ret == #MDM_RESULT_SUCCESS – Success
407  * @retval (mdm_data_t *) -> ret == #MDM_RESULT_FAIL – General failure
408  * @retval (mdm_data_t *) -> ret == #MDM_RESULT_NOT_SUPPORTED – Not supported
409  * @retval (mdm_data_t *) -> ret == #MDM_RESULT_ACCESS_DENIED – The application does not have the privilege to call this
410  function.
411 
412  * @par Permission:
413  * Usage of this API is restricted to registered clients only.
414  *
415  * @see mdm_integrity_check_add_item, mdm_integrity_check_delete_item, mdm_integrity_check_test_item
416  */
417 mdm_data_t *mdm_integrity_check_get_rw_list(void);
418 
466 
498 
545 
581 
582 /*
583  * @brief API to get the information about the last time the SIM card was changed.
584  *
585  * @since_mdm 1.0.0
586  *
587  * @since_tizen 2.3.2.3
588  *
589  * @feature %http://developer.samsung.com/tizen/feature/mdm
590  *
591  * @par Usage:
592  * Admin can use this API to detect SIM related changes like removal and insertion of SIM card in device and take
593  appropriate actions based on enterprise policy.
594  *
595  * @code{.c}
596 
597  mdm_data_t *sim_data = mdm_get_last_sim_change_info();
598  if(sim_data)
599  SUCCESS
600  else
601  FAIL
602  }
603  * @endcode
604 
605  *
606  * @return #sim_change_info_t list on success, NULL on failure.
607  *
608  * @retval #MDM_RESULT_SUCCESS Successful
609  * @retval #MDM_RESULT_FAIL General failure
610  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
611  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
612  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
613  *
614  * @see mdm_msim_get_last_sim_change_info
615  */
616 mdm_data_t *mdm_get_last_sim_change_info(void);
617 
618 /*
619  * @brief API to get the information about the last time the SIM card was changed.
620  *
621  * @since_mdm 1.1.0
622  *
623  * @since_tizen 2.3.2.3
624  *
625  * @feature %http://developer.samsung.com/tizen/feature/mdm
626  *
627  * @par Usage:
628  * Admin can use this API to detect SIM related changes like removal and insertion of SIM card in device and take
629  appropriate actions based on enterprise policy.
630  *
631  * @code{.c}
632 
633  mdm_data_t *lp_data = mdm_msim_get_sim_ids();
634  if (lp_data && lp_data->sim_ids_list) {
635  int i = 0;
636  GList *list = lp_data->sim_ids_list;
637  GList *l;
638  for(l=g_list_first(list); l; l=l->next)
639  {
640  printf("sim id [%s]\n", (char*)l->data);
641  mdm_data_t *sim_data = mdm_msim_get_last_sim_change_info(l->data);
642  if(sim_data)
643  SUCCESS
644  else
645  FAIL
646  }
647  mdm_free_data(lp_data);
648  }
649  * @endcode
650 
651  *
652  * @return #sim_change_info_t list on success, NULL on failure.
653  *
654  * @retval #MDM_RESULT_SUCCESS Successful
655  * @retval #MDM_RESULT_FAIL General failure
656  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
657  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
658  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
659  *
660  * @see mdm_get_last_sim_change_info
661  */
662 mdm_data_t *mdm_msim_get_last_sim_change_info(const char *slot_id);
663 
664 /*
665  * @brief Specifies whether the device allows the use of SMS or text messaging.
666  *
667  * @since_mdm 1.1.0
668  *
669  * @since_tizen 2.3.2.3
670  *
671  * @feature %http://developer.samsung.com/tizen/feature/mdm
672  *
673  * @par Usage:
674  * Admin can disable the text Messaging capability without any user interaction for specified sim card.
675  *
676  * @remark
677  * Text messaging restriction #mdm_status_t is written to #MDM_POLICY_ON_MESSAGE notification file.
678  * You can register a callback for this event using #mdm_register_policy_receiver.
679  *
680  * @code{.c}
681 
682  mdm_result_t ret = MDM_RESULT_SUCCESS;
683  ret = mdm_set_allow_text_messaging("SIM1", MDM_RESTRICTED);
684  if (ret == MDM_RESULT_SUCCESS) {
685 
686  }
687 
688  * @endcode
689  *
690  * @privlevel public
691  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.misc
692  * @param[in] id id of sim
693  * @param[in] state MDM_RESTRICTED: Disables sending text message, user cannot enable.
694  * MDM_ALLOWED: user can send text message.
695  *
696  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
697  *
698  * @retval #MDM_RESULT_SUCCESS Successful
699  * @retval #MDM_RESULT_FAIL General failure
700  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
701  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
702  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
703  *
704  * @par Permission:
705  * Usage of this API is restricted to registered clients only.
706  *
707  * @see mdm_msim_get_allow_text_messaging
708  *
709  */
710 mdm_result_t mdm_msim_set_allow_text_messaging(const char *id, mdm_status_t state);
711 
712 /*
713  * @brief Checks whether the Text Messaging capability is enabled or not for specified sim card.
714  *
715  * @since_mdm 1.1.0
716  *
717  * @since_tizen 2.3.2.3
718  *
719  * @feature %http://developer.samsung.com/tizen/feature/mdm
720  *
721  * @par Usage:
722  * Admin can check whether Text Messaging capability is enabled or not, and take appropriate actions based on enterprise
723  policy.
724  *
725  * @code{.c}
726 
727  mdm_status_t ret;
728  ret = mdm_get_allow_text_messaging("SIM1");
729  if (ret == MDM_ALLOWED) {
730  // user can send text message.
731  }
732  else if (ret == MDM_RESTRICTED) {
733  // Disabled sending text message
734  }
735 
736  * @endcode
737  *
738  * @param[in] id id of sim
739  *
740  * @return #mdm_status_t : Whether Text Messaging is enabled for given sim card
741  *
742  * @retval #MDM_RESTRICTED Restricted
743  * @retval #MDM_ALLOWED Allowed.
744  *
745  * @see mdm_msim_set_allow_text_messaging
746  *
747  */
748 mdm_status_t mdm_msim_get_allow_text_messaging(const char *id);
749 
750 /*
751  * More detailed reason for software update failure.
752  * @since_tizen 2.3.2.3
753  */
754 typedef enum {
761 
762 /*
763  * @brief API to trigger a firmware update.
764  *
765  * @since_mdm 1.0.0
766  *
767  * @since_tizen 2.3.2.3
768  *
769  * @feature %http://developer.samsung.com/tizen/feature/mdm
770  *
771  * @par Usage:
772  * Admin client can use this API to perform device firmware update from custom source.
773  *
774  * @note The source file (described by @p path parameter) won't be deleted.
775  * @note Provide absolute @p path to a file.
776  *
777  * Example scenario:
778  * - Admin client checks current version of the firmware and basing on this decides that the firmware has to be updated.
779  * - Admin client downloads package with the firmware update and saves it on SD card or internal memory.
780  * - Admin client calls mdm_trigger_firmware_update() with path to the update package.
781  * - The device will reboot and perform the firmware update.
782  *
783  * @code{.c}
784 
785  static char *_get_new_firmware_url()
786  {
787  // Checks if new firmware is available.
788  // If there is a new firmware it will return pointer to the buffer containing URL to the package.
789  }
790 
791  static bool _download(const char *url, const char *path)
792  {
793  // Downloads file and stores it at given path.
794  }
795 
796  static bool _download_and_update()
797  {
798  char *url = _get_new_firmware_url();
799 
800  if (url == NULL) {
801  // Update won't be performed.
802  return false;
803  }
804 
805  const char *path = "/opt/usr/media/Downloads/fota-signed.tar";
806 
807  if (! _download(url, path)) {
808  // Download failed.
809  g_free(url);
810  return false;
811  }
812 
813  mdm_result_t result = mdm_get_service();
814  if (result != MDM_RESULT_SUCCESS) {
815  // Get service failed, we have no communication with mdm-server.
816  g_free(url);
817  return false;
818  }
819 
820  mdm_result_t result = mdm_trigger_firmware_update(path, NULL);
821  if (result != MDM_RESULT_SUCCESS) {
822  // Update failed.
823  g_free(url);
824  return false;
825  }
826 
827  mdm_release_service();
828 
829  g_free(url);
830  return true;
831  }
832  * @endcode
833  *
834  * @privlevel public
835  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.misc
836  *
837  * @param[in] path Path to downloaded firmware update package.
838  * @param[out] failure_reason More detailed failure reason. Relevant only if error code is MDM_RESULT_SUCCESS or
839  * MDM_RESULT_FAIL Might be NULL if user is not interested in result.
840  *
841  *
842  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
843  *
844  * @retval #MDM_RESULT_SUCCESS Successful
845  * @retval #MDM_RESULT_FAIL General failure
846  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
847  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
848  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
849  *
850  */
851 mdm_result_t mdm_trigger_firmware_update(const char *path, mdm_firmware_update_failure_reason_t *failure_reason);
852 
853 /* --------------------------------------------------------------------------------------------------------
854  * HIDDEN DOCUMENTATION
855  * --------------------------------------------------------------------------------------------------------
856  *
857  * Hidden documentation won't be generated by doxygen unless
858  * MISC_HIDDEN_API section is added to the ENABLED_SECTIONS
859  * in the Doxygen configuration file.
860  */
862 
863 /*
864  * @brief Send ussd request.
865  *
866  * @since_mdm 1.0.0
867  *
868  * @since_tizen 2.3.2.3
869  *
870  * @feature %http://developer.samsung.com/tizen/feature/mdm
871  *
872  * @par Usage:
873  * Admin can send ussd request.
874  *
875  * @code{.c}
876 
877  mdm_data_t ret;
878  ret = mdm_msim_send_ussd_request("SIM1", "*#006#");
879  if (!ret) {
880  // Fail
881  }
882 
883 
884  * @endcode
885  *
886  * @return #mdm_data_t : string on success and NULL on failure.
887  *
888  */
889 mdm_data_t *mdm_msim_send_ussd_request(const char *slot_id, const char *code);
890 
891 /*
892  * @brief This API make a voice call to specified phone number on voice call preferred sim card.
893  *
894  * @since_mdm 1.0.0
895  *
896  * @since_tizen 2.3.2.3
897  *
898  * @feature %http://developer.samsung.com/tizen/feature/mdm
899  *
900  * @par Usage:
901  * MDM client can make a voice call to specified phone number.
902  *
903  * @code{.c}
904  mdm_result_t ret = mdm_msim_make_voice_call("+48223778901");
905 
906  if (ret == MDM_RESULT_SUCCESS) {
907  // Request for starting voice call succeeded.
908  } else {
909  // voice call failed.
910  }
911 
912  * @endcode
913  *
914  * @param[in] id id of sim
915  * @param[in] phone_number phone number
916  *
917  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success or error code.
918  */
919 mdm_result_t mdm_msim_make_voice_call(const char *phone_number);
920 
921 /*
922  * @brief This API sends sms to specified phone number.
923  *
924  * @since_mdm 1.0.0
925  *
926  * @since_tizen 2.3.2.3
927  *
928  * @feature %http://developer.samsung.com/tizen/feature/mdm
929  *
930  * @par Usage:
931  * MDM client can send an sms to specified phone number.
932  *
933  * @code{.c}
934  mdm_result_t ret = mdm_msim_send_sms("+48223778901");
935 
936  if (ret == MDM_RESULT_SUCCESS) {
937  // Request for starting voice call succeeded.
938  } else {
939  // voice call failed.
940  }
941 
942  * @endcode
943  *
944  * @param[in] id id of sim
945  * @param[in] phone_number phone number
946  *
947  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success or error code.
948  */
949 mdm_result_t mdm_msim_send_sms(const char *phone_number, const char *sms_message);
950 
952 /* -----------------------------------------------------------------------------------------------------------------
953  * END OF HIDDEN DOCUMENTATION
954  * -----------------------------------------------------------------------------------------------------------------
955  */
956 
961 #ifdef __cplusplus
962 }
963 #endif
964 
965 #endif // LIBMDM_MDM_MISC_H
long timestamp
Definition: misc.h:64
for sim information type
Definition: misc.h:57
mdm_firmware_update_failure_reason_t
Definition: misc.h:754
This structure is used to store GList.
char * sim_phoneNumber
Definition: misc.h:61
char * sim_serialNumber
Definition: misc.h:62
void(* mdm_client_callback_function_ext)(void *cb_data, void *user_data)
Policy callback function pointer.
mdm_status_t
MDM Policy status.
sim_info_t * current_sim_info
Definition: misc.h:75
Other reason of failure.
Definition: misc.h:759
char * sim_slot
Definition: misc.h:63
Unable to reboot device in update mode.
Definition: misc.h:758
sim_change_type_t change_type
Definition: misc.h:73
mdm_result_t mdm_set_allow_location(mdm_status_t state)
API to enable or disable the location capability.
mdm_status_t mdm_get_allow_location(void)
API to check if the location capability is enabled or disabled.
for sim change information
Definition: misc.h:72
char * sim_countryIso
Definition: misc.h:58
Unable to copy update package to update directory.
Definition: misc.h:756
mdm_result_t
MDM API result.
char * sim_operator
Definition: misc.h:59
sim_info_t * previous_sim_info
Definition: misc.h:76
sim_change_type_t
for sim change information
Definition: misc.h:45
mdm_status_t mdm_get_allow_text_messaging(void)
API to check whether the Text Messaging capability is enabled or not.
mdm_result_t mdm_set_allow_text_messaging(mdm_status_t state)
API to specify whether the device allows the use of SMS or text messaging.
mdm_misc_integrity_check_error
Definition: misc.h:84
char * sim_operatorName
Definition: misc.h:60
long change_time
Definition: misc.h:74