Skip to content

Instantly share code, notes, and snippets.

@grodansparadis
Created October 13, 2021 21:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grodansparadis/246501a8a867f52cf1d9d29aeb336b41 to your computer and use it in GitHub Desktop.
Save grodansparadis/246501a8a867f52cf1d9d29aeb336b41 to your computer and use it in GitHub Desktop.
Windows: blocking calls in VSCP helper lib to get events
// Enter receive loop
if (VSCP_ERROR_SUCCESS != (rv = vscphlp_enterReceiveLoop(handle1))) {
printf("Failed to enter receive loop rv = %d\n", rv);
}
//
while (true) {
vscpEventEx ex;
if (VSCP_ERROR_SUCCESS == (rv = vscphlp_blockingReceiveEventEx(handle1, &ex, 1000))) {
printf("Event received: Class=%ud Type=%d\n", ex.vscp_class, ex.vscp_type);
}
else {
printf("No event received. rv=%d\n", rv);
Sleep(1000);
}
}
@BlueAndi
Copy link

Thanks for the hint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment