Added reception debugging
This commit is contained in:
parent
191deb7db3
commit
cb83de4bf5
1 changed files with 4 additions and 0 deletions
|
@ -40,6 +40,7 @@ func (c *Can) Stop() {
|
|||
}
|
||||
|
||||
func (c *Can) Handle(frame can.Frame) {
|
||||
log.Printf("Got CAN frame to 0x%08x", frame.ID)
|
||||
typ, obj, err := DecodeMessage(frame)
|
||||
if err != nil {
|
||||
if err == UnsupportedMessageType {
|
||||
|
@ -50,14 +51,17 @@ func (c *Can) Handle(frame can.Frame) {
|
|||
} else {
|
||||
switch typ {
|
||||
case MessageTypeFeedback:
|
||||
log.Printf("Got feedback message: %+v", obj.(FeedbackMessage))
|
||||
c.swstate = obj.(FeedbackMessage)
|
||||
case MessageTypeFeedbackRequest:
|
||||
// ignore
|
||||
case MessageTypePower:
|
||||
log.Printf("Got power message: %+v", obj.(PowerMessage))
|
||||
// ignore
|
||||
case MessageTypePowerRequest:
|
||||
// ignore
|
||||
case MessageTypeDispense:
|
||||
log.Printf("Got dispense message: %+v", obj.(DispenseMessage))
|
||||
c.dispstate = obj.(DispenseMessage).Slot
|
||||
case MessageTypeAuto:
|
||||
// ignore
|
||||
|
|
Loading…
Reference in a new issue