Skip to main content

AmfiTrack extension for Amfiprot

Project description

AmfiTrack extensions for the Amfiprot package.

Installation

Install (or update) with pip:

pip install -U amfiprot-amfitrack

Usage example

Instead of creating a generic amfiprot.Device, create an amfitrack.Device to get access to AmfiTrack specific functionality and payload interpretation:

import amfiprot
import amfiprot_amfitrack as amfitrack

VENDOR_ID = 0xC17
PRODUCT_ID_SENSOR = 0xD12
PRODUCT_ID_SOURCE = 0xD01

if __name__ == "__main__":
    conn = None
    try:
        conn = amfiprot.USBConnection(VENDOR_ID, PRODUCT_ID_SENSOR)
    except:
        try:
            conn = amfiprot.USBConnection(VENDOR_ID, PRODUCT_ID_SOURCE)
        except:
            print("No Amfitrack device found")
            exit()
            
    nodes = conn.find_nodes()

    print(f"Found {len(nodes)} node(s).")
    for node in nodes:
        print(f"[{node.tx_id}] {node.name}")

    dev = amfitrack.Device(nodes[0])
    conn.start()
    
    cfg = dev.config.read_all()
    dev.calibrate()

    while True:
        if dev.packet_available():
            packet = dev.get_packet()
            if type(packet.payload) == amfitrack.payload.EmfImuFrameIdPayload:
                payload: amfitrack.payload.EmfImuFrameIdPayload = packet.payload
                print(payload.emf)
            else:
                print(packet)

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

amfiprot_amfitrack-0.0.1a14.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

amfiprot_amfitrack-0.0.1a14-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file amfiprot_amfitrack-0.0.1a14.tar.gz.

File metadata

  • Download URL: amfiprot_amfitrack-0.0.1a14.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for amfiprot_amfitrack-0.0.1a14.tar.gz
Algorithm Hash digest
SHA256 9655097944dc6adbbe05c29fd77a370b143292ad0e8ce695d4248487c8bc2e54
MD5 5e58966fbe4da6855a3150fc26469f67
BLAKE2b-256 66074dbae025f21697d256a02b9c17c1edf26fec472f38daa444701e473d07e7

See more details on using hashes here.

File details

Details for the file amfiprot_amfitrack-0.0.1a14-py3-none-any.whl.

File metadata

File hashes

Hashes for amfiprot_amfitrack-0.0.1a14-py3-none-any.whl
Algorithm Hash digest
SHA256 8eca64bb72ca07cafb5fcec3eee4f26747727d608a6f1f87d8ddba66866f36ad
MD5 878c1d5c57f2f96e877c7a82408c7b04
BLAKE2b-256 c5923557834524ce0ec3d221ae9d581754c9887f1da45a6f127783d67eaffbbc

See more details on using hashes here.

Supported by

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