Skip to content

Commit

Permalink
group id starts with 0
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Indenbaum <[email protected]>
  • Loading branch information
Alexander Indenbaum committed Dec 5, 2023
1 parent 861be1c commit 03b3bc0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion control/grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ def create_subsystem_safe(self, request, context=None):
raise Exception(f"Can't create a discovery subsystem")

# Assuming max of 32 gateways and protocol min 1 max 65519
offset = (self.group_id - 1) * 2040
offset = self.group_id * 2040
min_cntlid = offset + 1
max_cntlid = offset + 2040
if not request.serial_number:
Expand Down
2 changes: 1 addition & 1 deletion control/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def __exit__(self, exc_type, exc_value, traceback):

def set_group_id(self, id: int):
self.logger.info(f"Gateway {self.name} group {id=}")
assert id >= 1 and id <= MAX_ANA_GROUPS
assert id >= 0 and id < MAX_ANA_GROUPS
self.group_id = id
self.monitor_event.set()

Expand Down

0 comments on commit 03b3bc0

Please sign in to comment.