

def init(self):
    if (not self.running):
        raise NodeError('Could not reset ANT node (not started).')
    msg = message.ChannelRequestMessage()
    msg.setMessageID(MESSAGE_CAPABILITIES)
    self.driver.write(msg.encode())
    caps = self.evm.waitForMessage(message.CapabilitiesMessage)
    self.networks = []
    for i in range(0, caps.getMaxNetworks()):
        self.networks.append(NetworkKey())
        self.setNetworkKey(i)
    self.channels = []
    for i in range(0, caps.getMaxChannels()):
        self.channels.append(Channel(self))
        self.channels[i].number = i
    self.options = (caps.getStdOptions(), caps.getAdvOptions(), caps.getAdvOptions2())

dataset/ETHPy150Open mvillalba/python-ant/src/ant/core/node.py Node.init/original