"""
Autogenerated python message buffer code.
Source: clad/types/robotToSwitchboard.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/robotToSwitchboard.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 EnterPairing(object):
  "Generated message-passing message."

  __slots__ = ()

  def __init__(self):
    pass

  @classmethod
  def unpack(cls, buffer):
    "Reads a new EnterPairing from the given buffer."
    reader = msgbuffers.BinaryReader(buffer)
    value = cls.unpack_from(reader)
    if reader.tell() != len(reader):
      raise msgbuffers.ReadError(
        ('EnterPairing.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 EnterPairing from the given BinaryReader."
    return cls()

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

  def pack_to(self, writer):
    "Writes the current EnterPairing to the given BinaryWriter."

  def __eq__(self, other):
    if type(self) is type(other):
      return True
    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 0

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

  def __repr__(self):
    return '{type}()'.format(type=type(self).__name__)

Anki.Vector.SwitchboardInterface.EnterPairing = EnterPairing
del EnterPairing


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

  __slots__ = ()

  def __init__(self):
    pass

  @classmethod
  def unpack(cls, buffer):
    "Reads a new ExitPairing from the given buffer."
    reader = msgbuffers.BinaryReader(buffer)
    value = cls.unpack_from(reader)
    if reader.tell() != len(reader):
      raise msgbuffers.ReadError(
        ('ExitPairing.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 ExitPairing from the given BinaryReader."
    return cls()

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

  def pack_to(self, writer):
    "Writes the current ExitPairing to the given BinaryWriter."

  def __eq__(self, other):
    if type(self) is type(other):
      return True
    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 0

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

  def __repr__(self):
    return '{type}()'.format(type=type(self).__name__)

Anki.Vector.SwitchboardInterface.ExitPairing = ExitPairing
del ExitPairing


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

  __slots__ = ()

  def __init__(self):
    pass

  @classmethod
  def unpack(cls, buffer):
    "Reads a new WifiScanRequest from the given buffer."
    reader = msgbuffers.BinaryReader(buffer)
    value = cls.unpack_from(reader)
    if reader.tell() != len(reader):
      raise msgbuffers.ReadError(
        ('WifiScanRequest.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 WifiScanRequest from the given BinaryReader."
    return cls()

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

  def pack_to(self, writer):
    "Writes the current WifiScanRequest to the given BinaryWriter."

  def __eq__(self, other):
    if type(self) is type(other):
      return True
    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 0

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

  def __repr__(self):
    return '{type}()'.format(type=type(self).__name__)

Anki.Vector.SwitchboardInterface.WifiScanRequest = WifiScanRequest
del WifiScanRequest


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

  __slots__ = (
    '_ssid',                      # uint_8[33]
    '_pwd',                       # uint_8[33]
    '_disconnectAfterConnection', # bool
  )

  @property
  def ssid(self):
    "uint_8[33] ssid struct property."
    return self._ssid

  @ssid.setter
  def ssid(self, value):
    self._ssid = msgbuffers.validate_farray(
      'WifiConnectRequest.ssid', value, 33,
      lambda name, value_inner: msgbuffers.validate_integer(
        name, value_inner, 0, 255))

  @property
  def pwd(self):
    "uint_8[33] pwd struct property."
    return self._pwd

  @pwd.setter
  def pwd(self, value):
    self._pwd = msgbuffers.validate_farray(
      'WifiConnectRequest.pwd', value, 33,
      lambda name, value_inner: msgbuffers.validate_integer(
        name, value_inner, 0, 255))

  @property
  def disconnectAfterConnection(self):
    "bool disconnectAfterConnection struct property."
    return self._disconnectAfterConnection

  @disconnectAfterConnection.setter
  def disconnectAfterConnection(self, value):
    self._disconnectAfterConnection = msgbuffers.validate_bool(
      'WifiConnectRequest.disconnectAfterConnection', value)

  def __init__(self, ssid=(0,) * 33, pwd=(0,) * 33, disconnectAfterConnection=False):
    self.ssid = ssid
    self.pwd = pwd
    self.disconnectAfterConnection = disconnectAfterConnection

  @classmethod
  def unpack(cls, buffer):
    "Reads a new WifiConnectRequest from the given buffer."
    reader = msgbuffers.BinaryReader(buffer)
    value = cls.unpack_from(reader)
    if reader.tell() != len(reader):
      raise msgbuffers.ReadError(
        ('WifiConnectRequest.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 WifiConnectRequest from the given BinaryReader."
    _ssid = reader.read_farray('B', 33)
    _pwd = reader.read_farray('B', 33)
    _disconnectAfterConnection = bool(reader.read('b'))
    return cls(_ssid, _pwd, _disconnectAfterConnection)

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

  def pack_to(self, writer):
    "Writes the current WifiConnectRequest to the given BinaryWriter."
    writer.write_farray(self._ssid, 'B', 33)
    writer.write_farray(self._pwd, 'B', 33)
    writer.write(int(self._disconnectAfterConnection), 'b')

  def __eq__(self, other):
    if type(self) is type(other):
      return (self._ssid == other._ssid and
        self._pwd == other._pwd and
        self._disconnectAfterConnection == other._disconnectAfterConnection)
    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_farray(self._ssid, 'B', 33) +
      msgbuffers.size_farray(self._pwd, 'B', 33) +
      msgbuffers.size(self._disconnectAfterConnection, 'b'))

  def __str__(self):
    return '{type}(ssid={ssid}, pwd={pwd}, disconnectAfterConnection={disconnectAfterConnection})'.format(
      type=type(self).__name__,
      ssid=msgbuffers.shorten_sequence(self._ssid),
      pwd=msgbuffers.shorten_sequence(self._pwd),
      disconnectAfterConnection=self._disconnectAfterConnection)

  def __repr__(self):
    return '{type}(ssid={ssid}, pwd={pwd}, disconnectAfterConnection={disconnectAfterConnection})'.format(
      type=type(self).__name__,
      ssid=repr(self._ssid),
      pwd=repr(self._pwd),
      disconnectAfterConnection=repr(self._disconnectAfterConnection))

Anki.Vector.SwitchboardInterface.WifiConnectRequest = WifiConnectRequest
del WifiConnectRequest


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

  __slots__ = ()

  def __init__(self):
    pass

  @classmethod
  def unpack(cls, buffer):
    "Reads a new HasBleKeysRequest from the given buffer."
    reader = msgbuffers.BinaryReader(buffer)
    value = cls.unpack_from(reader)
    if reader.tell() != len(reader):
      raise msgbuffers.ReadError(
        ('HasBleKeysRequest.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 HasBleKeysRequest from the given BinaryReader."
    return cls()

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

  def pack_to(self, writer):
    "Writes the current HasBleKeysRequest to the given BinaryWriter."

  def __eq__(self, other):
    if type(self) is type(other):
      return True
    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 0

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

  def __repr__(self):
    return '{type}()'.format(type=type(self).__name__)

Anki.Vector.SwitchboardInterface.HasBleKeysRequest = HasBleKeysRequest
del HasBleKeysRequest


