Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #144

Merged
merged 4 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions include/osdp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace OSDP {

class Common {
public:
Common() {}
Common() : _ctx(nullptr) {}

void logger_init(const char *name, int log_level,
osdp_log_puts_fn_t puts_fn)
Expand Down Expand Up @@ -63,7 +63,6 @@ class ControlPanel : public Common {
public:
ControlPanel()
{
_ctx = nullptr;
}

~ControlPanel()
Expand Down Expand Up @@ -110,7 +109,6 @@ class PeripheralDevice : public Common {
public:
PeripheralDevice()
{
_ctx = nullptr;
}

~PeripheralDevice()
Expand All @@ -131,9 +129,9 @@ class PeripheralDevice : public Common {
osdp_pd_refresh(_ctx);
}

void set_command_callback(pd_command_callback_t cb)
void set_command_callback(pd_command_callback_t cb, void* args)
{
osdp_pd_set_command_callback(_ctx, cb, _ctx);
osdp_pd_set_command_callback(_ctx, cb, args);
}

int notify_event(struct osdp_event *event)
Expand Down
2 changes: 1 addition & 1 deletion samples/cpp/pd_app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ int main()

pd.setup(&info_pd);

pd.set_command_callback(pd_command_handler);
pd.set_command_callback(pd_command_handler, nullptr);

while (1) {
pd.refresh();
Expand Down
Loading