Last active
September 7, 2015 12:48
-
-
Save shinhirota/6dff7cbbad182ab5face to your computer and use it in GitHub Desktop.
This file contains 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
int send_packet_to_device (void* packet) { | |
int ret; | |
ret = open_device(); | |
if (ret != OK) { | |
printf("Device could not be opened!\n"); | |
goto ERROR; | |
} | |
ret = send_packet(packet); | |
if (ret != OK) { | |
printf("Failed to send the packet!\n"); | |
goto ERROR; | |
} | |
ret = close_device(); | |
if (ret != OK) { | |
printf("Failed to close the device!\n"); | |
goto ERROR; | |
} | |
return RET_OK; | |
ERROR: | |
printf("Some error happened!\n"); | |
return RET_NG; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment