Documentation
¶
Index ¶
- type InputDevice
- type ShmReader
- func (s *ShmReader) Check() (int, error)
- func (s *ShmReader) Clean() error
- func (s *ShmReader) Close() error
- func (s *ShmReader) GetDist(playerID uint) (uint, error)
- func (s *ShmReader) GetPlayerCount() uint
- func (s *ShmReader) Init(ports []string, samplingRate uint, falseStart uint) error
- func (s *ShmReader) Start() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InputDevice ¶
type InputDevice interface { Init(players []string, threshold uint, falseStart uint) error // initialization of a device Start() error // start the device GetDist(playerID uint) (uint, error) // returns actual distance ridden by the given player GetPlayerCount() uint // returns player count initialized Clean() error // resets players distance to 0 Check() (int, error) // checks if any player has exceeded the falseStart distance Close() error // performs cleanups: closes all devices, files etc. }
InputDevice -
func SetupDevice ¶
func SetupDevice(deviceConf string, samplingRate uint, failstartThreshold uint) (device InputDevice, err error)
SetupDevice parses device configuration string and returns proper InputDevice interface implementation already initiaited
type ShmReader ¶
type ShmReader struct {
// contains filtered or unexported fields
}
ShmReader represents SHM connection to read players distance; implements InputDevice
func (*ShmReader) Check ¶
Check checks whether in any of the input SHM files distance of the allowed falseStart was exceeded
func (*ShmReader) GetPlayerCount ¶
GetPlayerCount returns number of players that were defined
Click to show internal directories.
Click to hide internal directories.