如何在 Tizen 原生可穿戴设备上获取 IMEI 号码?

How to get IMEI number on Tizen native wearable?

我拥有电话服务的特权和权限。我正在尝试检索 IMEI 和 cell_id 以及其他号码。我正在模拟器上测试。

代码:

char *imei;
/* In the case of a single SIM, you get only one handle */

ret = telephony_init(&handle_list);
if (ret == TELEPHONY_ERROR_NONE) {

    for (i = 0; i < handle_list.count; i++) {

        snprintf(chars, sizeof(chars),
                "<br>telephony handle[%p] for subscription[%d]",
                handle_list.handle[i], i);

        ret = telephony_modem_get_imei(handle_list.handle[i], &imei);
        if (ret == TELEPHONY_ERROR_NONE) {
            dlog_print(DLOG_INFO, LOG_TAG, "imei: %s", imei);
            snprintf(chars, sizeof(chars), "<br>imei: %s", imei);
        } else {
            snprintf(chars, sizeof(chars),
                    "<br>imei: getting error.Code: %d", ret); // I am getting this error always. How to resolve?
        }

    }

如何成功获取设备IMEI号?

能否告知我们您的特权及其级别?

通过电话获取正确的 IMEI API,

应用程序应该有“http://tizen.org/privilege/securesysteminfo”并且它的级别是public(第3方)/合作伙伴(第2方)/平台(制造商)之间的合作伙伴。

请参考更新后的电话 API doxygen 如下 link。

https://developer.tizen.org/development/api-references/native-application?redirect=https://developer.tizen.org/dev-guide/5.5.0/org.tizen.native.mobile.apireference/group__CAPI__TELEPHONY__INFORMATION__MODEM.html

https://developer.tizen.org/development/api-references/native-application?redirect=https://developer.tizen.org/dev-guide/5.5.0/org.tizen.native.mobile.apireference/group__CAPI__TELEPHONY__INFORMATION__MODEM.html#ga7e0c134af4fe12c9074f5feaccf9f5cc