Skip to content

DataStore

Markus edited this page Feb 23, 2020 · 1 revision

DataStore

Because you don't want to rejoin all your devices after restarting your software you are able to store them in a data store like JSON file, MongoDb or what ever you like.

Implement your own data store

ZigBeeNet provides the interface IZigBeeNetworkDataStore for your implementing your own logic. You just need to implement a few methods and add your class instance before startup to the NetworkManager object like this:

IZigBeeNetworkDataStore dataStore = new JsonNetworkDataStore(database);
networkManager.SetNetworkDataStore(dataStore);

Your devices will be automatically loaded on application startup into the NetworkManager instance and saved on node update.

Thats all!