Created
October 13, 2021 21:13
-
-
Save grodansparadis/246501a8a867f52cf1d9d29aeb336b41 to your computer and use it in GitHub Desktop.
Windows: blocking calls in VSCP helper lib to get events
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for the hint.