/* Allocate memory */
plugin = g_malloc0(sizeof(ZigBeePlugin));
+ if (NULL == plugin)
+ return NULL;
/* Update fields */
plugin->plugin_name = g_strdup(plugin_name);
Z_LOGD("Driver appended into plugin [%s]", plugin->plugin_name);
}
+void zblib_plugin_unlink_driver(ZigBeePlugin *plugin, ZblibDriverType_e driver_type)
+{
+ ZblibDriverType_e _driver_type;
+ GSList *list = NULL;
+
+ zblib_check_null_ret("plugin", plugin);
+
+ list = plugin->driver_list;
+ while (list) {
+ /* Fetch driver type of driver */
+ _driver_type = zblib_driver_ref_driver_type((ZigBeeDriver *)(list->data));
+ if (_driver_type == driver_type) {
+ /* Driver found */
+ Z_LOGD("Driver[%p] removed from plugin", list->data);
+ list->data = NULL;
+ break;
+ }
+
+ /* Move to next driver */
+ list = g_slist_next(list);
+ }
+}
+
gboolean zblib_plugin_dispatch_request(ZigBeePlugin *plugin,
guint request_id)
{
/* Send notification to service */
zblib_service_send_notification(service,
noti_id, noti_data, noti_data_len);
-}
\ No newline at end of file
+}