espressif / esp-rainmaker

ESP RainMaker Agent for firmware development
Apache License 2.0
431 stars 145 forks source link

Deleting device from node - clarification needed (MEGH-4372) #242

Closed jacek12345 closed 1 year ago

jacek12345 commented 1 year ago

Answers checklist.

General issue report

There is no API to remove parameter from device, so I'm removing device and creating it one more time with desired parameters. Shuld I use esp_rmaker_node_remove_device() and esp_rmaker_device_delete() also, even when creating the same device for a while? I have not found in the documentation a detailed explanation of what these functions do underneath.

sanketwadekar commented 1 year ago

@jacek12345 As the API name suggests, esp_rmaker_node_remove_device() removes the device from the node, and esp_rmaker_device_delete() frees all the memory resources allocated to the device, including device parameters and attributes. To remove a device, you should call esp_rmaker_node_remove_device() before esp_rmaker_device_delete().

jacek12345 commented 1 year ago

Thank You @sanketwadekar