Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions synapse/client/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@


class Config(object):
nodes = []
connections = []

def __init__(self):
pass
self.nodes = []
self.connections = []

def _gen_node_id(self):
return len(self.nodes) + 1
Expand Down
7 changes: 7 additions & 0 deletions synapse/server/entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ def main(
)
args = parser.parse_args()

# if these contain spaces, the discovery will fail because the broadcast
# packet is parsed with str.split() in discover.py and each space marks a new token
if " " in args.name:
parser.error("--name must not contain spaces")
if " " in args.serial:
parser.error("--serial must not contain spaces")

init_logging(level=logging.DEBUG if args.verbose else logging.INFO)

# verify that network interface is real
Expand Down
5 changes: 4 additions & 1 deletion synapse/simulator/nodes/broadband_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ async def run(self):
now = time.time_ns()
elapsed_ns = now - t_last_ns
n_samples = int(sample_rate_hz * elapsed_ns / 1e9)
if n_samples == 0:
continue

samples = [[ch.id, [r_sample(bit_width) for _ in range(n_samples)]] for ch in channels]

try:
Expand Down Expand Up @@ -105,7 +108,7 @@ async def run(self):
except Exception as e:
self.logger.error(f"Error sending data: {e}")

t_last_ns = now
t_last_ns += int(n_samples * 1e9 / sample_rate_hz)
except Exception as e:
print(f"Error sending data: {e}")

Expand Down
Loading