Skip to main content

Channel Access Foreign Function Interface

Project description

caffi is the Channel Access Foreign Function Interface. It uses CFFI to call EPICS channel access library.

This package provides direct low level interface to channel access, alike the C API.

Note: cffi commit 9fe2a9e contains an important fix to the frequent hangup on Windows 64bit Python 3. That means until cffi 1.11 is released, one should patch manually.

Install

EPICS dynamic libraries have been shipped with the package for Windows, Linux and macOS. But if the environment variables EPICS_BASE and EPICS_HOST_ARCH are set on macOS and Linux, those libraries under path ${EPICS_BASE}/lib/${EPICS_HOST_ARCH} will be used.

Either use pip,

$ pip install caffi

or checkout source code from the git repository,

$ git clone https://github.com/CaChannel/caffi.git
$ cd caffi
$ python setup.py install

Package

RPM

The SPEC file python-caffi.spec is included. Get the source tarball either from PyPI or create it by python setup.py sdist, and run:

$ rpmbuild -ta caffi-1.0.0.tar.gz

The binary and source RPM will be created. The package name is python-caffi.

Anaconda

The recipe is included.:

$ conda build conda-recipe

Documents

Latest documents are hosted at Read the Dcos.

Example

import caffi.ca as ca

status = ca.create_context()
assert status == ca.ECA.NORMAL

status, chid = ca.create_channel('catest')
assert status == ca.ECA.NORMAL

status = ca.pend_io(3)
assert status == ca.ECA.NORMAL

status = ca.put(chid, 123)
status = ca.flush_io()

status, value = ca.get(chid)
assert status == ca.ECA.NORMAL

status = ca.pend_io(3)
assert status == ca.ECA.NORMAL

assert value.get() == 123

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

caffi-1.0.0rc1.tar.gz (3.1 MB view details)

Uploaded Source

Built Distribution

caffi-1.0.0rc1-py2.py3-none-any.whl (3.1 MB view details)

Uploaded Python 2Python 3

File details

Details for the file caffi-1.0.0rc1.tar.gz.

File metadata

  • Download URL: caffi-1.0.0rc1.tar.gz
  • Upload date:
  • Size: 3.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for caffi-1.0.0rc1.tar.gz
Algorithm Hash digest
SHA256 aa92be186b031b9ebe9f73495f53755b4a5060d8a136de998dfc2b6c248b2c60
MD5 106cfffcd4525a7837bd9f970490e737
BLAKE2b-256 edb4506c911ea7f61f187adfab607e70d855ed6bed8283c07d4a3c27207654f3

See more details on using hashes here.

File details

Details for the file caffi-1.0.0rc1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for caffi-1.0.0rc1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 80612d396e73e1d50ebbe43ea16e246c579c01e3431312f66d7612907aaa15f9
MD5 20a836fdc1829e63981c6cf0974de8f2
BLAKE2b-256 10ab159959f1cc94c70eaada29c12d1e4b8a956d08468e8d8a86e54fb2198a74

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page