pashehnet.network.network#

Module Contents#

Classes#

SensorNetwork

Class that provides a network of simulated sensors, publishing to a single target.

SensorProcess

Class that wraps a SensorNetwork sensor child process

Data#

TopicSensor

API#

class pashehnet.network.network.SensorNetwork(target)#

Bases: object

Class that provides a network of simulated sensors, publishing to a single target.

Initialization

add_sensor(topic, sensor)#

Add a sensor publishing to a given topic

Parameters:
  • topic – Topic/channel to publish to

  • sensor – Sensor to read from and publish to topic

add_sensors(topic, sensors)#

Add a collection of sensors publishing to the same topic

Parameters:
  • topic – Topic/channel to publish to

  • sensor – Sensors to read from and publish to topic

start()#

Start the simulated sensor network

stop(signum=None, frame=None)#

Stop the simulated sensor network; doubles as a signal handler for SIGINT and SIGTERM

class pashehnet.network.network.SensorProcess(target: pashehnet.targets.SensorTargetBase, topic, sensor)#

Bases: multiprocessing.Process

Class that wraps a SensorNetwork sensor child process

Initialization

__repr__()#
property authkey#
close()#
property daemon#
property exitcode#
property ident#
is_alive()#
join(timeout=None)#
kill()#
property name#
pid = None#
run()#
property sentinel#
start()#
terminate()#
pashehnet.network.network.TopicSensor = 'namedtuple(...)'#