Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rf60Xprotocol
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RFSDK60X
protocols
rf60Xprotocol
Commits
a42a37f6
Commit
a42a37f6
authored
4 years ago
by
Никита Кожуро
Browse files
Options
Downloads
Patches
Plain Diff
Initial commit
parents
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
rf60X_protocol.c
+44
-0
44 additions, 0 deletions
rf60X_protocol.c
rf60X_protocol.h
+18
-0
18 additions, 0 deletions
rf60X_protocol.h
with
62 additions
and
0 deletions
rf60X_protocol.c
0 → 100644
+
44
−
0
View file @
a42a37f6
#include
"rf60X_protocol.h"
rfUint32
rf60x_protocol_old_pack_payload_msg_to_user_params_packet
(
rfUint8
*
buffer
,
vector_t
*
params_list
)
{
rfUint8
*
buf
=
&
buffer
[
0
];
for
(
rfSize
i
=
0
;
i
<
vector_count
(
params_list
);
i
++
)
{
parameter_t
*
p
=
vector_get
(
params_list
,
i
);
if
(
p
!=
NULL
)
{
if
(
rf_strcmp
(
pvtKey
[
PVT_BYTE
],
p
->
base
.
type
)
==
0
)
{
memory_platform
.
rf_memcpy
(
&
buf
[
p
->
base
.
offset
],
&
p
->
val_uint8
->
value
,
p
->
base
.
size
);
}
}
}
return
0
;
}
rf60x_udp_measure_t
rf60x_protocol_old_unpack_measure_msg_from_packet
(
rfUint8
*
buffer
,
rf60x_udp_measure_t
*
msg
)
{
rfUint16
i
=
0
;
rfUint8
*
p
=
buffer
;
for
(
i
=
0
;
i
<
168
;
++
i
){
msg
->
rf60xValArray
[
i
].
value
=
get_rfUint16_from_packet
(
&
p
,
kEndianessLittle
);
msg
->
rf60xValArray
[
i
+
1
].
status
=
get_rfUint8_from_packet
(
&
p
);
}
msg
->
deviceSerial
=
get_rfUint16_from_packet
(
&
p
,
kEndianessLittle
);
msg
->
deviceBaseDistance
=
get_rfUint16_from_packet
(
&
p
,
kEndianessLittle
);
msg
->
deviceMeasureRange
=
get_rfUint16_from_packet
(
&
p
,
kEndianessLittle
);
msg
->
packCount
=
get_rfUint8_from_packet
(
&
p
);
msg
->
packetControlSumm
=
get_rfUint8_from_packet
(
&
p
);
return
*
msg
;
}
This diff is collapsed.
Click to expand it.
rf60X_protocol.h
0 → 100644
+
18
−
0
View file @
a42a37f6
#ifndef RF60X_PROTOCOL_H
#define RF60X_PROTOCOL_H
#include
<string.h>
#include
"custom_string.h"
#include
"custom_vector.h"
#include
"endian_conv.h"
#include
"memory_platform.h"
#include
"netwok_platform.h"
#include
"platform_types.h"
rfUint32
rf60x_protocol_old_pack_payload_msg_to_user_params_packet
(
rfUint8
*
buffer
,
vector_t
*
params_list
);
rf60x_udp_measure_t
rf60x_protocol_old_unpack_measure_msg_from_packet
(
rfUint8
*
buffer
,
rf60x_udp_measure_t
*
msg
);
#endif // RF60X_PROTOCOL_H
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment