Merge pull request #80 from hybridgroup/enable-stop-on-disconnect
Enable stop on disconnect
This commit is contained in:
commit
31e28f9700
|
@ -130,6 +130,7 @@ func (s *SpheroDriver) Start() bool {
|
|||
}()
|
||||
|
||||
s.configureCollisionDetection()
|
||||
s.enableStopOnDisconnect()
|
||||
|
||||
return true
|
||||
}
|
||||
|
@ -178,6 +179,10 @@ func (s *SpheroDriver) configureCollisionDetection() {
|
|||
s.packetChannel <- s.craftPacket([]uint8{0x01, 0x40, 0x40, 0x50, 0x50, 0x60}, 0x12)
|
||||
}
|
||||
|
||||
func (s *SpheroDriver) enableStopOnDisconnect() {
|
||||
s.packetChannel <- s.craftPacket([]uint8{0x00, 0x00, 0x00, 0x01}, 0x37)
|
||||
}
|
||||
|
||||
func (s *SpheroDriver) handleCollisionDetected(data []uint8) {
|
||||
gobot.Publish(s.Event("collision"), data)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue