Created
December 8, 2017 08:50
-
-
Save deadc0de6/69e0d56f338a93ff60c2a96fb34af01c 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
parse_header(Args, | |
<< | |
Pldlen:24/little, % 3 bytes payload length | |
_:8, % 1 byte sequence id or packet nb | |
Pld/binary % content | |
>>) -> | |
case byte_size(Pld) == Pldlen of | |
true -> | |
parse_content(Args, Pld); | |
false -> | |
{{error, up}, unexpected_data} | |
end; | |
parse_header(Args, _) -> | |
{{error, up}, unexpected_data}. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment