|
@@ -5,6 +5,7 @@ import (
|
|
|
"fmt"
|
|
"fmt"
|
|
|
"prod2u6400-uartkit/internal/i2creg"
|
|
"prod2u6400-uartkit/internal/i2creg"
|
|
|
"prod2u6400-uartkit/internal/protocol"
|
|
"prod2u6400-uartkit/internal/protocol"
|
|
|
|
|
+ "prod2u6400-uartkit/internal/transport"
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
type SetAll = protocol.SetAll
|
|
type SetAll = protocol.SetAll
|
|
@@ -12,10 +13,13 @@ type Frame = protocol.Frame
|
|
|
type Ack = protocol.Ack
|
|
type Ack = protocol.Ack
|
|
|
type I2CTransaction = i2creg.Transaction
|
|
type I2CTransaction = i2creg.Transaction
|
|
|
|
|
|
|
|
-type UARTTransport interface {
|
|
|
|
|
|
|
+type UARTTransport = transport.UARTTransport
|
|
|
|
|
+type I2CRegisterTransport interface {
|
|
|
WriteSetAll(context.Context, SetAll) error
|
|
WriteSetAll(context.Context, SetAll) error
|
|
|
GetSnapshot(context.Context) ([]byte, error)
|
|
GetSnapshot(context.Context) ([]byte, error)
|
|
|
}
|
|
}
|
|
|
|
|
+type MockTransport = transport.MockTransport
|
|
|
|
|
+type ReplayTransport = transport.ReplayTransport
|
|
|
|
|
|
|
|
func SetAllFrame(s SetAll) ([]byte, error) { return protocol.EncodeSetAll(s) }
|
|
func SetAllFrame(s SetAll) ([]byte, error) { return protocol.EncodeSetAll(s) }
|
|
|
func GetSnapshotFrame() []byte { return protocol.EncodeGetSnapshot() }
|
|
func GetSnapshotFrame() []byte { return protocol.EncodeGetSnapshot() }
|