nymea / nymea-zigbee

Zigbee library and tools for the nymea IoT stack.
GNU Lesser General Public License v3.0
3 stars 4 forks source link

Force less includes on users of the lib #11

Closed mzanetti closed 3 years ago

mzanetti commented 3 years ago

Quick fixes to not force users of the lib to link against qsql.

However, one issue with this: Removing the include for QSqlDatabase in zigbeenetwork.h caused the backends to not build any more... That's rather bad imo.

Do we really need to have the backends manipulating the database? IMO that doesn't belong there.

t-mon commented 3 years ago

The db is required.

mzanetti commented 3 years ago

The db is required.

Yes sure... As discussed offline there was a misunderstanding. I meant the access of the DB from within backend plugins (NXP/deConz). My question is if we can change the backend plugin stuff to not have (direct) access to the DB because this way a plugin dev (ideally, that could be anyone not having much knowledge about the stack itself) can trash the stack's DB which I'd like to prevent. We should try to make the backend plugin as thin as possible, just forwarding "HCI" (speaking in BT terms) commands but not having to insert stuff into the stack's DB...

Given we probably won't be getting a new backend plugin every month (but rather like 1 or 2 additional ones in a lifetime) this isn't the most critical thing, still if it doesn't require too much work, I think it'd be nicer to remove the DB access from the backend plugins.