• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2020 The Pigweed Authors
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may not
4# use this file except in compliance with the License. You may obtain a copy of
5# the License at
6#
7#     https://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations under
13# the License.
14
15load(
16    "//pw_build:pigweed.bzl",
17    "pw_cc_library",
18)
19
20package(default_visibility = ["//visibility:public"])
21
22licenses(["notice"])  # Apache License 2.0
23
24pw_cc_library(
25    name = "pw_hdlc",
26    srcs = [
27        "decoder.cc",
28        "encoder.cc",
29        "public/pw_hdlc/internal/encoder.h",
30        "public/pw_hdlc/internal/protocol.h",
31        "rpc_packets.cc",
32    ],
33    hdrs = [
34        "public/pw_hdlc/decoder.h",
35        "public/pw_hdlc/encoder.h",
36    ],
37    includes = ["public"],
38    deps = [
39        "//pw_bytes",
40        "//pw_checksum",
41        "//pw_log",
42        "//pw_result",
43        "//pw_span",
44        "//pw_status",
45        "//pw_stream",
46        "//pw_varint",
47    ],
48)
49
50pw_cc_library(
51    name = "rpc_channel_output",
52    hdrs = ["public/pw_hdlc/rpc_channel.h"],
53    includes = ["public"],
54    deps = [
55        ":pw_hdlc",
56        "//pw_rpc:server",
57    ],
58)
59
60pw_cc_library(
61    name = "pw_rpc",
62    srcs = ["rpc_packets.cc"],
63    hdrs = ["public/pw_hdlc/rpc_packets.h"],
64    includes = ["public"],
65    deps = [
66        ":pw_hdlc",
67        "//pw_rpc:server",
68    ],
69)
70
71pw_cc_library(
72    name = "packet_parser",
73    srcs = ["wire_packet_parser.cc"],
74    hdrs = ["public/pw_hdlc/wire_packet_parser.h"],
75    includes = ["public"],
76    deps = [
77        ":pw_hdlc",
78        "//pw_assert",
79        "//pw_bytes",
80        "//pw_checksum",
81        "//pw_router:packet_parser",
82    ],
83)
84
85cc_test(
86    name = "encoder_test",
87    srcs = ["encoder_test.cc"],
88    deps = [
89        ":pw_hdlc",
90        "//pw_stream",
91        "//pw_unit_test",
92    ],
93)
94
95cc_test(
96    name = "decoder_test",
97    srcs = ["decoder_test.cc"],
98    deps = [
99        ":pw_hdlc",
100        "//pw_result",
101        "//pw_stream",
102        "//pw_unit_test",
103    ],
104)
105
106cc_test(
107    name = "wire_packet_parser_test",
108    srcs = ["wire_packet_parser_test.cc"],
109    deps = [
110        ":packet_parser",
111        "//pw_bytes",
112    ],
113)
114
115cc_test(
116    name = "rpc_channel_test",
117    srcs = ["rpc_channel_test.cc"],
118    deps = [
119        ":pw_hdlc",
120        "//pw_stream",
121        "//pw_unit_test",
122    ],
123)
124