Skip to content

Commit

Permalink
assert (conn.cabinet == conn.frame == 0)
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian-B committed Aug 1, 2023
1 parent 937e84b commit 04dc054
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion spinnman/transceiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,9 @@ def __identify_connections(self, connections):
# Locate any connections that talk to a BMP
if isinstance(conn, BMPConnection):
# If it is a BMP conn, add it here
assert (len(self._bmp_connections) == 0)
self._bmp_connections.append(conn)
assert (conn.cabinet == conn.frame == 0)
self._bmp_connection_selectors[conn.cabinet, conn.frame] =\
FixedConnectionSelector(conn)
# Otherwise, check if it can send and receive SCP (talk to SCAMP)
Expand All @@ -307,7 +309,7 @@ def __check_bmp_connections(self):
# check that the UDP BMP conn is actually connected to a BMP
# via the sver command
for conn in self._bmp_connections:

assert (conn.cabinet == conn.frame == 0)
# try to send a BMP sver to check if it responds as expected
try:
version_info = self._get_scamp_version(
Expand Down Expand Up @@ -1107,6 +1109,7 @@ def _bmp_connection(self, cabinet, frame):
:param int frame:
:rtype: FixedConnectionSelector
"""
assert (cabinet == frame == 0)
key = (cabinet, frame)
if key not in self._bmp_connection_selectors:
raise SpinnmanInvalidParameterException(
Expand Down

0 comments on commit 04dc054

Please sign in to comment.