Languages

Menu
Sites
Language
tizen dudi 추출

안녕하세요 gear s2의 duid를 얻기 위해

#include <system_info.h>
 
char *duid = NULL;
int ret;
 
ret = system_info_get_platform_string("http://tizen.org/system/duid", &duid);
 
if(ret == SYSTEM_INFO_ERROR_NONE){
        dlog_print(DLOG_INFO, "QQ", "Successful");
    } else if(ret == SYSTEM_INFO_ERROR_OUT_OF_MEMORY){
        dlog_print(DLOG_INFO, "QQ", "Out of memory");
    } else if(ret == SYSTEM_INFO_ERROR_INVALID_PARAMETER){
        dlog_print(DLOG_INFO, "QQ", "Cannot find the @a key in the model config file");
    } else if(ret == SYSTEM_INFO_ERROR_IO_ERROR){
        dlog_print(DLOG_INFO, "QQ", "input/output error occurred while reading the @a value from the model config file");
    } else if(ret == SYSTEM_INFO_ERROR_PERMISSION_DENIED){
        dlog_print(DLOG_INFO, "QQ", "No permission to use the API");
    }
 
    dlog_print(DLOG_INFO, "QQ", duid);
 
와 같이 소스를 구성하였습니다.
 
하지만 system_info_error_invalid_parameter 에러가 발생하여 duid를 추출할 수 없네요.
 
duid를 추출할 수 있는 다른 방안이 있을까요??
 
참고 사이트 : https://www.tizen.org/ko/system

Responses

1 Replies
Shaswati Saha

Hello,
 

As far as I know, there is no way to get DUID from device using API for now. Please go through the link below:
https://developer.tizen.org/ko/forums/native-application-development/api-getting-duid-native-app?langswitch=ko

 

For more information about system information follow the link below:
https://developer.tizen.org/development/guides/native-application/system/system-information


Moreover, there’s an alternative option of using “readonly DOMString duid” which indicates the Tizen ID, not device’s unique ID.
For detail information about Tizen ID you can go through the “readonly DOMString duid” section of the following link:

https://developer.tizen.org/dev-guide/2.4/org.tizen.web.apireference/html/device_api/mobile/tizen/systeminfo.html

 

To extract Tizen ID you can use the following code snippet:

#include <system_info.h>

void func(void)

{

       char *value;

       int ret;
       ret = system_info_get_platform_string("http://tizen.org/system/tizenid", &value);

       if (ret == SYSTEM_INFO_ERROR_NONE) {

                 dlog_print(DLOG_INFO, LOG_TAG, "Model name: %s", value);

             }
       free(value); // Release after use

}

Thanks.