ua_payload_h handle,
char **user_data);
+/**
+ * @ingroup CAPI_NETWORK_UA_MODULE
+ * @brief Gets device's BLE payload DEVICE_UID length.
+ * @since_tizen 5.5
+ *
+ * @param[in] handle The payload handle.
+ * @param[out] device_uid_len The BLE payload DEVICE_UID length.
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #UA_ERROR_NONE Successful
+ * @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ * @exception
+ * @pre
+ * @post
+ *
+ */
+int ua_payload_get_device_uid_len(
+ ua_payload_h handle,
+ int *device_uid_len);
+
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Gets device's BLE payload DEVICE_UID.
return UA_ERROR_NONE;
}
+int ua_payload_get_device_uid_len(
+ ua_payload_h handle,
+ int *device_uid_len)
+{
+ FUNC_ENTRY;
+ ua_payload_info_s *payload = (ua_payload_info_s *)handle;
+
+ UA_VALIDATE_INPUT_PARAMETER(handle);
+ UA_VALIDATE_INPUT_PARAMETER(device_uid_len);
+ UA_PRINT_PAYLOAD_HANDLE(handle);
+
+ if (!payload) {
+ *device_uid_len = 0x00;
+ UA_DBG("payload(device_uid_len) is not found");
+ goto done;
+ }
+
+ UA_DBG("payload(device_uid_len) [%d]", payload->device_uid_len);
+ *device_uid_len = payload->device_uid_len;
+
+done:
+ FUNC_EXIT;
+ return UA_ERROR_NONE;
+}
+
int ua_payload_get_device_uid(
ua_payload_h handle,
char **device_uid)
char primary_key = 0;
char secondary_key = 0;
char *device_uid = NULL;
+ int device_uid_len = 0;
char device_icon = 0;
char *payload_user_data = NULL;
if (UA_ERROR_NONE == ret)
msglr("Payload secondary key : %d", secondary_key);
+ ret = ua_payload_get_device_uid_len(handle, &device_uid_len);
+ if (UA_ERROR_NONE == ret) {
+ msglr("Payload device uid len %d", device_uid_len);
+ }
+
ret = ua_payload_get_device_uid(handle, &device_uid);
if (UA_ERROR_NONE == ret) {
- msglr("Payload device uid %s", device_uid);
+ for (int i = 0; i < device_uid_len; i++ )
+ msglr("Payload device uid 0x%2.2X", device_uid[i]);
}
ret = ua_payload_get_device_icon(handle, &device_icon);
ret = ua_payload_get_user_data(handle, &payload_user_data);
if (UA_ERROR_NONE == ret) {
- msglr("Payload user data : %s", payload_user_data);
+ for (int i = 0; i < 17 - 1 - device_uid_len; i++ )
+ msglr("Payload user data : 0x%2.2X", payload_user_data[i]);
}
return true;