Skip to content

Commit 4b1e58c

Browse files
committed
更换go.mod 名称为 github.com/20yyq/can-debugger
1 parent c999adc commit 4b1e58c

File tree

8 files changed

+49
-56
lines changed

8 files changed

+49
-56
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@ golang network can bus
2323
./candebugber vcan0 write -id 12345 -data string -flags 16 -fd=0 -ext=1
2424

2525
# iface 设备开启关闭
26-
./candebugber vcan0 iface -bitrate 1250000 -up=true
27-
./candebugber vcan0 iface -up=F
26+
./candebugber can0 iface -bitrate 125000 -up=true
27+
./candebugber can0 iface -up=F
2828
# 直接关闭设备
29-
./candebugber vcan0 iface
29+
./candebugber can0 iface
3030

3131
# iface 虚拟CAN设备开启
32-
./candebugber vcan0 iface -type vcan -bitrate 1250000 -up=true
32+
./candebugber vcan0 iface -type vcan -bitrate 125000 -up=true
33+

flag/can.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// @@
22
// @ Author : Eacher
33
// @ Date : 2023-09-06 13:56:59
4-
// @ LastEditTime : 2023-09-20 16:45:39
4+
// @ LastEditTime : 2024-01-09 16:29:37
55
// @ LastEditors : Eacher
66
// @ --------------------------------------------------------------------------------<
7-
// @ Description :
7+
// @ Description :
88
// @ --------------------------------------------------------------------------------<
99
// @ FilePath : /20yyq/can-debugger/flag/can.go
1010
// @@
@@ -14,13 +14,13 @@ import (
1414
"flag"
1515
"fmt"
1616
"os"
17-
"syscall"
1817
"os/signal"
18+
"syscall"
1919

20-
"github.com/20yyq/can/sockcan"
21-
"github.com/20yyq/can/read"
22-
"github.com/20yyq/can/write"
23-
"github.com/20yyq/can/iface"
20+
"github.com/20yyq/can-debugger/iface"
21+
"github.com/20yyq/can-debugger/read"
22+
"github.com/20yyq/can-debugger/sockcan"
23+
"github.com/20yyq/can-debugger/write"
2424
)
2525

2626
type FlagSetFunc func(*flag.FlagSet)
@@ -55,7 +55,7 @@ const helpOutput = `
5555

5656
var (
5757
canInterfaceName string
58-
canDebuggerName string
58+
canDebuggerName string
5959
)
6060

6161
var (
@@ -72,10 +72,10 @@ func init() {
7272
os.Exit(1)
7373
}
7474
canInterfaceName, canDebuggerName = os.Args[1], os.Args[2]
75-
runMap = map[string]func() error {
76-
"read" : readRuning,
77-
"write" : writeRuning,
78-
"iface" : ifaceRuning,
75+
runMap = map[string]func() error{
76+
"read": readRuning,
77+
"write": writeRuning,
78+
"iface": ifaceRuning,
7979
}
8080
}
8181

@@ -138,7 +138,7 @@ func sockcanRuning(f func(*sockcan.Can)) error {
138138
func listening(notify chan struct{}, stop <-chan struct{}) {
139139
quit := make(chan os.Signal)
140140
signal.Notify(quit, syscall.SIGINT, syscall.SIGQUIT, syscall.SIGTERM, syscall.SIGTSTP)
141-
select{
141+
select {
142142
case <-stop:
143143
case <-quit:
144144
}

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
module github.com/20yyq/can
1+
module github.com/20yyq/can-debugger
22

33
go 1.20
44

5-
require golang.org/x/sys v0.12.0
5+
require golang.org/x/sys v0.13.0
66

77
require (
88
github.com/20yyq/netlink v0.0.0-20230920054343-ca8d8bc8ad3d

go.sum

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
1-
github.com/20yyq/netlink v0.0.0-20230916012726-081eed4e0df7 h1:BV96VUFCfQapg+VtuwE1ad6faX+Eu/744HwDqUwMp7I=
2-
github.com/20yyq/netlink v0.0.0-20230916012726-081eed4e0df7/go.mod h1:u8T5mH3H5NzpnVqRkevQxv3rGAWM7LdOADBj1IsXVF0=
3-
github.com/20yyq/netlink v0.0.0-20230918025521-70083e2f0988 h1:kdr9Xai/NbUHRPSdbaCzpNS5KVZJFtJYMg4mHeg0V4I=
4-
github.com/20yyq/netlink v0.0.0-20230918025521-70083e2f0988/go.mod h1:SqIdVGR/JmP1tDFgz298rpH83/XvdH1l3z9snrxqKnU=
51
github.com/20yyq/netlink v0.0.0-20230920054343-ca8d8bc8ad3d h1:D+3b7ED0UfJBjCcet6xggjzDo76hJa/lsGA29+WrcDg=
62
github.com/20yyq/netlink v0.0.0-20230920054343-ca8d8bc8ad3d/go.mod h1:SqIdVGR/JmP1tDFgz298rpH83/XvdH1l3z9snrxqKnU=
7-
github.com/20yyq/packet v0.1.4-0.20230916072213-3666895fc50a h1:E97E1zN2lG3Z0gbxWySJVCmcTVcewsmbLCxz4To6x1U=
8-
github.com/20yyq/packet v0.1.4-0.20230916072213-3666895fc50a/go.mod h1:A4zhpIl5kFE5oP65EQi/IkTn3xqo3smzZ6yqiBaxl7I=
9-
github.com/20yyq/packet v0.1.4-0.20230918031534-3c30c2b2a78e h1:FntMuKeK9ka2ehXUa3riFo5nEY8N2epk61nc6j/G7LA=
10-
github.com/20yyq/packet v0.1.4-0.20230918031534-3c30c2b2a78e/go.mod h1:A4zhpIl5kFE5oP65EQi/IkTn3xqo3smzZ6yqiBaxl7I=
113
github.com/20yyq/packet v0.1.4-0.20230920035016-fd1212fc6ec6 h1:UthtOiDW6OaI4gvL3O8Q9DIWYZkSFS8KtYe6bJYTphg=
124
github.com/20yyq/packet v0.1.4-0.20230920035016-fd1212fc6ec6/go.mod h1:A4zhpIl5kFE5oP65EQi/IkTn3xqo3smzZ6yqiBaxl7I=
13-
golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o=
14-
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
5+
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
6+
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=

main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
// @@
22
// @ Author : Eacher
33
// @ Date : 2023-09-02 11:02:03
4-
// @ LastEditTime : 2023-09-16 16:00:19
4+
// @ LastEditTime : 2024-01-09 16:29:24
55
// @ LastEditors : Eacher
66
// @ --------------------------------------------------------------------------------<
7-
// @ Description :
7+
// @ Description :
88
// @ --------------------------------------------------------------------------------<
99
// @ FilePath : /20yyq/can-debugger/main.go
1010
// @@
1111
package main
1212

1313
import (
14-
"os"
1514
"fmt"
15+
"os"
1616

17-
"github.com/20yyq/can/flag"
17+
"github.com/20yyq/can-debugger/flag"
1818
)
1919

2020
func main() {

read/can.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
// @@
22
// @ Author : Eacher
33
// @ Date : 2023-09-06 14:47:15
4-
// @ LastEditTime : 2023-09-20 15:14:46
4+
// @ LastEditTime : 2024-01-09 16:29:16
55
// @ LastEditors : Eacher
66
// @ --------------------------------------------------------------------------------<
7-
// @ Description :
7+
// @ Description :
88
// @ --------------------------------------------------------------------------------<
99
// @ FilePath : /20yyq/can-debugger/read/can.go
1010
// @@
1111
package read
1212

1313
import (
1414
"fmt"
15-
16-
"github.com/20yyq/can/sockcan"
15+
16+
"github.com/20yyq/can-debugger/sockcan"
1717
"github.com/20yyq/packet/can"
1818
)
1919

sockcan/sockcan_linux.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
// @@
22
// @ Author : Eacher
33
// @ Date : 2023-09-06 14:55:23
4-
// @ LastEditTime : 2023-09-20 15:44:40
4+
// @ LastEditTime : 2024-01-02 09:17:49
55
// @ LastEditors : Eacher
66
// @ --------------------------------------------------------------------------------<
7-
// @ Description :
7+
// @ Description :
88
// @ --------------------------------------------------------------------------------<
99
// @ FilePath : /20yyq/can-debugger/sockcan/sockcan_linux.go
1010
// @@
1111
package sockcan
1212

1313
import (
14+
"io"
1415
"net"
1516
"os"
16-
"io"
1717
"syscall"
1818

1919
"github.com/20yyq/packet/can"
20-
20+
2121
"golang.org/x/sys/unix"
2222
)
2323

@@ -30,7 +30,7 @@ func NewCan(dev string) (*Can, error) {
3030
return nil, err
3131
}
3232
f := os.NewFile(uintptr(fd), dev)
33-
fun := func (fd uintptr) {
33+
fun := func(fd uintptr) {
3434
syscall.SetsockoptInt(int(fd), unix.SOL_CAN_RAW, unix.CAN_RAW_FD_FRAMES, 1)
3535
}
3636
var rawConn syscall.RawConn
@@ -47,7 +47,7 @@ func NewCan(dev string) (*Can, error) {
4747
type HandlerFunc func(can.Frame)
4848

4949
type Can struct {
50-
rwc io.ReadWriteCloser
50+
rwc io.ReadWriteCloser
5151
}
5252

5353
func (c *Can) ReadFrame() (f can.Frame, err error) {
@@ -73,4 +73,4 @@ func (c *Can) WriteFrame(frame can.Frame) error {
7373

7474
func (c *Can) Disconnect() error {
7575
return c.rwc.Close()
76-
}
76+
}

write/can.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
// @@
22
// @ Author : Eacher
33
// @ Date : 2023-09-06 15:25:10
4-
// @ LastEditTime : 2023-09-11 08:12:35
4+
// @ LastEditTime : 2024-01-09 16:29:12
55
// @ LastEditors : Eacher
66
// @ --------------------------------------------------------------------------------<
7-
// @ Description :
7+
// @ Description :
88
// @ --------------------------------------------------------------------------------<
99
// @ FilePath : /20yyq/can-debugger/write/can.go
1010
// @@
1111
package write
1212

1313
import (
14-
"fmt"
1514
"flag"
16-
17-
"github.com/20yyq/can/sockcan"
15+
"fmt"
16+
17+
"github.com/20yyq/can-debugger/sockcan"
1818
"github.com/20yyq/packet/can"
1919
)
2020

@@ -47,12 +47,12 @@ const helpOutput = `
4747
`
4848

4949
var (
50-
id uint
51-
flags uint
52-
data string
53-
ext bool
54-
remote bool
55-
fd bool
50+
id uint
51+
flags uint
52+
data string
53+
ext bool
54+
remote bool
55+
fd bool
5656
)
5757

5858
func InitFlagArge(f *flag.FlagSet) {
@@ -89,4 +89,4 @@ func Run(c *sockcan.Can) {
8989

9090
func help() {
9191
fmt.Print(helpOutput)
92-
}
92+
}

0 commit comments

Comments
 (0)