-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathmanager.cpp
More file actions
34 lines (28 loc) · 849 Bytes
/
manager.cpp
File metadata and controls
34 lines (28 loc) · 849 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "api.h"
// forwards the notification from the C++ API to the Go layer - caller must free.
static void OnNotification (OpenZWave::Notification const* notification, API * api)
{
Notification * exported = exportNotification(api, notification);
onNotificationWrapper(exported, api);
}
void startManager(API * api)
{
OpenZWave::Manager::Create();
OpenZWave::Manager::Get()->AddWatcher( OnNotification, api );
}
void stopManager(API * api)
{
OpenZWave::Manager::Get()->RemoveWatcher(OnNotification, api);
OpenZWave::Manager::Destroy();
}
bool addNode(uint32 homeId, bool secure) {
return OpenZWave::Manager::Get()->AddNode(homeId, secure);
}
bool addDriver(char * device)
{
return OpenZWave::Manager::Get()->AddDriver(device);
}
bool removeDriver(char * device)
{
return OpenZWave::Manager::Get()->RemoveDriver(device);
}