"""
Autogenerated python message buffer code.
Source: clad/types/switchboardToRobot.clad
Full command line: victor-clad/tools/message-buffers/emitters/Python_emitter.py -C src -I clad/src lib/util/source/anki/clad robot/clad/src coretech/vision/clad_src coretech/common/clad_src -o generated/cladPython clad/types/switchboardToRobot.clad
"""

from __future__ import absolute_import
from __future__ import print_function

def _modify_path():
  import inspect, os, sys
  search_paths = [
    '../..',
    '../../../../victor-clad/tools/message-buffers/support/python',
  ]
  currentpath = os.path.abspath(os.path.dirname(inspect.getfile(inspect.currentframe())))
  for search_path in search_paths:
    search_path = os.path.normpath(os.path.abspath(os.path.realpath(os.path.join(currentpath, search_path))))
    if search_path not in sys.path:
      sys.path.insert(0, search_path)
_modify_path()

import msgbuffers

Anki = msgbuffers.Namespace()
Anki.Vector = msgbuffers.Namespace()
Anki.Vector.SwitchboardInterface = msgbuffers.Namespace()

class ConnectionStatus(object):
  "Automatically-generated uint_8 enumeration."
  NONE              = 0
  START_PAIRING     = 1
  SHOW_PRE_PIN      = 2
  SHOW_PIN          = 3
  SETTING_WIFI      = 4
  UPDATING_OS       = 5
  UPDATING_OS_ERROR = 6
  WAITING_FOR_APP   = 7
  SHOW_URL_FACE     = 8
  END_PAIRING       = 9
  COUNT             = 10

Anki.Vector.SwitchboardInterface.ConnectionStatus = ConnectionStatus
del ConnectionStatus


class SetConnectionStatus(object):
  "Generated message-passing message."

  __slots__ = (
    '_status', # Anki.Vector.SwitchboardInterface.ConnectionStatus
  )

  @property
  def status(self):
    "Anki.Vector.SwitchboardInterface.ConnectionStatus status struct property."
    return self._status

  @status.setter
  def status(self, value):
    self._status = msgbuffers.validate_integer(
      'SetConnectionStatus.status', value, 0, 255)

  def __init__(self, status=Anki.Vector.SwitchboardInterface.ConnectionStatus.NONE):
    self.status = status

  @classmethod
  def unpack(cls, buffer):
    "Reads a new SetConnectionStatus from the given buffer."
    reader = msgbuffers.BinaryReader(buffer)
    value = cls.unpack_from(reader)
    if reader.tell() != len(reader):
      raise msgbuffers.ReadError(
        ('SetConnectionStatus.unpack received a buffer of length {length}, ' +
        'but only {position} bytes were read.').format(
        length=len(reader), position=reader.tell()))
    return value

  @classmethod
  def unpack_from(cls, reader):
    "Reads a new SetConnectionStatus from the given BinaryReader."
    _status = reader.read('B')
    return cls(_status)

  def pack(self):
    "Writes the current SetConnectionStatus, returning bytes."
    writer = msgbuffers.BinaryWriter()
    self.pack_to(writer)
    return writer.dumps()

  def pack_to(self, writer):
    "Writes the current SetConnectionStatus to the given BinaryWriter."
    writer.write(self._status, 'B')

  def __eq__(self, other):
    if type(self) is type(other):
      return self._status == other._status
    else:
      return NotImplemented

  def __ne__(self, other):
    if type(self) is type(other):
      return not self.__eq__(other)
    else:
      return NotImplemented

  def __len__(self):
    return (msgbuffers.size(self._status, 'B'))

  def __str__(self):
    return '{type}(status={status})'.format(
      type=type(self).__name__,
      status=self._status)

  def __repr__(self):
    return '{type}(status={status})'.format(
      type=type(self).__name__,
      status=repr(self._status))

Anki.Vector.SwitchboardInterface.SetConnectionStatus = SetConnectionStatus
del SetConnectionStatus


class SendBLEConnectionStatus(object):
  "Generated message-passing message."

  __slots__ = (
    '_connected', # bool
  )

  @property
  def connected(self):
    "bool connected struct property."
    return self._connected

  @connected.setter
  def connected(self, value):
    self._connected = msgbuffers.validate_bool(
      'SendBLEConnectionStatus.connected', value)

  def __init__(self, connected=False):
    self.connected = connected

  @classmethod
  def unpack(cls, buffer):
    "Reads a new SendBLEConnectionStatus from the given buffer."
    reader = msgbuffers.BinaryReader(buffer)
    value = cls.unpack_from(reader)
    if reader.tell() != len(reader):
      raise msgbuffers.ReadError(
        ('SendBLEConnectionStatus.unpack received a buffer of length {length}, ' +
        'but only {position} bytes were read.').format(
        length=len(reader), position=reader.tell()))
    return value

  @classmethod
  def unpack_from(cls, reader):
    "Reads a new SendBLEConnectionStatus from the given BinaryReader."
    _connected = bool(reader.read('b'))
    return cls(_connected)

  def pack(self):
    "Writes the current SendBLEConnectionStatus, returning bytes."
    writer = msgbuffers.BinaryWriter()
    self.pack_to(writer)
    return writer.dumps()

  def pack_to(self, writer):
    "Writes the current SendBLEConnectionStatus to the given BinaryWriter."
    writer.write(int(self._connected), 'b')

  def __eq__(self, other):
    if type(self) is type(other):
      return self._connected == other._connected
    else:
      return NotImplemented

  def __ne__(self, other):
    if type(self) is type(other):
      return not self.__eq__(other)
    else:
      return NotImplemented

  def __len__(self):
    return (msgbuffers.size(self._connected, 'b'))

  def __str__(self):
    return '{type}(connected={connected})'.format(
      type=type(self).__name__,
      connected=self._connected)

  def __repr__(self):
    return '{type}(connected={connected})'.format(
      type=type(self).__name__,
      connected=repr(self._connected))

Anki.Vector.SwitchboardInterface.SendBLEConnectionStatus = SendBLEConnectionStatus
del SendBLEConnectionStatus


class SetBLEPin(object):
  "Generated message-passing message."

  __slots__ = (
    '_pin', # uint_32
  )

  @property
  def pin(self):
    "uint_32 pin struct property."
    return self._pin

  @pin.setter
  def pin(self, value):
    self._pin = msgbuffers.validate_integer(
      'SetBLEPin.pin', value, 0, 4294967295)

  def __init__(self, pin=0):
    self.pin = pin

  @classmethod
  def unpack(cls, buffer):
    "Reads a new SetBLEPin from the given buffer."
    reader = msgbuffers.BinaryReader(buffer)
    value = cls.unpack_from(reader)
    if reader.tell() != len(reader):
      raise msgbuffers.ReadError(
        ('SetBLEPin.unpack received a buffer of length {length}, ' +
        'but only {position} bytes were read.').format(
        length=len(reader), position=reader.tell()))
    return value

  @classmethod
  def unpack_from(cls, reader):
    "Reads a new SetBLEPin from the given BinaryReader."
    _pin = reader.read('I')
    return cls(_pin)

  def pack(self):
    "Writes the current SetBLEPin, returning bytes."
    writer = msgbuffers.BinaryWriter()
    self.pack_to(writer)
    return writer.dumps()

  def pack_to(self, writer):
    "Writes the current SetBLEPin to the given BinaryWriter."
    writer.write(self._pin, 'I')

  def __eq__(self, other):
    if type(self) is type(other):
      return self._pin == other._pin
    else:
      return NotImplemented

  def __ne__(self, other):
    if type(self) is type(other):
      return not self.__eq__(other)
    else:
      return NotImplemented

  def __len__(self):
    return (msgbuffers.size(self._pin, 'I'))

  def __str__(self):
    return '{type}(pin={pin})'.format(
      type=type(self).__name__,
      pin=self._pin)

  def __repr__(self):
    return '{type}(pin={pin})'.format(
      type=type(self).__name__,
      pin=repr(self._pin))

Anki.Vector.SwitchboardInterface.SetBLEPin = SetBLEPin
del SetBLEPin


class WifiScanResponse(object):
  "Generated message-passing message."

  __slots__ = (
    '_ssid_count',  # uint_32
    '_status_code', # uint_8
  )

  @property
  def ssid_count(self):
    "uint_32 ssid_count struct property."
    return self._ssid_count

  @ssid_count.setter
  def ssid_count(self, value):
    self._ssid_count = msgbuffers.validate_integer(
      'WifiScanResponse.ssid_count', value, 0, 4294967295)

  @property
  def status_code(self):
    "uint_8 status_code struct property."
    return self._status_code

  @status_code.setter
  def status_code(self, value):
    self._status_code = msgbuffers.validate_integer(
      'WifiScanResponse.status_code', value, 0, 255)

  def __init__(self, ssid_count=0, status_code=0):
    self.ssid_count = ssid_count
    self.status_code = status_code

  @classmethod
  def unpack(cls, buffer):
    "Reads a new WifiScanResponse from the given buffer."
    reader = msgbuffers.BinaryReader(buffer)
    value = cls.unpack_from(reader)
    if reader.tell() != len(reader):
      raise msgbuffers.ReadError(
        ('WifiScanResponse.unpack received a buffer of length {length}, ' +
        'but only {position} bytes were read.').format(
        length=len(reader), position=reader.tell()))
    return value

  @classmethod
  def unpack_from(cls, reader):
    "Reads a new WifiScanResponse from the given BinaryReader."
    _ssid_count = reader.read('I')
    _status_code = reader.read('B')
    return cls(_ssid_count, _status_code)

  def pack(self):
    "Writes the current WifiScanResponse, returning bytes."
    writer = msgbuffers.BinaryWriter()
    self.pack_to(writer)
    return writer.dumps()

  def pack_to(self, writer):
    "Writes the current WifiScanResponse to the given BinaryWriter."
    writer.write(self._ssid_count, 'I')
    writer.write(self._status_code, 'B')

  def __eq__(self, other):
    if type(self) is type(other):
      return (self._ssid_count == other._ssid_count and
        self._status_code == other._status_code)
    else:
      return NotImplemented

  def __ne__(self, other):
    if type(self) is type(other):
      return not self.__eq__(other)
    else:
      return NotImplemented

  def __len__(self):
    return (msgbuffers.size(self._ssid_count, 'I') +
      msgbuffers.size(self._status_code, 'B'))

  def __str__(self):
    return '{type}(ssid_count={ssid_count}, status_code={status_code})'.format(
      type=type(self).__name__,
      ssid_count=self._ssid_count,
      status_code=self._status_code)

  def __repr__(self):
    return '{type}(ssid_count={ssid_count}, status_code={status_code})'.format(
      type=type(self).__name__,
      ssid_count=repr(self._ssid_count),
      status_code=repr(self._status_code))

Anki.Vector.SwitchboardInterface.WifiScanResponse = WifiScanResponse
del WifiScanResponse


class WifiConnectResponse(object):
  "Generated message-passing message."

  __slots__ = (
    '_status_code', # uint_8
  )

  @property
  def status_code(self):
    "uint_8 status_code struct property."
    return self._status_code

  @status_code.setter
  def status_code(self, value):
    self._status_code = msgbuffers.validate_integer(
      'WifiConnectResponse.status_code', value, 0, 255)

  def __init__(self, status_code=0):
    self.status_code = status_code

  @classmethod
  def unpack(cls, buffer):
    "Reads a new WifiConnectResponse from the given buffer."
    reader = msgbuffers.BinaryReader(buffer)
    value = cls.unpack_from(reader)
    if reader.tell() != len(reader):
      raise msgbuffers.ReadError(
        ('WifiConnectResponse.unpack received a buffer of length {length}, ' +
        'but only {position} bytes were read.').format(
        length=len(reader), position=reader.tell()))
    return value

  @classmethod
  def unpack_from(cls, reader):
    "Reads a new WifiConnectResponse from the given BinaryReader."
    _status_code = reader.read('B')
    return cls(_status_code)

  def pack(self):
    "Writes the current WifiConnectResponse, returning bytes."
    writer = msgbuffers.BinaryWriter()
    self.pack_to(writer)
    return writer.dumps()

  def pack_to(self, writer):
    "Writes the current WifiConnectResponse to the given BinaryWriter."
    writer.write(self._status_code, 'B')

  def __eq__(self, other):
    if type(self) is type(other):
      return self._status_code == other._status_code
    else:
      return NotImplemented

  def __ne__(self, other):
    if type(self) is type(other):
      return not self.__eq__(other)
    else:
      return NotImplemented

  def __len__(self):
    return (msgbuffers.size(self._status_code, 'B'))

  def __str__(self):
    return '{type}(status_code={status_code})'.format(
      type=type(self).__name__,
      status_code=self._status_code)

  def __repr__(self):
    return '{type}(status_code={status_code})'.format(
      type=type(self).__name__,
      status_code=repr(self._status_code))

Anki.Vector.SwitchboardInterface.WifiConnectResponse = WifiConnectResponse
del WifiConnectResponse


class HasBleKeysResponse(object):
  "Generated message-passing message."

  __slots__ = (
    '_hasBleKeys', # bool
  )

  @property
  def hasBleKeys(self):
    "bool hasBleKeys struct property."
    return self._hasBleKeys

  @hasBleKeys.setter
  def hasBleKeys(self, value):
    self._hasBleKeys = msgbuffers.validate_bool(
      'HasBleKeysResponse.hasBleKeys', value)

  def __init__(self, hasBleKeys=False):
    self.hasBleKeys = hasBleKeys

  @classmethod
  def unpack(cls, buffer):
    "Reads a new HasBleKeysResponse from the given buffer."
    reader = msgbuffers.BinaryReader(buffer)
    value = cls.unpack_from(reader)
    if reader.tell() != len(reader):
      raise msgbuffers.ReadError(
        ('HasBleKeysResponse.unpack received a buffer of length {length}, ' +
        'but only {position} bytes were read.').format(
        length=len(reader), position=reader.tell()))
    return value

  @classmethod
  def unpack_from(cls, reader):
    "Reads a new HasBleKeysResponse from the given BinaryReader."
    _hasBleKeys = bool(reader.read('b'))
    return cls(_hasBleKeys)

  def pack(self):
    "Writes the current HasBleKeysResponse, returning bytes."
    writer = msgbuffers.BinaryWriter()
    self.pack_to(writer)
    return writer.dumps()

  def pack_to(self, writer):
    "Writes the current HasBleKeysResponse to the given BinaryWriter."
    writer.write(int(self._hasBleKeys), 'b')

  def __eq__(self, other):
    if type(self) is type(other):
      return self._hasBleKeys == other._hasBleKeys
    else:
      return NotImplemented

  def __ne__(self, other):
    if type(self) is type(other):
      return not self.__eq__(other)
    else:
      return NotImplemented

  def __len__(self):
    return (msgbuffers.size(self._hasBleKeys, 'b'))

  def __str__(self):
    return '{type}(hasBleKeys={hasBleKeys})'.format(
      type=type(self).__name__,
      hasBleKeys=self._hasBleKeys)

  def __repr__(self):
    return '{type}(hasBleKeys={hasBleKeys})'.format(
      type=type(self).__name__,
      hasBleKeys=repr(self._hasBleKeys))

Anki.Vector.SwitchboardInterface.HasBleKeysResponse = HasBleKeysResponse
del HasBleKeysResponse


