Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Vladislav Rykov
gateway_protocol
Commits
132ea374
Commit
132ea374
authored
Mar 31, 2020
by
vladislav
Browse files
bug fixes
parent
e1e8ab40
Changes
2
Show whitespace changes
Inline
Side-by-side
gateway_protocol/gateway_protocol.c
View file @
132ea374
...
...
@@ -12,13 +12,16 @@ void gateway_protocol_packet_encode (
*
packet_length
=
0
;
packet
[
*
packet_length
]
=
dev_id
;
packet_length
++
;
(
*
packet_length
)
++
;
packet
[
*
packet_length
]
=
packet_type
;
(
*
packet_length
)
++
;
packet
[
*
packet_length
]
=
payload_length
;
(
*
packet_length
)
++
;
memcpy
(
&
packet
[
*
packet_length
],
payload
,
payload_length
);
*
packet_length
+=
payload_length
;
(
*
packet_length
)
+=
payload_length
;
}
uint8_t
gateway_protocol_packet_decode
(
...
...
@@ -37,6 +40,7 @@ uint8_t gateway_protocol_packet_decode (
*
packet_type
=
(
gateway_protocol_packet_type_t
)
packet
[
p_len
];
p_len
++
;
p_len
++
;
*
payload_length
=
packet_length
-
p_len
;
memcpy
(
payload
,
&
packet
[
p_len
],
*
payload_length
);
...
...
gateway_protocol/gateway_protocol.h
View file @
132ea374
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment