Skip to content

Commit 4d1d2a3

Browse files
committed
Move libhoth transports to transports folder
1 parent 3d8327e commit 4d1d2a3

29 files changed

+173
-131
lines changed

.github/workflows/clang-format.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ jobs:
1010
uses: jidicula/[email protected]
1111
with:
1212
clang-format-version: '13'
13-
check-path: 'src'
13+
check-path: 'transport'
1414
fallback-style: 'Google' # optional

BUILD

Lines changed: 4 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
package(default_visibility = ["//visibility:public"])
22

3-
cc_library(
4-
name = "libhoth",
5-
srcs = ["libhoth.c"],
6-
hdrs = ["libhoth.h"],
7-
)
8-
93
cc_library(
104
name = "git_version",
115
hdrs = [":gen_version_header"],
@@ -20,63 +14,10 @@ genrule(
2014
)
2115

2216
cc_library(
23-
name = "libhoth_ec",
24-
hdrs = ["libhoth_ec.h"],
25-
)
26-
27-
cc_library(
28-
name = "libhoth_mtd",
29-
srcs = ["libhoth_mtd.c"],
30-
hdrs = ["libhoth_mtd.h"],
31-
deps = [
32-
":libhoth",
33-
":libhoth_ec",
34-
],
35-
)
36-
37-
cc_library(
38-
name = "libhoth_spi",
39-
srcs = ["libhoth_spi.c"],
40-
hdrs = ["libhoth_spi.h"],
41-
deps = [
42-
":libhoth",
43-
":libhoth_ec",
44-
],
45-
)
46-
47-
cc_library(
48-
name = "libhoth_usb",
49-
srcs = ["libhoth_usb.c"],
50-
hdrs = ["libhoth_usb.h"],
51-
deps = [
52-
":libhoth",
53-
":libhoth_usb_device",
54-
"@libusb//:libusb",
55-
],
56-
)
57-
58-
cc_library(
59-
name = "libhoth_dbus",
60-
srcs = ["libhoth_dbus.c"],
61-
hdrs = ["libhoth_dbus.h"],
62-
linkopts = ["-lsystemd"],
63-
defines = ["DBUS_BACKEND"],
64-
deps = [
65-
":libhoth",
66-
],
67-
)
68-
69-
70-
cc_library(
71-
name = "libhoth_usb_device",
72-
srcs = [
73-
"libhoth_usb_fifo.c",
74-
"libhoth_usb_mailbox.c",
75-
],
76-
hdrs = ["libhoth_usb_device.h"],
17+
name = "libhoth",
18+
srcs = ["libhoth.c"],
19+
hdrs = ["libhoth.h"],
7720
deps = [
78-
":libhoth",
79-
":libhoth_ec",
80-
"@libusb//:libusb",
21+
"//transports:libhoth_device",
8122
],
8223
)

examples/BUILD

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,13 @@ cc_binary(
9292
":srtm",
9393
"//:git_version",
9494
"//:libhoth",
95-
"//:libhoth_mtd",
96-
"//:libhoth_spi",
97-
"//:libhoth_usb",
95+
"//transports:libhoth_device",
96+
"//transports:libhoth_mtd",
97+
"//transports:libhoth_spi",
98+
"//transports:libhoth_usb",
9899
"@libusb//:libusb",
99100
] + select({
100-
":dbus_backend" : ["//:libhoth_dbus"],
101+
":dbus_backend": ["//transports:libhoth_dbus"],
101102
"//conditions:default": [],
102-
})
103+
}),
103104
)

examples/htool.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include <unistd.h>
3030

3131
#include "../libhoth.h"
32+
#include "../transports/libhoth_device.h"
3233
#include "authorization_record.h"
3334
#include "ec_util.h"
3435
#include "host_commands.h"

examples/htool_console.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include <termios.h>
2626
#include <unistd.h>
2727

28-
#include "../libhoth.h"
28+
#include "../transports/libhoth_device.h"
2929
#include "ec_util.h"
3030
#include "host_commands.h"
3131
#include "htool.h"

examples/htool_mtd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include <stdlib.h>
2020
#include <string.h>
2121

22-
#include "../libhoth_mtd.h"
22+
#include "../transports/libhoth_mtd.h"
2323
#include "ec_util.h"
2424
#include "host_commands.h"
2525
#include "htool.h"

examples/htool_raw_host_command.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include <stdlib.h>
1818
#include <unistd.h>
1919

20-
#include "../libhoth.h"
20+
#include "../transports/libhoth_device.h"
2121
#include "ec_util.h"
2222
#include "host_commands.h"
2323
#include "htool.h"

examples/htool_spi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include <stdlib.h>
2020
#include <string.h>
2121

22-
#include "../libhoth_spi.h"
22+
#include "../transports/libhoth_spi.h"
2323
#include "ec_util.h"
2424
#include "host_commands.h"
2525
#include "htool.h"

examples/htool_spi_proxy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
// for MIN()
2121
#include <sys/param.h>
2222

23-
#include "../libhoth.h"
23+
#include "../transports/libhoth_device.h"
2424
#include "host_commands.h"
2525
#include "htool.h"
2626
#include "htool_progress.h"

examples/htool_usb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include <string.h>
2424
#include <unistd.h>
2525

26-
#include "../libhoth_usb.h"
26+
#include "../transports/libhoth_usb.h"
2727
#include "ec_util.h"
2828
#include "host_commands.h"
2929
#include "htool_cmd.h"

0 commit comments

Comments
 (0)