module: ‘measurement.py’

class gwa.code.measurement.Measurement(x_max_arg, y_max_arg, z_max_arg, x_step_arg, y_step_arg, z_step_arg)[source]

The modulce ‘measurement.py’ permit to manage the movings and note them during a campaign

Arguments :
  • x_max (integer)

    Choice of the room’s lenght

  • y_max (integer)

    Choice of the width of the room

  • x_step (integer)

    Choice of the step for the moving on the length of the room

  • y_step (integer)

    Choice of the step for the movings on the width of the room

example

>>> x_max = 20
>>> y_max = 12
>>> x_step = 1
>>> y_step = 1
"measurement.Measurement(x_max,y_max,x_step,y_step)"
configurationNetwork()[source]

The function ‘configurationNetwork’ permet to collect the fileds of the network card: fragment, tx_power and rts_cts with the help of the iwconfig function

Returns:A dictionnary of the different fields (‘Fragment thr’,’Tx-Power’,’RTS thr’)
decX()[source]

The function ‘decX’ permit to decrease ‘x’ with the step’s value

decY()[source]

The function ‘decY’ permit to decrease ‘Y’ with the step’s value

decZ()[source]

The function ‘decZ’ permit to decrease ‘z’ with the step’s value

eperf(ip, interval, duration, connection, port, download, upload, tcp, udp, rate_udp='1M')[source]

This function allow create the client to measure the bandwidth.

Argument :
ip ( srt typr )

Represent the IP address of the server

interval ( int type )

Interval between two measure

duration ( int type )

Duration of the measure

connection ( int type )

Duration of the measure

port ( int type )

Port allow to connect of the server

download ( bool type )

Activate the download measure

upload ( bool type )

Activate the upload measure

tcp ( bool type )

Activate the TCP client measure

udp ( bool type )

Activate the TCP client measure

rate_udp ( str type )

Max bandwidth UDP

Returns:

A String with the values.

“UDP_Upload#UDP_Download*TCP_Upload#TCP_Download”

forceWireless(essid, mac_address='')[source]

The “forceWireless” function forces the wifi card to connect to a unique SSID or to an AP via its MAC address, or to a SSID on an AP.

Argument :
mac_address ( str type )

Mac address of the AP we want to force

essid ( str type )

Name of the ESSID we want to force

get_coor()[source]

The function ‘get_coor’ permit to collect the current position.

Returns:The function returns a tuple with the x and y values

exemple: (2,5,1)

incX()[source]

The function ‘incX’ permit to increase ‘x’ with the step’s value

incY()[source]

The function ‘incY’ permit to increase ‘y’ with the step’s value

incZ()[source]

The function ‘incZ’ permit to increase ‘z’ with the step’s value

iwlist()[source]

The function ‘iwlist’ permit to make the statement of base stations detected at the moment of the measurement with the iwlist command

Returns:A list of dictionnary of the different fields
measurementr()[source]

The function ‘measurementr’ permit to display the power list at a chosen moment with the help of the iwconfig command

Returns:A dictionnary representing the different fields we listed with the iwconfig command Here are the dictionnary fields : ESSID, Access Point, Signal level, Bit Rate and Noise level.
moveBack()[source]

The function ‘moveBack’ permit to take a few steps back during the measurements notes. It will manages the incrementation and decrementation of x and y the same way than the “moveForward’ function

Returns:The function returns ‘True’ when everything went OK, and ‘False’ when it’s not possible to move forward anymore
moveForward()[source]

The function ‘moveForward’ permits to create the journey to follow, to realize the measurements list It will manage the incrementation and decrementation of x and y, while avoiding the walls.

Returns:The function returns ‘True’ when everything went OK, and ‘False’ when it’s not possible to move forward anymore
z_max = None

In the initialization, we manage to find the name of the wifi interface present on the machine

class gwa.code.measurement.OverflowException(axe)[source]

Bases: exceptions.Exception

This class will permit to manage the exception of class size overflow

Previous topic

module: ‘DBA.py’

Next topic

module: ‘extract.py’

This Page