Fix event handling after moving callbacks to mbus handle

This commit is contained in:
Stefan Wahren
2013-10-13 21:56:15 +02:00
parent 0cf57bfc35
commit c2a3f4b871
9 changed files with 54 additions and 55 deletions

View File

@ -94,17 +94,17 @@ main(int argc, char **argv)
return 1;
}
if (debug)
{
mbus_register_send_event(&mbus_dump_send_event);
mbus_register_recv_event(&mbus_dump_recv_event);
}
if ((handle = mbus_context_tcp(host, port)) == NULL)
{
fprintf(stderr,"Scan failed: Could not initialize M-Bus context: %s\n", mbus_error_str());
return 1;
}
if (debug)
{
mbus_register_send_event(handle, &mbus_dump_send_event);
mbus_register_recv_event(handle, &mbus_dump_recv_event);
}
if (mbus_connect(handle) == -1)
{