.. index:: 
  !FaceLicense.getHostHardwareCode Method
  
.. _id3_face_face_license_get_host_hardware_code_class_method:

===============================================================================
FaceLicense.getHostHardwareCode Method
===============================================================================

Module: :ref:`FaceLicense<id3_face_face_license_class>`

Definition
----------

Retrieves the hardware code of the device using the requested hardware code type.

This function retrieves the hardware code of the device you run the library on.

The optional parameter is required:

- On Android, it must be the JNIEnv* pointer cast as a void*.

- In other cases, it must be set to NULL.


.. tab-set::

    .. tab-item:: Python
      :sync: Python

      .. code:: Python

        @staticmethod
        get_host_hardware_code(hardware_code_type: LicenseHardwareCodeType) -> str

      **Parameters**

        .. line-block::

          ``hardware_code_type`` :ref:`LicenseHardwareCodeType<id3_face_license_hardware_code_type_enum>`
          :guilabel:`in` The requested hardware code type.


      **Returns**

        .. line-block::

          ``str``
          The device hardware code.

      **Exceptions**

        .. line-block::

          :ref:`FaceException<id3_face_face_exception>`
          An error has occurred during Face Library execution.


    .. tab-item:: Dart
      :sync: Dart

      .. code:: Dart

        static String getHostHardwareCode(LicenseHardwareCodeType hardwareCodeType)

      **Parameters**

        .. line-block::

          ``hardwareCodeType`` :ref:`LicenseHardwareCodeType<id3_face_license_hardware_code_type_enum>`
          :guilabel:`in` The requested hardware code type.


      **Returns**

        .. line-block::

          ``String``
          The device hardware code.

      **Exceptions**

        .. line-block::

          :ref:`FaceException<id3_face_face_exception>`
          An error has occurred during Face Library execution.


    .. tab-item:: C#
      :sync: C#

      .. code:: C#

        public static string GetHostHardwareCode(LicenseHardwareCodeType hardwareCodeType)

      **Parameters**

        .. line-block::

          ``hardwareCodeType`` :ref:`LicenseHardwareCodeType<id3_face_license_hardware_code_type_enum>`
          :guilabel:`in` The requested hardware code type.


      **Returns**

        .. line-block::

          ``string``
          The device hardware code.

      **Exceptions**

        .. line-block::

          :ref:`FaceException<id3_face_face_exception>`
          An error has occurred during Face Library execution.


    .. tab-item:: Java
      :sync: Java

      .. code:: Java

        public static String getHostHardwareCode(LicenseHardwareCodeType hardwareCodeType) throws FaceException

      **Parameters**

        .. line-block::

          ``hardwareCodeType`` :ref:`LicenseHardwareCodeType<id3_face_license_hardware_code_type_enum>`
          :guilabel:`in` The requested hardware code type.


      **Returns**

        .. line-block::

          ``String``
          The device hardware code.

      **Exceptions**

        .. line-block::

          :ref:`FaceException<id3_face_face_exception>`
          An error has occurred during Face Library execution.


    .. tab-item:: Swift
      :sync: Swift

      .. code:: Swift

        public static func getHostHardwareCode(hardwareCodeType: LicenseHardwareCodeType) throws -> String

      **Parameters**

        .. line-block::

          ``hardwareCodeType`` :ref:`LicenseHardwareCodeType<id3_face_license_hardware_code_type_enum>`
          :guilabel:`in` The requested hardware code type.


      **Returns**

        .. line-block::

          ``String``
          The device hardware code.

      **Exceptions**

        .. line-block::

          :ref:`FaceException<id3_face_face_exception>`
          An error has occurred during Face Library execution.


    .. tab-item:: C
      :sync: C

      .. code:: C

        int id3FaceLicense_GetHostHardwareCode (
            id3FaceLicenseHardwareCodeType eHardwareCodeType, 
            char * code, 
            int * codeSize, 
            void * optionalParameter)

      **Parameters**

        .. line-block::

          ``eHardwareCodeType`` :ref:`id3FaceLicenseHardwareCodeType<id3_face_license_hardware_code_type_enum>`
          :guilabel:`in` The requested hardware code type.

          ``code`` char *
          :guilabel:`out` The device hardware code.

          ``codeSize`` int *
          :guilabel:`in` Size of the 'code' buffer. Receives the minimum required buffer size to hold the 'code' string if the given one is too small (including the terminating NULL character), otherwise receives the number of characters in 'code' (excluding terminating NULL character).

          ``optionalParameter`` void *
          :guilabel:`in` Only used on Android for JNIEnv* pointer. Ignored for other devices (NULL).


      **Returns**

        .. line-block::

          ``int``
          An error code.
          See :ref:`id3FaceError<id3_face_face_error_enum>` file for the list of possible error codes.


