What is this?
This is a Python client for the libbiopacndt library put together by godbyk.
app.py for an example application. Generally, create the
Client with the names of the channels you want and the server information, then use
connect to begin collecting data:
client = Client(["A1"], server='localhost', port=9999) client.connect()
You don't have to explicitly call
disconnect -- the destructor will handle that for you.
The client will create
biopacndt_py.log in the current directory.
connect-- Connects the client, creating the socket threads. If
True(default), any channel names that can't be found in the manifest will be ignored and added to the log file. Otherwise, throws a
disconnect-- Merges threads and closes the sockets.
poll-- A generator that allows access to the buffer. Calling
pollwill ask all the socket threads to give up their data and clear their buffers. If you just want all the data in the buffer, use:
for data in client.poll(): print data
If you want a specific number of items:
for i in range(10): print client.poll().next()
Examples for a continuous stream of data can be found in
libbiopacndt_py.pyas a CLI
- Initial version.
Author: Andrew Lilja
The MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.