FAQ

更新时间:
复制 MD 格式

This topic describes common problems and solutions for driver development.

  • device_cb parameter in the leda_register_and_online_by_device_name(const char *product_key, const char *device_name, leda_device_callback_t *device_cb, void *usr_data) function?

    A:

    It receives service requests for the device from the cloud or other edge applications. These requests include retrieving device properties, setting device properties, and calling device services.

  • typedef struct leda_device_callback
    {
    
       ...
       int  service_output_max_count;   /* The maximum length of the device service callback result array */
    } leda_device_callback_t;

    What does the service_output_max_count field mean?

    A:

    It sets the maximum length of the output_data array for the call_service_cb callback.

  • worker_thread_nums parameter used for in the leda_init(const char *module_name, int worker_thread_nums) function?

    A:

    It initializes the driver's thread pool. This pool handles device requests from the cloud or edge applications. Set the size of the pool based on the number of connected devices.

  • leda_register_and_online_by_device_name and leda_register_and_online_by_local_name?

    A:

    • by_device_name: The `device_name` used for registration must match the name specified when the device was created in the Alibaba Cloud IoT Platform.
    • by_local_name: The `device_name` used for registration can be a custom name.
      Note For devices that have the same ProductKey, you must use only one of these functions for registration. Do not use both the by_device_name and by_local_name functions for the same ProductKey.
  • The device is online and the driver logs show that data is reported correctly, but the data is not updated in the IoT Platform console.

    A:

    Confirm that message routing is configured in the IoT Platform console. For more information, see Set up message routing.