diff --git a/documentation/build/.doctrees/app.doctree b/documentation/build/.doctrees/app.doctree new file mode 100644 index 0000000..e650f0b Binary files /dev/null and b/documentation/build/.doctrees/app.doctree differ diff --git a/documentation/build/.doctrees/environment.pickle b/documentation/build/.doctrees/environment.pickle index cc51a63..5c2e72a 100644 Binary files a/documentation/build/.doctrees/environment.pickle and b/documentation/build/.doctrees/environment.pickle differ diff --git a/documentation/build/.doctrees/interface_handler.doctree b/documentation/build/.doctrees/interface_handler.doctree new file mode 100644 index 0000000..a49a124 Binary files /dev/null and b/documentation/build/.doctrees/interface_handler.doctree differ diff --git a/documentation/build/.doctrees/modules.doctree b/documentation/build/.doctrees/modules.doctree new file mode 100644 index 0000000..9c6482c Binary files /dev/null and b/documentation/build/.doctrees/modules.doctree differ diff --git a/documentation/build/.doctrees/ring_buffer.doctree b/documentation/build/.doctrees/ring_buffer.doctree new file mode 100644 index 0000000..4e86319 Binary files /dev/null and b/documentation/build/.doctrees/ring_buffer.doctree differ diff --git a/documentation/build/.doctrees/xml_reader.doctree b/documentation/build/.doctrees/xml_reader.doctree new file mode 100644 index 0000000..0c56528 Binary files /dev/null and b/documentation/build/.doctrees/xml_reader.doctree differ diff --git a/documentation/build/_sources/app.rst.txt b/documentation/build/_sources/app.rst.txt new file mode 100644 index 0000000..897ab98 --- /dev/null +++ b/documentation/build/_sources/app.rst.txt @@ -0,0 +1,7 @@ +app module +========== + +.. automodule:: app + :members: + :undoc-members: + :show-inheritance: diff --git a/documentation/build/_sources/interface_handler.rst.txt b/documentation/build/_sources/interface_handler.rst.txt new file mode 100644 index 0000000..c389c4b --- /dev/null +++ b/documentation/build/_sources/interface_handler.rst.txt @@ -0,0 +1,7 @@ +interface\_handler module +========================= + +.. automodule:: interface_handler + :members: + :undoc-members: + :show-inheritance: diff --git a/documentation/build/_sources/modules.rst.txt b/documentation/build/_sources/modules.rst.txt new file mode 100644 index 0000000..067d819 --- /dev/null +++ b/documentation/build/_sources/modules.rst.txt @@ -0,0 +1,10 @@ +aped_device +=========== + +.. toctree:: + :maxdepth: 4 + + app + interface_handler + ring_buffer + xml_reader diff --git a/documentation/build/_sources/ring_buffer.rst.txt b/documentation/build/_sources/ring_buffer.rst.txt new file mode 100644 index 0000000..4c02795 --- /dev/null +++ b/documentation/build/_sources/ring_buffer.rst.txt @@ -0,0 +1,7 @@ +ring\_buffer module +=================== + +.. automodule:: ring_buffer + :members: + :undoc-members: + :show-inheritance: diff --git a/documentation/build/_sources/xml_reader.rst.txt b/documentation/build/_sources/xml_reader.rst.txt new file mode 100644 index 0000000..ed1b136 --- /dev/null +++ b/documentation/build/_sources/xml_reader.rst.txt @@ -0,0 +1,7 @@ +xml\_reader module +================== + +.. automodule:: xml_reader + :members: + :undoc-members: + :show-inheritance: diff --git a/documentation/build/app.html b/documentation/build/app.html new file mode 100644 index 0000000..b698711 --- /dev/null +++ b/documentation/build/app.html @@ -0,0 +1,159 @@ + + + + + + + + app module — APED (API-Documentation) V2.1 documentation + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

app module

+
+
+app.api_devices(device_name: str, buffering: str)
+

the method for reading and writing to and from the connected devices

+ +++ + + + + + +
Parameters:
    +
  • device_name (str) – the name of the relevant device
  • +
  • buffering (str) – whether or not the buffer of the device is requested
  • +
+
Returns:

the relevant information about the device in JSON format

+
+
+ +
+
+app.api_general_device_info()
+

method to read all the available device names

+ +++ + + + + + +
Returns:the available device names
Return type:JSON
+
+ +
+
+app.api_root()
+

method for the root of the API

+ +++ + + + + + +
Returns:a welcom message
Return type:html
+
+ +
+
+app.xml_transfer()
+

method for transfering the config.xml files to and from the raspberry

+ +++ + + + +
Returns:the config.xml or the occured errors
+
+ +
+ + +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/documentation/build/genindex.html b/documentation/build/genindex.html index 5e1e0c0..9c93e98 100644 --- a/documentation/build/genindex.html +++ b/documentation/build/genindex.html @@ -34,8 +34,181 @@

Index

+ A + | B + | G + | I + | R + | S + | V + | W + | X
+

A

+ + + +
+ +

B

+ + +
+ +

G

+ + + +
+ +

I

+ + + +
+ +

R

+ + + +
+ +

S

+ + +
+ +

V

+ + +
+ +

W

+ + +
+ +

X

+ + + +
+ diff --git a/documentation/build/interface_handler.html b/documentation/build/interface_handler.html new file mode 100644 index 0000000..669f69e --- /dev/null +++ b/documentation/build/interface_handler.html @@ -0,0 +1,340 @@ + + + + + + + + interface_handler module — APED (API-Documentation) V2.1 documentation + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

interface_handler module

+
+
+class interface_handler.Interface_handler(xml_reader: xml_reader.Xml_reader)
+

Bases: object

+

handles the access to the various interfaces (e.g. GPIO)

+
+
+class Pin
+

Bases: enum.Enum

+

list of all usable pins

+

enables restricting methods to these pins

+
+
+GPIO_10 = 19
+
+ +
+
+GPIO_11 = 23
+
+ +
+
+GPIO_12 = 32
+
+ +
+
+GPIO_13 = 33
+
+ +
+
+GPIO_14 = 8
+
+ +
+
+GPIO_15 = 10
+
+ +
+
+GPIO_16 = 36
+
+ +
+
+GPIO_17 = 11
+
+ +
+
+GPIO_18 = 12
+
+ +
+
+GPIO_19 = 35
+
+ +
+
+GPIO_2 = 3
+
+ +
+
+GPIO_20 = 38
+
+ +
+
+GPIO_21 = 40
+
+ +
+
+GPIO_22 = 15
+
+ +
+
+GPIO_23 = 16
+
+ +
+
+GPIO_24 = 18
+
+ +
+
+GPIO_25 = 22
+
+ +
+
+GPIO_26 = 37
+
+ +
+
+GPIO_27 = 13
+
+ +
+
+GPIO_3 = 5
+
+ +
+
+GPIO_4 = 7
+
+ +
+
+GPIO_5 = 29
+
+ +
+
+GPIO_6 = 31
+
+ +
+
+GPIO_7 = 26
+
+ +
+
+GPIO_8 = 24
+
+ +
+
+GPIO_9 = 21
+
+ +
+ +
+
+buffering()
+

method that buffers the device outputs

+
+ +
+
+init_buffer()
+

initializes the buffer thread

+
+ +
+
+init_gpio()
+

initializes the GPIO pins

+
+ +
+
+read(device_name: str) → dict
+

reads the current value from the pins of one device

+ +++ + + + + + + + + + +
Parameters:

device_name (string) – the name of the device

+
Raises:
    +
  • NameError – the device cannot be found in the config.xml
  • +
  • ValueError – the device does not support reading
  • +
+
Returns:

{‘pin’: ‘value’}

+
Return type:

dict

+
+
+ +
+
+read_buffer(device_name: str) → dict
+

reads the current buffer content for a given device

+ +++ + + + + + + + + + +
Parameters:

device_name (str) – the name of the device

+
Raises:
    +
  • NameError – the device cannot be found in the config.xml
  • +
  • ValueError – the device has no buffer
  • +
+
Returns:

the buffer of the device

+
Return type:

dict

+
+
+ +
+
+write(device_name: str, output)
+

writes an output to a given device

+ +++ + + + + + + + + + +
Parameters:
    +
  • device_name (str) – the name of the relevant device
  • +
  • value (<type depends on protocol>) – the value to be written
  • +
+
Raises:
    +
  • NameError – the device name could not be found in the config.xml
  • +
  • TypeError – the given Value has the wrong type for the protocol
  • +
  • ValueError – the value cannot be written to the device
  • +
+
Returns:

value if everything worked correctly

+
Return type:

<type depends on protocol>

+
+
+ +
+ +
+ + +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/documentation/build/modules.html b/documentation/build/modules.html new file mode 100644 index 0000000..b097d5e --- /dev/null +++ b/documentation/build/modules.html @@ -0,0 +1,100 @@ + + + + + + + + aped_device — APED (API-Documentation) V2.1 documentation + + + + + + + + + + + + + + + + + +
+
+ +
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/documentation/build/objects.inv b/documentation/build/objects.inv index dfea4f4..fd67a92 100644 Binary files a/documentation/build/objects.inv and b/documentation/build/objects.inv differ diff --git a/documentation/build/py-modindex.html b/documentation/build/py-modindex.html new file mode 100644 index 0000000..27ed552 --- /dev/null +++ b/documentation/build/py-modindex.html @@ -0,0 +1,137 @@ + + + + + + + + Python Module Index — APED (API-Documentation) V2.1 documentation + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + +

Python Module Index

+ +
+ a | + i | + r | + x +
+ + + + + + + + + + + + + + + + + + + + + + +
 
+ a
+ app +
 
+ i
+ interface_handler +
 
+ r
+ ring_buffer +
 
+ x
+ xml_reader +
+ + +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/documentation/build/ring_buffer.html b/documentation/build/ring_buffer.html new file mode 100644 index 0000000..6cd5bb1 --- /dev/null +++ b/documentation/build/ring_buffer.html @@ -0,0 +1,113 @@ + + + + + + + + ring_buffer module — APED (API-Documentation) V2.1 documentation + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

ring_buffer module

+
+
+class ring_buffer.Ring_buffer(size: int)
+

Bases: object

+

manages a list in a ring buffer like manner

+
+
+append(data)
+

appends an element to the ring buffer

+ +++ + + + +
Parameters:data ([type]) – the element to be added
+
+ +
+ +
+ + +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/documentation/build/searchindex.js b/documentation/build/searchindex.js index 7134ff5..494c698 100644 --- a/documentation/build/searchindex.js +++ b/documentation/build/searchindex.js @@ -1 +1 @@ -Search.setIndex({docnames:["index"],envversion:{"sphinx.domains.c":1,"sphinx.domains.changeset":1,"sphinx.domains.cpp":1,"sphinx.domains.javascript":1,"sphinx.domains.math":2,"sphinx.domains.python":1,"sphinx.domains.rst":1,"sphinx.domains.std":1,sphinx:55},filenames:["index.rst"],objects:{},objnames:{},objtypes:{},terms:{index:0,modul:0,page:0,search:0},titles:["Welcome to APED (API-Documentation)\u2019s documentation!"],titleterms:{APED:0,api:0,document:0,indic:0,tabl:0,welcom:0}}) \ No newline at end of file +Search.setIndex({docnames:["app","index","interface_handler","modules","ring_buffer","xml_reader"],envversion:{"sphinx.domains.c":1,"sphinx.domains.changeset":1,"sphinx.domains.cpp":1,"sphinx.domains.javascript":1,"sphinx.domains.math":2,"sphinx.domains.python":1,"sphinx.domains.rst":1,"sphinx.domains.std":1,sphinx:55},filenames:["app.rst","index.rst","interface_handler.rst","modules.rst","ring_buffer.rst","xml_reader.rst"],objects:{"":{app:[0,0,0,"-"],interface_handler:[2,0,0,"-"],ring_buffer:[4,0,0,"-"],xml_reader:[5,0,0,"-"]},"interface_handler.Interface_handler":{Pin:[2,2,1,""],buffering:[2,4,1,""],init_buffer:[2,4,1,""],init_gpio:[2,4,1,""],read:[2,4,1,""],read_buffer:[2,4,1,""],write:[2,4,1,""]},"interface_handler.Interface_handler.Pin":{GPIO_10:[2,3,1,""],GPIO_11:[2,3,1,""],GPIO_12:[2,3,1,""],GPIO_13:[2,3,1,""],GPIO_14:[2,3,1,""],GPIO_15:[2,3,1,""],GPIO_16:[2,3,1,""],GPIO_17:[2,3,1,""],GPIO_18:[2,3,1,""],GPIO_19:[2,3,1,""],GPIO_20:[2,3,1,""],GPIO_21:[2,3,1,""],GPIO_22:[2,3,1,""],GPIO_23:[2,3,1,""],GPIO_24:[2,3,1,""],GPIO_25:[2,3,1,""],GPIO_26:[2,3,1,""],GPIO_27:[2,3,1,""],GPIO_2:[2,3,1,""],GPIO_3:[2,3,1,""],GPIO_4:[2,3,1,""],GPIO_5:[2,3,1,""],GPIO_6:[2,3,1,""],GPIO_7:[2,3,1,""],GPIO_8:[2,3,1,""],GPIO_9:[2,3,1,""]},"ring_buffer.Ring_buffer":{append:[4,4,1,""]},"xml_reader.Xml_reader":{get_buffer_size:[5,4,1,""],get_device_names:[5,4,1,""],get_port:[5,4,1,""],set_root:[5,4,1,""],validate:[5,4,1,""]},app:{api_devices:[0,1,1,""],api_general_device_info:[0,1,1,""],api_root:[0,1,1,""],xml_transfer:[0,1,1,""]},interface_handler:{Interface_handler:[2,2,1,""]},ring_buffer:{Ring_buffer:[4,2,1,""]},xml_reader:{Xml_reader:[5,2,1,""]}},objnames:{"0":["py","module","Python module"],"1":["py","function","Python function"],"2":["py","class","Python class"],"3":["py","attribute","Python attribute"],"4":["py","method","Python method"]},objtypes:{"0":"py:module","1":"py:function","2":"py:class","3":"py:attribute","4":"py:method"},terms:{"class":[2,4,5],"enum":2,"int":[4,5],"return":[0,2,5],about:[0,5],access:2,added:4,against:5,all:[0,2,5],api:0,api_devic:0,api_general_device_info:0,api_root:0,app:3,append:4,avail:0,base:[2,4,5],bool:5,buffer:[0,2,4,5],cannot:2,check:5,config:[0,2,5],configur:5,connect:0,content:2,correctli:2,could:2,current:2,data:4,depend:2,devic:[0,2,5],device_nam:[0,2,5],dict:[2,5],doe:2,element:[4,5],enabl:2,error:0,everyth:2,file:[0,5],format:0,found:2,from:[0,2,5],get_buffer_s:5,get_device_nam:5,get_port:5,given:[2,5],gpio:2,gpio_10:2,gpio_11:2,gpio_12:2,gpio_13:2,gpio_14:2,gpio_15:2,gpio_16:2,gpio_17:2,gpio_18:2,gpio_19:2,gpio_20:2,gpio_21:2,gpio_22:2,gpio_23:2,gpio_24:2,gpio_25:2,gpio_26:2,gpio_27:2,gpio_2:2,gpio_3:2,gpio_4:2,gpio_5:2,gpio_6:2,gpio_7:2,gpio_8:2,gpio_9:2,handl:2,has:2,html:0,index:1,inform:[0,5],init_buff:2,init_gpio:2,initi:2,interfac:2,interface_handl:3,json:0,like:4,list:[2,4,5],manag:4,manner:4,messag:0,method:[0,2,5],modul:[1,3],name:[0,2,5],nameerror:[2,5],object:[2,4,5],occur:0,one:2,output:2,page:1,paramet:[0,2,4,5],path:5,pin:[2,5],port:5,protocol:[2,5],rais:[2,5],raspberri:0,read:[0,2,5],read_buff:2,reader:5,relev:[0,2],request:0,restrict:2,result:5,ring:4,ring_buff:3,root:[0,5],search:1,set_root:5,size:[4,5],store:5,str:[0,2,5],string:[2,5],support:2,thread:2,transfer:0,type:[0,2,4,5],typeerror:2,usabl:2,using:5,valid:5,valu:2,valueerror:2,variou:2,welcom:0,whether:0,work:2,write:[0,2],written:2,wrong:2,xml:[0,2,5],xml_path:5,xml_reader:[2,3],xml_transfer:0,xsd:5,xsd_path:5},titles:["app module","Welcome to APED (API-Documentation)\u2019s documentation!","interface_handler module","aped_device","ring_buffer module","xml_reader module"],titleterms:{APED:1,aped_devic:3,api:1,app:0,document:1,indic:1,interface_handl:2,modul:[0,2,4,5],ring_buff:4,tabl:1,welcom:1,xml_reader:5}}) \ No newline at end of file diff --git a/documentation/build/xml_reader.html b/documentation/build/xml_reader.html new file mode 100644 index 0000000..3010eaa --- /dev/null +++ b/documentation/build/xml_reader.html @@ -0,0 +1,193 @@ + + + + + + + + xml_reader module — APED (API-Documentation) V2.1 documentation + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

xml_reader module

+
+
+class xml_reader.Xml_reader(xml_path: str, xsd_path: str)
+

Bases: object

+

reader for the XML configuration

+
+
+get_buffer_size(device_name: str) → int
+

method to read the buffer size of a given device from the XML

+ +++ + + + + + + + + + +
Parameters:device_name (str) – the name of a device
Raises:NameError – device_name will be checked against the config XML
Returns:the buffer size for the device
Return type:int
+
+ +
+
+get_device_names() → list
+

lists all the device names from the config XML

+ +++ + + + + + +
Returns:all device names as strings
Return type:list
+
+ +
+
+get_port(device_name: str) → dict
+

returns the information about a port of a given device

+ +++ + + + + + + + + + +
Parameters:device_name (str) – the name of a device
Returns:{‘protocol’, [list: pins]}
Return type:dict
Raises:NameError – device_name will be checked against the config XML
+
+ +
+
+set_root(xml_path: str)
+

method to read and store the root element from the XML file

+ +++ + + + +
Parameters:xml_path (str) – the path to the XML file
+
+ +
+
+validate(xml_path: str, xsd_path: str) → bool
+

validates a XML by using a XSD file

+ +++ + + + + + + + +
Parameters:
    +
  • xml_path (str) – the path to the XML file
  • +
  • xsd_path (str) – the path to the XSD file
  • +
+
Returns:

result of the validation

+
Return type:

bool

+
+
+ +
+ +
+ + +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/documentation/documentation/build/app.rst b/documentation/documentation/build/app.rst new file mode 100644 index 0000000..897ab98 --- /dev/null +++ b/documentation/documentation/build/app.rst @@ -0,0 +1,7 @@ +app module +========== + +.. automodule:: app + :members: + :undoc-members: + :show-inheritance: diff --git a/documentation/documentation/build/interface_handler.rst b/documentation/documentation/build/interface_handler.rst new file mode 100644 index 0000000..c389c4b --- /dev/null +++ b/documentation/documentation/build/interface_handler.rst @@ -0,0 +1,7 @@ +interface\_handler module +========================= + +.. automodule:: interface_handler + :members: + :undoc-members: + :show-inheritance: diff --git a/documentation/documentation/build/modules.rst b/documentation/documentation/build/modules.rst new file mode 100644 index 0000000..067d819 --- /dev/null +++ b/documentation/documentation/build/modules.rst @@ -0,0 +1,10 @@ +aped_device +=========== + +.. toctree:: + :maxdepth: 4 + + app + interface_handler + ring_buffer + xml_reader diff --git a/documentation/documentation/build/ring_buffer.rst b/documentation/documentation/build/ring_buffer.rst new file mode 100644 index 0000000..4c02795 --- /dev/null +++ b/documentation/documentation/build/ring_buffer.rst @@ -0,0 +1,7 @@ +ring\_buffer module +=================== + +.. automodule:: ring_buffer + :members: + :undoc-members: + :show-inheritance: diff --git a/documentation/documentation/build/xml_reader.rst b/documentation/documentation/build/xml_reader.rst new file mode 100644 index 0000000..ed1b136 --- /dev/null +++ b/documentation/documentation/build/xml_reader.rst @@ -0,0 +1,7 @@ +xml\_reader module +================== + +.. automodule:: xml_reader + :members: + :undoc-members: + :show-inheritance: diff --git a/documentation/source/app.rst b/documentation/source/app.rst new file mode 100644 index 0000000..897ab98 --- /dev/null +++ b/documentation/source/app.rst @@ -0,0 +1,7 @@ +app module +========== + +.. automodule:: app + :members: + :undoc-members: + :show-inheritance: diff --git a/documentation/source/conf.py b/documentation/source/conf.py index d343b76..b5af60e 100644 --- a/documentation/source/conf.py +++ b/documentation/source/conf.py @@ -12,9 +12,9 @@ # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # -# import os -# import sys -# sys.path.insert(0, os.path.abspath('.')) +import os +import sys +sys.path.insert(0, os.path.abspath('../..')) # -- Project information ----------------------------------------------------- diff --git a/documentation/source/interface_handler.rst b/documentation/source/interface_handler.rst new file mode 100644 index 0000000..c389c4b --- /dev/null +++ b/documentation/source/interface_handler.rst @@ -0,0 +1,7 @@ +interface\_handler module +========================= + +.. automodule:: interface_handler + :members: + :undoc-members: + :show-inheritance: diff --git a/documentation/source/modules.rst b/documentation/source/modules.rst new file mode 100644 index 0000000..067d819 --- /dev/null +++ b/documentation/source/modules.rst @@ -0,0 +1,10 @@ +aped_device +=========== + +.. toctree:: + :maxdepth: 4 + + app + interface_handler + ring_buffer + xml_reader diff --git a/documentation/source/ring_buffer.rst b/documentation/source/ring_buffer.rst new file mode 100644 index 0000000..4c02795 --- /dev/null +++ b/documentation/source/ring_buffer.rst @@ -0,0 +1,7 @@ +ring\_buffer module +=================== + +.. automodule:: ring_buffer + :members: + :undoc-members: + :show-inheritance: diff --git a/documentation/source/xml_reader.rst b/documentation/source/xml_reader.rst new file mode 100644 index 0000000..ed1b136 --- /dev/null +++ b/documentation/source/xml_reader.rst @@ -0,0 +1,7 @@ +xml\_reader module +================== + +.. automodule:: xml_reader + :members: + :undoc-members: + :show-inheritance: