Metadata-Version: 2.1
Name: barp_python
Version: 1.0.2
Summary: Python parser for BARIX AR protocol (BARP)
Home-page: https://bitbucket.org/kibix/barp_python/
Author: Aneesh Dahiya
Author-email: aneesh@barix.com
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 2
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: Linux
Requires-Python: >=2.7
Description-Content-Type: text/markdown

# README #

This is the python implemenation of BARP protocol. The protocol is written to work with python2.7 but it should work with python3 as well. 
The BARP source code is in  ``src/BARP``. The parser follows specification mentioned as per ``barp.pdf``.


## Directory structure ##
```
📦src
 ┣ 📂BARP
 ┃ ┣ 📜barp.py  # contains main class for encoding and decoding messages.
 ┃ ┣ 📜barp_header.py  #Contains slass for encoding and decoding header, instantiated in barp.py.
 ┃ ┣ 📜client_test.py   # test script to broadcast messages to a port.
 ┃ ┣ 📜constants.py #file containing formats for packing a string as byte array.
 ┃ ┣ 📜control_message.py # Contains classes for all control and status messages.
 ┃ ┣ 📜server_test.py # test script to listen messages at ports
 ┃ ┣ 📜utils.py # Contains utils for packing, unpacking a byte array, id to bitmap generator.
 ┣ 📂POC
 ┃ ┣ 📜audio_test.py # script to test audio playback from pyalsaaudio api
 ┃ ┣ 📜play_stream.py # script to test playing of raw mulaw udp stream.
 ┃ ┣ 📜constants.py # constants related to POC
 ┃ ┣ 📜main.py  # main process to start the state machine.
 ┃ ┣ 📜process.py # File contains functions for three parallel propcess of the POC.
 ┃ ┣ 📜states.py # Contains classes for each state.
 ┃ ┣ 📜utils.py # contains helper functions for definig socket and arranging audio device.
 ┗ 📂tests
 ┃ ┗ 📜bitmap_test.py   # Unit tests for id to bitmap util.

```

### Note ###
* Tested in python 2.7 and M400 device with multiprocessing enabled.
* Updated for python3. Issues dealt with
    * Byte array and string interpretation of socket messages between python2 and python2.
    * Protection against implicit conversion of byte array element when called with its index. 
* To test, set python path ``export PYTHONPATH="path/to/repo"``
* `` python src/POC/main.py``
* Alternatively, install it as a package.``python setup.py install``


# Fix in version 0.0.3:
* Enoding bug fixed due to missing import fixed in control messages.
* Test scripts main method added in a suitable call.
* import paths fixed.

# Fix in version 0.0.4:
* POC module removed from src.
* numpy dependency removed from BARP.utils

# Fix in version 0.0.5:
* Bug in parsing multicast address fixed.

# version 1.0.0:
* Full support for barp messages as detailed in the barp.pdf/
* Tests added for encoding and decoding of messages
* complete compatibility with python2 and python3 

# version 1.0.1:
* Extended support for simple paging barp header.
### Who do I talk to? ###

* Aneesh Dahiya
* Aleksandar Simeonov
