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"]) 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 ], 32 hdrs = [ 33 "public/pw_hdlc/decoder.h", 34 "public/pw_hdlc/encoder.h", 35 ], 36 includes = ["public"], 37 deps = [ 38 "//pw_bytes", 39 "//pw_checksum", 40 "//pw_log", 41 "//pw_result", 42 "//pw_span", 43 "//pw_status", 44 "//pw_stream", 45 "//pw_varint", 46 ], 47) 48 49pw_cc_library( 50 name = "rpc_channel_output", 51 hdrs = ["public/pw_hdlc/rpc_channel.h"], 52 includes = ["public"], 53 deps = [ 54 ":pw_hdlc", 55 "//pw_rpc", 56 ], 57) 58 59pw_cc_library( 60 name = "pw_rpc", 61 srcs = ["rpc_packets.cc"], 62 hdrs = ["public/pw_hdlc/rpc_packets.h"], 63 includes = ["public"], 64 deps = [ 65 ":pw_hdlc", 66 "//pw_rpc", 67 ], 68) 69 70pw_cc_library( 71 name = "packet_parser", 72 srcs = ["wire_packet_parser.cc"], 73 hdrs = ["public/pw_hdlc/wire_packet_parser.h"], 74 includes = ["public"], 75 deps = [ 76 ":pw_hdlc", 77 "//pw_assert", 78 "//pw_bytes", 79 "//pw_checksum", 80 "//pw_router:packet_parser", 81 ], 82) 83 84cc_test( 85 name = "encoder_test", 86 srcs = ["encoder_test.cc"], 87 deps = [ 88 ":pw_hdlc", 89 "//pw_stream", 90 "//pw_unit_test", 91 ], 92) 93 94cc_test( 95 name = "decoder_test", 96 srcs = ["decoder_test.cc"], 97 deps = [ 98 ":pw_hdlc", 99 "//pw_result", 100 "//pw_stream", 101 "//pw_unit_test", 102 ], 103) 104 105cc_test( 106 name = "wire_packet_parser_test", 107 srcs = ["wire_packet_parser_test.cc"], 108 deps = [ 109 ":packet_parser", 110 "//pw_bytes", 111 ], 112) 113 114cc_test( 115 name = "rpc_channel_test", 116 srcs = ["rpc_channel_test.cc"], 117 deps = [ 118 ":pw_hdlc", 119 "//pw_stream", 120 "//pw_unit_test", 121 ], 122) 123