dataunnpacker_internal.h
Go to the documentation of this file.
1 /*
2  * Slamtec LIDAR SDK
3  *
4  * Copyright (c) 2014 - 2023 Shanghai Slamtec Co., Ltd.
5  * http://www.slamtec.com
6  *
7  */
8 
9  /*
10  * Sample Data Unpacker System
11  * Internal Definition
12  */
13 
14  /*
15  * Redistribution and use in source and binary forms, with or without
16  * modification, are permitted provided that the following conditions are met:
17  *
18  * 1. Redistributions of source code must retain the above copyright notice,
19  * this list of conditions and the following disclaimer.
20  *
21  * 2. Redistributions in binary form must reproduce the above copyright notice,
22  * this list of conditions and the following disclaimer in the documentation
23  * and/or other materials provided with the distribution.
24  *
25  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
27  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
29  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
32  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
33  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
34  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
35  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36  *
37  */
38 
39 #pragma once
40 
42 
43 
45 {
46 public:
48 
49  virtual void publishHQNode(_u64 timestamp_uS, const rplidar_response_measurement_node_hq_t* node) = 0;
50  virtual void publishDecodingErrorMsg(int errorType, _u8 ansType, const void* payload, size_t size) = 0;
51  virtual void publishCustomData(_u8 ansType, _u32 customCode, const void* payload, size_t size) = 0;
52  virtual void publishNewScanReset() = 0;
53 
54 
55  virtual _u64 getCurrentTimestamp_uS() = 0;
56 
57 };
58 
60 {
61 public:
63  virtual ~IDataUnpackerHandler() {}
64 
65 
67 
68  virtual _u8 getSampleAnswerType() const = 0;
69  virtual void onData(LIDARSampleDataUnpackerInner* engine, const _u8* data, size_t size) = 0;
70  virtual void reset() = 0;
71 
72 };
73 
LIDARSampleDataUnpackerInner
Definition: dataunnpacker_internal.h:44
IDataUnpackerHandler::~IDataUnpackerHandler
virtual ~IDataUnpackerHandler()
Definition: dataunnpacker_internal.h:63
sl_lidar_response_measurement_node_hq_t
Definition: sl_lidar_cmd.h:272
BEGIN_DATAUNPACKER_NS
#define BEGIN_DATAUNPACKER_NS()
Definition: dataupacker_namespace.h:4
type
sl_u32 type
Definition: sl_lidar_cmd.h:2
IDataUnpackerHandler::onUnpackerContextSet
virtual void onUnpackerContextSet(LIDARSampleDataUnpacker::UnpackerContextType type, const void *data, size_t size)=0
LIDARSampleDataUnpackerInner::LIDARSampleDataUnpackerInner
LIDARSampleDataUnpackerInner(LIDARSampleDataListener &l)
Definition: dataunnpacker_internal.h:47
_u8
uint8_t _u8
Definition: rptypes.h:63
size
sl_u8 size
Definition: sl_lidar_protocol.h:4
payload
sl_u8 payload[0]
Definition: sl_lidar_cmd.h:3
LIDARSampleDataUnpacker
Definition: dataunpacker.h:59
LIDARSampleDataUnpacker::UnpackerContextType
UnpackerContextType
Definition: dataunpacker.h:67
IDataUnpackerHandler::onData
virtual void onData(LIDARSampleDataUnpackerInner *engine, const _u8 *data, size_t size)=0
LIDARSampleDataListener
Definition: dataunpacker.h:47
IDataUnpackerHandler::reset
virtual void reset()=0
_u64
uint64_t _u64
Definition: rptypes.h:72
IDataUnpackerHandler::getSampleAnswerType
virtual _u8 getSampleAnswerType() const =0
data
sl_u8 data[0]
Definition: sl_lidar_protocol.h:5
END_DATAUNPACKER_NS
#define END_DATAUNPACKER_NS()
Definition: dataupacker_namespace.h:5
IDataUnpackerHandler::IDataUnpackerHandler
IDataUnpackerHandler()
Definition: dataunnpacker_internal.h:62
_u32
uint32_t _u32
Definition: rptypes.h:69
IDataUnpackerHandler
Definition: dataunnpacker_internal.h:59


rplidar_ros
Author(s):
autogenerated on Fri Aug 2 2024 08:42:13