blob: 9463dbc1bc6cdc2dc563790db43768c68dce1bcd [file] [log] [blame]
shaneajg0869f2c2020-07-08 10:39:14 -04001# 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(
Alexei Frolovd3e5cb72021-01-08 13:08:45 -080025 name = "pw_hdlc",
shaneajg0869f2c2020-07-08 10:39:14 -040026 srcs = [
Wyatt Heplercdb0f4e2020-09-14 08:49:17 -070027 "decoder.cc",
28 "encoder.cc",
Alexei Frolov44cd9522021-01-13 11:31:59 -080029 "public/pw_hdlc/internal/encoder.h",
Alexei Frolovb9fda582021-03-13 18:02:52 -080030 "public/pw_hdlc/internal/protocol.h",
Wyatt Heplerd427aa32020-09-18 09:09:34 -070031 "rpc_packets.cc",
Wyatt Heplercdb0f4e2020-09-14 08:49:17 -070032 ],
33 hdrs = [
Alexei Frolovd3e5cb72021-01-08 13:08:45 -080034 "public/pw_hdlc/decoder.h",
35 "public/pw_hdlc/encoder.h",
shaneajg0869f2c2020-07-08 10:39:14 -040036 ],
37 includes = ["public"],
shaneajg02d127a2020-08-11 12:54:56 -040038 deps = [
Wyatt Heplercdb0f4e2020-09-14 08:49:17 -070039 "//pw_bytes",
40 "//pw_checksum",
shaneajg02d127a2020-08-11 12:54:56 -040041 "//pw_log",
Wyatt Heplercdb0f4e2020-09-14 08:49:17 -070042 "//pw_result",
shaneajg02d127a2020-08-11 12:54:56 -040043 "//pw_span",
44 "//pw_status",
45 "//pw_stream",
Alexei Frolovb9fda582021-03-13 18:02:52 -080046 "//pw_varint",
shaneajg02d127a2020-08-11 12:54:56 -040047 ],
48)
49
Wyatt Hepler51ee98e2020-09-18 09:09:50 -070050pw_cc_library(
Alexei Frolove39af8d2020-12-30 14:55:09 -080051 name = "rpc_channel_output",
Alexei Frolovd3e5cb72021-01-08 13:08:45 -080052 hdrs = ["public/pw_hdlc/rpc_channel.h"],
Alexei Frolove39af8d2020-12-30 14:55:09 -080053 includes = ["public"],
54 deps = [
Alexei Frolovd3e5cb72021-01-08 13:08:45 -080055 ":pw_hdlc",
Alexei Frolove39af8d2020-12-30 14:55:09 -080056 "//pw_rpc:server",
57 ],
58)
59
60pw_cc_library(
Wyatt Hepler51ee98e2020-09-18 09:09:50 -070061 name = "pw_rpc",
62 srcs = ["rpc_packets.cc"],
Alexei Frolovd3e5cb72021-01-08 13:08:45 -080063 hdrs = ["public/pw_hdlc/rpc_packets.h"],
Wyatt Hepler51ee98e2020-09-18 09:09:50 -070064 includes = ["public"],
65 deps = [
Alexei Frolovd3e5cb72021-01-08 13:08:45 -080066 ":pw_hdlc",
Wyatt Hepler51ee98e2020-09-18 09:09:50 -070067 "//pw_rpc:server",
68 ],
69)
70
Alexei Frolov5039a812021-01-20 15:14:06 -080071pw_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
shaneajge6d3a612020-07-23 18:40:28 -040085cc_test(
86 name = "encoder_test",
87 srcs = ["encoder_test.cc"],
88 deps = [
Alexei Frolovd3e5cb72021-01-08 13:08:45 -080089 ":pw_hdlc",
shaneajge6d3a612020-07-23 18:40:28 -040090 "//pw_stream",
91 "//pw_unit_test",
92 ],
93)
shaneajg063d0e02020-08-03 11:57:41 -040094
95cc_test(
96 name = "decoder_test",
97 srcs = ["decoder_test.cc"],
98 deps = [
Alexei Frolovd3e5cb72021-01-08 13:08:45 -080099 ":pw_hdlc",
Wyatt Heplercdb0f4e2020-09-14 08:49:17 -0700100 "//pw_result",
shaneajg063d0e02020-08-03 11:57:41 -0400101 "//pw_stream",
102 "//pw_unit_test",
shaneajg063d0e02020-08-03 11:57:41 -0400103 ],
104)
shaneajg0c527732020-08-07 11:51:25 -0400105
106cc_test(
Alexei Frolov5039a812021-01-20 15:14:06 -0800107 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(
Wyatt Heplerd427aa32020-09-18 09:09:34 -0700116 name = "rpc_channel_test",
117 srcs = ["rpc_channel_test.cc"],
shaneajg0c527732020-08-07 11:51:25 -0400118 deps = [
Alexei Frolovd3e5cb72021-01-08 13:08:45 -0800119 ":pw_hdlc",
shaneajg0c527732020-08-07 11:51:25 -0400120 "//pw_stream",
121 "//pw_unit_test",
122 ],
123)