Apollo 10.0
自动驾驶开放平台
can_stream.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2017 The Apollo Authors. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *****************************************************************************/
16
17#pragma once
18
19#include <memory>
20
21#include "modules/common_msgs/drivers_msgs/can_card_parameter.pb.h"
22
25
26namespace apollo {
27namespace drivers {
28namespace gnss {
29
30class CanStream : public Stream {
31 public:
32 explicit CanStream(
34 ~CanStream();
35
36 virtual bool Connect();
37 virtual bool Disconnect();
38 virtual size_t read(uint8_t *buffer, size_t max_length);
39 virtual size_t write(const uint8_t *data, size_t length);
40
41 private:
43 std::unique_ptr<apollo::drivers::canbus::CanClient> can_client_;
44};
45
46} // namespace gnss
47} // namespace drivers
48} // namespace apollo
Defines the CanFrame struct and CanClient interface.
virtual size_t read(uint8_t *buffer, size_t max_length)
Definition can_stream.cc:57
virtual size_t write(const uint8_t *data, size_t length)
Definition can_stream.cc:69
class register implement
Definition arena_queue.h:37