Add amqp support

This commit is contained in:
2023-10-14 19:37:39 +03:00
parent 7b7c419f03
commit 234a50adb2
8 changed files with 168 additions and 11 deletions
+2 -2
View File
@@ -52,11 +52,11 @@ func process(scanner *bufio.Scanner, ch chan<- *CanFrame) {
}
}
func ReadStdin() <-chan *CanFrame {
func ReadStdin(file *os.File) <-chan *CanFrame {
c := make(chan *CanFrame)
go func() {
scanner := bufio.NewScanner(os.Stdin)
scanner := bufio.NewScanner(file)
process(scanner, c)
close(c)
}()
+2 -2
View File
@@ -36,7 +36,7 @@ func Test_fromString(t *testing.T) {
want: &CanFrame{
Date: &time_m,
CanId: 0x4021,
Payload: []uint8{00, 00, 00, 00, 0xFC, 0xFF, 0xFF, 0xFF},
Payload: &[]uint8{00, 00, 00, 00, 0xFC, 0xFF, 0xFF, 0xFF},
},
},
{
@@ -45,7 +45,7 @@ func Test_fromString(t *testing.T) {
want: &CanFrame{
Date: &time_p,
CanId: 0x100,
Payload: []uint8{00, 00, 00, 00, 00, 00, 0x64, 00},
Payload: &[]uint8{00, 00, 00, 00, 00, 00, 0x64, 00},
},
},
}