Main Page
Namespaces
Namespace List
Namespace Members
All
Functions
Enumerations
Enumerator
Classes
Class List
Class Hierarchy
Class Members
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
~
Functions
a
b
c
d
e
f
g
h
i
k
l
m
o
p
r
s
t
u
w
~
Variables
a
b
c
d
e
f
h
i
l
m
n
p
q
r
s
t
u
v
w
Typedefs
Enumerations
Enumerator
Files
File List
File Members
All
Functions
Typedefs
Enumerations
Enumerator
Macros
src
pf
pf_packet
pf_r2000_packet_c.cpp
Go to the documentation of this file.
1
#include "
pf_driver/pf/pf_packet/pf_r2000_packet_c.h
"
2
#include "
pf_driver/pf/pf_packet_reader.h
"
3
4
void
PFR2000Packet_C::read_with
(
PFPacketReader
& reader)
5
{
6
reader.
read
(*
this
);
7
}
8
9
void
PFR2000Packet_C::get_type
(
char
* c)
10
{
11
c[0] = 0x43;
12
c[1] = 0x00;
13
}
14
15
void
PFR2000Packet_C::read_data
(uint8_t* buf,
size_t
num)
16
{
17
uint32_t* data =
reinterpret_cast<
uint32_t*
>
(buf);
18
distance
.resize(num);
19
amplitude
.resize(num);
20
for
(
int
i = 0; i < num; i++)
21
{
22
uint32_t
d
= data[i];
23
distance
[i] =
d
& 0x000FFFFF;
24
amplitude
[i] = (
d
& 0xFFFFF000) >> 20;
25
}
26
}
PFPacket::distance
std::vector< uint32_t > distance
Definition:
pf_packet.h:13
PFR2000Packet_C::get_type
virtual void get_type(char *c)
Definition:
pf_r2000_packet_c.cpp:9
PFR2000Packet_C::read_with
virtual void read_with(PFPacketReader &reader)
Definition:
pf_r2000_packet_c.cpp:4
PFPacket::amplitude
std::vector< uint16_t > amplitude
Definition:
pf_packet.h:14
PFR2000Packet_C::read_data
virtual void read_data(uint8_t *buf, size_t num)
Definition:
pf_r2000_packet_c.cpp:15
d
d
pf_r2000_packet_c.h
pf_packet_reader.h
PFPacketReader
Definition:
pf_packet_reader.h:11
PFPacketReader::read
virtual void read(std::shared_ptr< PFPacket > packet)
Definition:
pf_packet_reader.cpp:3
pf_driver
Author(s): Harsh Deshpande
autogenerated on Sun Feb 4 2024 03:32:56