This topic describes common problems and solutions for driver development.
device_cbparameter in theleda_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_countfield mean?A:
It sets the maximum length of the
output_dataarray for thecall_service_cbcallback. worker_thread_numsparameter used for in theleda_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_nameandleda_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 theby_device_nameandby_local_namefunctions 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.
该文章对您有帮助吗?