### OpenAnt MQTT Connection Examples Source: https://github.com/tigge/openant/blob/master/README.md These examples demonstrate connecting to different fitness devices via MQTT using the OpenAnt CLI. They show how to attach to the first available trainer, a specific power meter by ID, multiple devices from a configuration file, and how to override the topic for a specific device's data. ```bash openant mqtt --verbose FitnessDevice ``` ```bash openant mqtt --id 12345 --verbose PowerMeter ``` ```bash openant mqtt --verbose --config devices.json config ``` ```bash openant mqtt --config devices.json --device-topic 120:54368:my/heartrate config ``` -------------------------------- ### Create Workout from Ramp Source: https://github.com/tigge/openant/blob/master/docs/src/openant.devices.md Build a workout with a linear ramp of power levels. Specify start, stop, step, and the period at each level. Optionally, define a peak power for a triangular wave. ```python >>> Workout.from_ramp(100, 500, 50, 10.0) Workout(intervals=[(100, 10.0), (150, 10.0), (200, 10.0), (250, 10.0), (300, 10.0), (350, 10.0), (400, 10.0), (450, 10.0)], cycles=1, loop=False) ``` ```python >>> Workout.from_ramp(100, 100, 50, 10.0, peak=500, cycles=4) Workout(intervals=[(100, 10.0), (150, 10.0), (200, 10.0), (250, 10.0), (300, 10.0), (350, 10.0), (400, 10.0), (450, 10.0), (500, 10.0), (450, 10.0), (400, 10.0), (350, 10.0), (300, 10.0), (250, 10.0), (200, 10.0), (150, 10.0)], cycles=4, loop=False) ``` -------------------------------- ### Workout.from_ramp Source: https://github.com/tigge/openant/blob/master/docs/src/openant.devices.md Builds a Workout object from start, stop, and step power values with a specified period. ```APIDOC ## Workout.from_ramp ### Description Builds a Workout from start, stop and power step with a specified period between each level. Optionally creates a triangle wave if peak power is provided. ### Method `static from_ramp(start: int, stop: int, step: int, period: float, peak: int | None = None, **kwargs)` ### Parameters * **start** (int) - start power (W) * **stop** (int) - stop power (W) * **step** (int) - step power (W) * **period** (float) - period at each level (s) * **peak** (int | None) - peak power if triangle wave (W) ### Raises * **ValueError** - start > stop, stop < start, step == 0, period == 0, peak != 0 && peak < stop | peak < start ### Request Example ```python Workout.from_ramp(100, 500, 50, 10.0) Workout.from_ramp(100, 100, 50, 10.0, peak=500, cycles=4) ``` ### Response Example ```python Workout(intervals=[(100, 10.0), (150, 10.0), (200, 10.0), (250, 10.0), (300, 10.0), (350, 10.0), (400, 10.0), (450, 10.0)], cycles=1, loop=False) Workout(intervals=[(100, 10.0), (150, 10.0), (200, 10.0), (250, 10.0), (300, 10.0), (350, 10.0), (400, 10.0), (450, 10.0), (500, 10.0), (450, 10.0), (400, 10.0), (350, 10.0), (300, 10.0), (250, 10.0), (200, 10.0), (150, 10.0)], cycles=4, loop=False) ``` ``` -------------------------------- ### Stream ANT+ Data to MQTT Source: https://github.com/tigge/openant/blob/master/README.md Stream data from ANT+ devices to an MQTT server. This is useful for integrating with various systems. Refer to `openant influx --help` for available flags and MQTT server documentation for setup. ```bash openant mqtt --verbose FitnessDevice ``` -------------------------------- ### Initialize AntPlusDevice Node Source: https://github.com/tigge/openant/blob/master/docs/src/openant.devices.md Demonstrates how to initialize a Node and set the network key for an ANT+ device. This is a prerequisite for creating any ANT+ device instance. ```python node = Node() node.set_network_key(0x00, ANTPLUS_NETWORK_KEY) generic_device = AntPlusDevice(node) ``` -------------------------------- ### Run MQTT Server with Docker Source: https://github.com/tigge/openant/blob/master/README.md Set up an open MQTT server for testing using Docker. Configure mosquitto.conf to allow anonymous access on port 1883. ```bash docker run --rm -p 1883:1883 -v "$PWD/mosquitto.conf:/mosquitto/config/mosquitto.conf" eclipse-mosquitto:latest ``` -------------------------------- ### Configure Devices with devices.json Source: https://github.com/tigge/openant/blob/master/docs/index.md Use the 'config' command with a 'devices.json' file to manage connections to multiple ANT+ devices. ```bash openant influx --verbose --config devices.json config ``` -------------------------------- ### Run InfluxDB with Docker Source: https://github.com/tigge/openant/blob/master/README.md Quickly set up a local InfluxDB instance using Docker for data streaming. Ensure to configure a user, organization, bucket, and API token. ```bash docker run --rm -p 8086:8086 -v $PWD:/var/lib/influxdb2 influxdb:latest ``` -------------------------------- ### auto_create_device Utility Source: https://github.com/tigge/openant/blob/master/docs/src/openant.devices.md Automatically instantiates an ANT+ device object based on supplied parameters. ```APIDOC ## auto_create_device ### Description Auto instantiates ANT+ device object based on supplied parameters. ### Parameters - **node** (Node) - USB ANT node. - **device_id** (int) - Device ID or 0 for first found. - **device_type** (DeviceType | int | str) - Device type as a DeviceType, device type int or DeviceType.name. - **trans_type** (int) - Transmission type. ### Raises - **ValueError** - Profile object for device does not exist - needs creating. ``` -------------------------------- ### Create Workout from Arrays Source: https://github.com/tigge/openant/blob/master/docs/src/openant.devices.md Use this method to create a workout by providing lists of power setpoints and their corresponding durations. Ensures powers and periods lists are of equal length. ```python >>> Workout.from_arrays([100, 200, 300, 400], [5, 5.5, 10.2, 11.1]) Workout(intervals=[(100, 5), (200, 5.5), (300, 10.2), (400, 11.1)], cycles=1, loop=False) ``` -------------------------------- ### Standard Options Source: https://github.com/tigge/openant/blob/master/docs/src/openant.md Standard configuration options for the driver. ```APIDOC ## StandardOptions ### Description Standard driver options. ### Members - `StandardOptions.NoAckMessages`: Disables acknowledged messages. - `StandardOptions.NoBurstMessages`: Disables burst messages. - `StandardOptions.NoRxChannels`: Disables RX channels. - `StandardOptions.NoRxMessages`: Disables RX messages. - `StandardOptions.NoTxChannels`: Disables TX channels. - `StandardOptions.NoTxMessages`: Disables TX messages. - `StandardOptions.Reserved`: Reserved option. - `StandardOptions.from_byte(byte_value)`: Creates an instance from a byte value. ``` -------------------------------- ### FitnessEquipment Methods Source: https://github.com/tigge/openant/blob/master/docs/src/openant.md Details the methods available for interacting with FitnessEquipment devices. ```APIDOC ## FitnessEquipment.close_channel() ### Description Closes the communication channel for the FitnessEquipment. ### Method `close_channel` ### Parameters None explicitly documented. ### Response None explicitly documented. ``` ```APIDOC ## FitnessEquipment.on_data() ### Description Callback for when data is received from the FitnessEquipment. ### Method `on_data` ### Parameters None explicitly documented. ### Response None explicitly documented. ``` -------------------------------- ### openant.fs.manager.Application Source: https://github.com/tigge/openant/blob/master/docs/src/openant.fs.md Manages the OpenANT file system connection and operations. ```APIDOC ## class openant.fs.manager.Application Bases: `object` ### Methods #### authentication_pair(friendly_name) #### authentication_passkey(passkey) #### authentication_serial() #### create(typ, data, callback=None) #### disconnect() #### download(index, callback=None) #### download_directory(callback=None) #### erase(index) #### link() #### on_authentication(beacon) #### on_link(beacon) #### on_transport(beacon) #### set_time(time=datetime.datetime(2026, 5, 19, 17, 10, 40, 480388, tzinfo=datetime.timezone.utc)) ### Parameters #### Query Parameters - **time** (datetime) - Optional - The desired time in UTC. If None, the current time is used. ``` ```APIDOC #### setup_channel(channel) #### start() #### stop() #### upload(index, data, callback=None) ``` -------------------------------- ### DropperSeatpost Methods Source: https://github.com/tigge/openant/blob/master/docs/src/openant.md Provides details on the methods available for interacting with a DropperSeatpost device. ```APIDOC ## DropperSeatpost.on_data() ### Description Callback for when data is received from the DropperSeatpost. ### Method `on_data` ### Parameters None explicitly documented. ### Response None explicitly documented. ``` ```APIDOC ## DropperSeatpost.set_data() ### Description Sets data for the DropperSeatpost device. ### Method `set_data` ### Parameters None explicitly documented. ### Response None explicitly documented. ``` ```APIDOC ## DropperSeatpost.set_valve() ### Description Sets the valve state for the DropperSeatpost device. ### Method `set_valve` ### Parameters None explicitly documented. ### Response None explicitly documented. ``` -------------------------------- ### Advanced Options Source: https://github.com/tigge/openant/blob/master/docs/src/openant.md Configuration options for advanced driver settings. ```APIDOC ## AdvancedOptionsThree ### Description Advanced options set three. ### Members - `AdvancedOptionsThree.SelectiveDataUpdateEnabled`: Enables selective data updates. - `AdvancedOptionsThree.from_byte(byte_value)`: Creates an instance from a byte value. ``` ```APIDOC ## AdvancedOptionsTwo ### Description Advanced options set two. ### Members - `AdvancedOptionsTwo.ExtAssignEnabled`: Enables extended assignment. - `AdvancedOptionsTwo.ExtMessageEnabled`: Enables extended messages. - `AdvancedOptionsTwo.Fit1Enabled`: Enables FIT1. - `AdvancedOptionsTwo.FsAntFsEnabled`: Enables FS ANT-FS. - `AdvancedOptionsTwo.LedEnabled`: Enables LED. - `AdvancedOptionsTwo.ProximitySearchEnabled`: Enables proximity search. - `AdvancedOptionsTwo.Reserved`: Reserved option. - `AdvancedOptionsTwo.ScanModeEnabled`: Enables scan mode. - `AdvancedOptionsTwo.from_byte(byte_value)`: Creates an instance from a byte value. ``` -------------------------------- ### openant.devices.scanner.Scanner Source: https://github.com/tigge/openant/blob/master/docs/src/openant.devices.md Handles scanning for ANT+ devices, including callbacks for when devices are found or update their common data pages, and saving found devices. ```APIDOC ## class openant.devices.scanner.Scanner(node: [Node](openant.easy.md#openant.easy.node.Node), device_id=0, device_type=0, period=8070, trans_type=0) Bases: [`AntPlusDevice`](#openant.devices.common.AntPlusDevice) #### *static* on_found(device_tuple: Tuple[int, int, int]) Callback when a new device is found * **Parameters:** **int****]** ( *\_ Tuple* *[**int* *,* *int* *,*) – (device_id, device_type, transmission_type) of found device #### *static* on_update(device_tuple: Tuple[int, int, int], common: [CommonData](#openant.devices.common.CommonData)) Callback when a device updates it’s common date pages * **Parameters:** * **int****]** (*dev Tuple* *[**int* *,* *int* *,*) – (device_id, device_type, transmission_type) of found device * **CommonData** (*common*) – common page data of device #### save(file_path: str) Save the devices found in session to a file_path in json format * **Parameters:** **str** (*file_path*) – path to .json file to save ``` -------------------------------- ### Beacon Methods Source: https://github.com/tigge/openant/blob/master/docs/src/openant.md Methods for interacting with ANT FS beacon functionality. ```APIDOC ## Beacon.BEACON_ID ### Description Identifier for the beacon. ### Method (Not applicable) ### Endpoint (Not applicable) ### Parameters (Not specified) ### Request Example (Not applicable) ### Response (Not specified) ``` ```APIDOC ## Beacon.ClientDeviceState ### Description Represents the state of a client device. ### Method (Not applicable) ### Endpoint (Not applicable) ### Parameters (Not specified) ### Request Example (Not applicable) ### Response (Not specified) ``` ```APIDOC ## Beacon.get_channel_period() ### Description Gets the channel period for the beacon. ### Method (Not specified) ### Endpoint (Not applicable) ### Parameters (Not specified) ### Request Example (Not applicable) ### Response (Not specified) ``` ```APIDOC ## Beacon.get_client_device_state() ### Description Gets the current state of the client device. ### Method (Not specified) ### Endpoint (Not applicable) ### Parameters (Not specified) ### Request Example (Not applicable) ### Response (Not specified) ``` ```APIDOC ## Beacon.get_descriptor() ### Description Retrieves the descriptor for the beacon. ### Method (Not specified) ### Endpoint (Not applicable) ### Parameters (Not specified) ### Request Example (Not applicable) ### Response (Not specified) ``` ```APIDOC ## Beacon.get_serial() ### Description Gets the serial number associated with the beacon. ### Method (Not specified) ### Endpoint (Not applicable) ### Parameters (Not specified) ### Request Example (Not applicable) ### Response (Not specified) ``` ```APIDOC ## Beacon.is_data_available() ### Description Checks if data is available from the beacon. ### Method (Not specified) ### Endpoint (Not applicable) ### Parameters (Not specified) ### Request Example (Not applicable) ### Response (Not specified) ``` ```APIDOC ## Beacon.is_pairing_enabled() ### Description Checks if pairing is enabled for the beacon. ### Method (Not specified) ### Endpoint (Not applicable) ### Parameters (Not specified) ### Request Example (Not applicable) ### Response (Not specified) ``` ```APIDOC ## Beacon.is_upload_enabled() ### Description Checks if data upload is enabled for the beacon. ### Method (Not specified) ### Endpoint (Not applicable) ### Parameters (Not specified) ### Request Example (Not applicable) ### Response (Not specified) ``` ```APIDOC ## Beacon.parse() ### Description Parses beacon data. ### Method (Not specified) ### Endpoint (Not applicable) ### Parameters (Not specified) ### Request Example (Not applicable) ### Response (Not specified) ``` -------------------------------- ### CommandPipe Class Source: https://github.com/tigge/openant/blob/master/docs/src/openant.fs.md Manages command pipes for various operations including file creation, directory filtering, factory resets, and setting authentication passkeys or client friendly names. ```APIDOC ## class openant.fs.commandpipe.CommandPipe ### Description Manages command pipes for various operations. #### Inner Classes - **Type**: Enum for command pipe types (REQUEST, RESPONSE, TIME, CREATE_FILE, DIRECTORY_FILTER, SET_AUTHENTICATION_PASSKEY, SET_CLIENT_FRIENDLY_NAME, FACTORY_RESET_COMMAND). ### Methods - **get()**: Gets the command pipe data. ### class openant.fs.commandpipe.Request #### Description Represents a request in a command pipe. ### class openant.fs.commandpipe.Response #### Description Represents a response in a command pipe. #### Inner Classes - **Response**: Enum for response status (FAILED). ### class openant.fs.commandpipe.CreateFile #### Description Represents a create file command within a command pipe. #### Methods - **get()**: Gets the command data. ### class openant.fs.commandpipe.CreateFileResponse #### Description Represents a response to a create file command. ``` -------------------------------- ### Workout.from_arrays Source: https://github.com/tigge/openant/blob/master/docs/src/openant.devices.md Creates a Workout object from arrays of power setpoints and their corresponding periods. ```APIDOC ## Workout.from_arrays ### Description Creates a workout from arrays of powers and periods. ### Method `static from_arrays(powers: List[int], periods: List[float], **kwargs)` ### Parameters * **powers** (List[int]) - power setpoints * **periods** (List[float]) - period to hold each power (s) ### Raises * **ValueError** - powers and periods not equal length ### Request Example ```python Workout.from_arrays([100, 200, 300, 400], [5, 5.5, 10.2, 11.1]) ``` ### Response Example ```python Workout(intervals=[(100, 5), (200, 5.5), (300, 10.2), (400, 11.1)], cycles=1, loop=False) ``` ``` -------------------------------- ### Commons Module Functions Source: https://github.com/tigge/openant/blob/master/docs/src/openant.md Utility functions for formatting lists and checking the operating system. ```APIDOC ## Commons Module Functions ### `format_list()` Formats a list into a string. ### `is_windows()` Checks if the current operating system is Windows. ``` -------------------------------- ### Command Class Hierarchy Source: https://github.com/tigge/openant/blob/master/docs/src/openant.fs.md Provides a base class for commands and specific command implementations for various operations like authentication, disconnection, download, erase, link, ping, and upload. ```APIDOC ## Command Classes ### class openant.fs.command.Command #### Description Base class for all commands. #### Methods - **get()**: Gets the command data. - **get_id()**: Gets the command ID. #### Inner Classes - **Type**: Enum for command types (AUTHENTICATE, AUTHENTICATE_RESPONSE, DISCONNECT, etc.). ### class openant.fs.command.AuthenticateBase #### Description Base class for authentication commands. #### Methods - **get()**: Gets the command data. - **get_data_array()**: Gets the command data as an array. - **get_data_string()**: Gets the command data as a string. - **get_serial()**: Gets the serial number. ### class openant.fs.command.AuthenticateCommand #### Description Represents an authentication command. #### Inner Classes - **Request**: Enum for authentication request types (PASS_THROUGH, SERIAL, PAIRING, PASSKEY_EXCHANGE). ### class openant.fs.command.AuthenticateResponse #### Description Represents an authentication response. #### Inner Classes - **Response**: Enum for authentication response types (NOT_AVAILABLE, ACCEPT, REJECT). ### class openant.fs.command.DisconnectCommand #### Description Represents a disconnect command. #### Inner Classes - **Type**: Enum for disconnect return types (RETURN_LINK, RETURN_BROADCAST). ### class openant.fs.command.DownloadRequest #### Description Represents a download request command. ### class openant.fs.command.DownloadResponse #### Description Represents a download response. #### Inner Classes - **Response**: Enum for download response status (OK, NOT_EXIST, NOT_READABLE, NOT_READY, INVALID_REQUEST, INCORRECT_CRC). ### class openant.fs.command.EraseRequestCommand #### Description Represents an erase request command. ### class openant.fs.command.EraseResponse #### Description Represents an erase response. #### Inner Classes - **Response**: Enum for erase response status (ERASE_SUCCESSFUL, ERASE_FAILED, NOT_READY). ### class openant.fs.command.LinkCommand #### Description Represents a link command. ### class openant.fs.command.PingCommand #### Description Represents a ping command. ### class openant.fs.command.UploadDataCommand #### Description Represents an upload data command. #### Methods - **get()**: Gets the command data. ### class openant.fs.command.UploadDataResponse #### Description Represents an upload data response. #### Inner Classes - **Response**: Enum for upload data response status (OK, FAILED). ### class openant.fs.command.UploadRequest #### Description Represents an upload request command. ### class openant.fs.command.UploadResponse #### Description Represents an upload response. #### Inner Classes - **Response**: Enum for upload response status (OK, NOT_EXIST, NOT_WRITEABLE, NOT_ENOUGH_SPACE, INVALID_REQUEST, NOT_READY). ### Function - **openant.fs.command.parse(data)**: Parses command data. ``` -------------------------------- ### openant.fs.commandpipe.TimeResponse Source: https://github.com/tigge/openant/blob/master/docs/src/openant.fs.md Represents a response object for time-related commands. ```APIDOC ## class openant.fs.commandpipe.TimeResponse(request_id, response) Bases: [`Response`](#openant.fs.commandpipe.Response) ``` -------------------------------- ### Exceptions Source: https://github.com/tigge/openant/blob/master/docs/src/openant.md Custom exceptions for driver-related errors. ```APIDOC ## DriverException ### Description Base exception class for driver errors. ## DriverNotFound ### Description Exception raised when a driver cannot be found. ## DriverTimeoutException ### Description Exception raised when a driver operation times out. ``` -------------------------------- ### Driver Operations Source: https://github.com/tigge/openant/blob/master/docs/src/openant.md Provides methods for interacting with ANT devices, including opening, closing, reading, writing, and finding devices. ```APIDOC ## Driver ### Description Represents a driver for an ANT device. ### Methods - `Driver.open()`: Opens the connection to the ANT device. - `Driver.close()`: Closes the connection to the ANT device. - `Driver.find()`: Finds an available ANT device. - `Driver.read()`: Reads data from the ANT device. - `Driver.write(data)`: Writes data to the ANT device. ``` ```APIDOC ## USBDriver ### Description Represents a USB driver for an ANT device. ### Attributes - `USBDriver.ID_PRODUCT`: The product ID of the USB device. - `USBDriver.ID_VENDOR`: The vendor ID of the USB device. ### Methods - `USBDriver.open()`: Opens the connection to the USB ANT device. - `USBDriver.close()`: Closes the connection to the USB ANT device. - `USBDriver.find()`: Finds an available USB ANT device. - `USBDriver.read()`: Reads data from the USB ANT device. - `USBDriver.write(data)`: Writes data to the USB ANT device. - `USBDriver.dev`: The underlying USB device object. ``` ```APIDOC ## USB2Driver ### Description Represents a USB 2.0 driver for an ANT device. ### Attributes - `USB2Driver.ID_PRODUCT`: The product ID for USB 2.0 devices. - `USB2Driver.ID_VENDOR`: The vendor ID for USB 2.0 devices. ``` ```APIDOC ## USB3Driver ### Description Represents a USB 3.0 driver for an ANT device. ### Attributes - `USB3Driver.ID_PRODUCT`: The product ID for USB 3.0 devices. - `USB3Driver.ID_VENDOR`: The vendor ID for USB 3.0 devices. ``` -------------------------------- ### FitnessEquipmentState Enum Source: https://github.com/tigge/openant/blob/master/docs/src/openant.devices.md Enumeration for the state of fitness equipment. ```APIDOC ## class openant.devices.fitness_equipment.FitnessEquipmentState ### Description Enum for fitness equipment state. ### Members - **Unknown** (0) - **Asleep** (1) - **Ready** (2) - **InUse** (3) - **Finished** (4) ``` -------------------------------- ### AdvancedOptions Class Source: https://github.com/tigge/openant/blob/master/docs/src/openant.md Represents advanced options for ANT driver configuration. ```APIDOC ## AdvancedOptions Class ### `LowPrioritySearchNEnabled` Enables low priority search. ### `NetworkEnabled` Enables network mode. ### `PerChannelTxPowerEnabled` Enables per-channel transmit power. ### `Reserved` Reserved field. ### `ScriptEnabled` Enables script execution. ### `SearchListEnabled` Enables search list functionality. ### `SerialNumberEnabled` Enables serial number reporting. ### `from_byte()` Creates an AdvancedOptions object from a byte value. ``` -------------------------------- ### openant.fs.commandpipe.Time Source: https://github.com/tigge/openant/blob/master/docs/src/openant.fs.md Represents time information for command piping, including current time, system time, and time format. ```APIDOC ## class openant.fs.commandpipe.Time(current_time, system_time, time_format) Bases: [`CommandPipe`](#openant.fs.commandpipe.CommandPipe) ``` -------------------------------- ### openant.devices.shift.FunctionSetConfiguration Source: https://github.com/tigge/openant/blob/master/docs/src/openant.devices.md Configuration for function set behavior, specifying whether short, double, or long presses are enabled. ```APIDOC ### *class* openant.devices.shift.FunctionSetConfiguration(is_short_press_enabled: bool = False, is_double_press_enabled: bool = False, is_long_press_enabled: bool = False) Bases: `object` #### is_double_press_enabled *: bool* *= False* #### is_long_press_enabled *: bool* *= False* #### is_short_press_enabled *: bool* *= False* ``` -------------------------------- ### Node Methods Source: https://github.com/tigge/openant/blob/master/docs/src/openant.md Methods for interacting with ANT nodes. ```APIDOC ## Node.get_capabilities() ### Description Retrieves the capabilities of the ANT node. ### Method (Not specified) ### Endpoint (Not applicable) ### Parameters (Not specified) ### Request Example (Not applicable) ### Response (Not specified) ``` ```APIDOC ## Node.get_meta_data() ### Description Retrieves metadata associated with the ANT node. ### Method (Not specified) ### Endpoint (Not applicable) ### Parameters (Not specified) ### Request Example (Not applicable) ### Response (Not specified) ``` ```APIDOC ## Node.new_channel() ### Description Creates a new channel on the ANT node. ### Method (Not specified) ### Endpoint (Not applicable) ### Parameters (Not specified) ### Request Example (Not applicable) ### Response (Not specified) ``` ```APIDOC ## Node.remove_channel() ### Description Removes a channel from the ANT node. ### Method (Not specified) ### Endpoint (Not applicable) ### Parameters (Not specified) ### Request Example (Not applicable) ### Response (Not specified) ``` ```APIDOC ## Node.remove_channel_id() ### Description Removes a channel by its ID from the ANT node. ### Method (Not specified) ### Endpoint (Not applicable) ### Parameters (Not specified) ### Request Example (Not applicable) ### Response (Not specified) ``` ```APIDOC ## Node.request_message() ### Description Requests a message from the ANT node. ### Method (Not specified) ### Endpoint (Not applicable) ### Parameters (Not specified) ### Request Example (Not applicable) ### Response (Not specified) ``` ```APIDOC ## Node.set_led() ### Description Controls the LED on the ANT node. ### Method (Not specified) ### Endpoint (Not applicable) ### Parameters (Not specified) ### Request Example (Not applicable) ### Response (Not specified) ``` ```APIDOC ## Node.set_network_key() ### Description Sets the network key for the ANT node. ### Method (Not specified) ### Endpoint (Not applicable) ### Parameters (Not specified) ### Request Example (Not applicable) ### Response (Not specified) ``` ```APIDOC ## Node.start() ### Description Starts the ANT node service. ### Method (Not specified) ### Endpoint (Not applicable) ### Parameters (Not specified) ### Request Example (Not applicable) ### Response (Not specified) ``` ```APIDOC ## Node.stop() ### Description Stops the ANT node service. ### Method (Not specified) ### Endpoint (Not applicable) ### Parameters (Not specified) ### Request Example (Not applicable) ### Response (Not specified) ``` ```APIDOC ## Node.wait_for_event() ### Description Waits for a specific event on the ANT node. ### Method (Not specified) ### Endpoint (Not applicable) ### Parameters (Not specified) ### Request Example (Not applicable) ### Response (Not specified) ``` ```APIDOC ## Node.wait_for_response() ### Description Waits for a response from the ANT node. ### Method (Not specified) ### Endpoint (Not applicable) ### Parameters (Not specified) ### Request Example (Not applicable) ### Response (Not specified) ``` ```APIDOC ## Node.wait_for_special() ### Description Waits for a special condition or event on the ANT node. ### Method (Not specified) ### Endpoint (Not applicable) ### Parameters (Not specified) ### Request Example (Not applicable) ### Response (Not specified) ``` -------------------------------- ### openant.fs.file.File Source: https://github.com/tigge/openant/blob/master/docs/src/openant.fs.md Represents a file within the OpenANT file system, including its metadata. ```APIDOC ## class openant.fs.file.File(index, typ, ident, typ_flags, flags, size, date) Bases: `object` ### Methods #### get_date() #### get_fit_file_number() #### get_fit_sub_type() #### get_flags_string() #### get_identifier() #### get_index() #### get_size() #### get_type() #### is_append_only() #### is_archived() #### is_encrypted() #### is_erasable() #### is_readable() #### is_writable() #### static parse(data) ``` -------------------------------- ### openant.fs.file.Directory Source: https://github.com/tigge/openant/blob/master/docs/src/openant.fs.md Represents a directory within the OpenANT file system. ```APIDOC ## class openant.fs.file.Directory(version, time_format, current_system_time, last_modified, files) Bases: `object` ### Methods #### get_current_system_time() #### get_files() #### get_last_modified() #### get_time_format() #### get_version() #### static parse(data) #### print_list() ``` -------------------------------- ### Application Management Source: https://github.com/tigge/openant/blob/master/docs/src/openant.md Methods for managing application connections and file operations within AntFS. ```APIDOC ## Application Management ### Description Provides methods to manage application authentication, file transfers, and connection states within the AntFS environment. ### Methods - `Application.authentication_pair()` - `Application.authentication_passkey()` - `Application.authentication_serial()` - `Application.create()` - `Application.disconnect()` - `Application.download()` - `Application.download_directory()` - `Application.erase()` - `Application.link()` - `Application.on_authentication()` - `Application.on_link()` - `Application.on_transport()` - `Application.set_time()` - `Application.setup_channel()` - `Application.start()` - `Application.stop()` - `Application.upload()` ``` -------------------------------- ### AdvancedOptionsThree Class Source: https://github.com/tigge/openant/blob/master/docs/src/openant.md Represents a third set of advanced options for ANT driver configuration. ```APIDOC ## AdvancedOptionsThree Class ### `AdvancedBurstEnabled` Enables advanced burst mode. ### `EncryptedChannelEnabled` Enables encrypted channels. ### `EventBufferingEnabled` Enables event buffering. ### `EventFilteringEnabled` Enables event filtering. ### `HighDutySearchEnabled` Enables high duty cycle search. ### `Reserved` Reserved field. ### `SearchSharingEnabled` Enables search sharing between channels. ``` -------------------------------- ### Node Class Methods Source: https://github.com/tigge/openant/blob/master/docs/src/openant.easy.md Methods for managing the ANT node and its channels. ```APIDOC ## Node Class ### Description Represents the ANT node, providing methods to initialize, configure, and manage channels. ### Methods - **get_capabilities()**: Requests the ANT node's capabilities. - **get_meta_data()**: Requests the ANT node's metadata. - **new_channel(ctype: int, network_number: int = 0, ext_assign: int | None = None)**: Creates a new ANT channel. - **remove_channel(channel: Channel)**: Removes an existing ANT channel. - **remove_channel_id(channel_id: int)**: Removes a channel by its ID. - **request_message(messageId: int)**: Requests a specific message from the ANT node. - **set_led(enabled: bool)**: Controls the LED on the ANT node. - **set_network_key(network: int, key: List[int])**: Sets the network key for a specific network. - **start()**: Starts the ANT node. - **stop()**: Stops the ANT node. - **wait_for_event(ok_codes: list)**: Waits for a specific event code on the node. - **wait_for_response(event_id: int)**: Waits for a response to a sent message on the node. - **wait_for_special(event_id: int)**: Waits for special responses on the node. ``` -------------------------------- ### Lev.on_data Source: https://github.com/tigge/openant/blob/master/docs/src/openant.devices.md Callback for receiving raw data from the LEV device. ```APIDOC ## Lev.on_data ### Description Override this to capture raw data when received in child classes. ### Method `on_data(data)` ``` -------------------------------- ### Driver Discovery Source: https://github.com/tigge/openant/blob/master/docs/src/openant.md Function to find an appropriate ANT driver. ```APIDOC ## find_driver() ### Description Finds and returns an appropriate ANT driver instance. ### Usage ```python driver = find_driver() ``` ``` -------------------------------- ### format_list Function Source: https://github.com/tigge/openant/blob/master/docs/src/openant.base.md Formats a list into a string representation. ```APIDOC ## openant.base.commons.format_list(l) ``` -------------------------------- ### File Operations Source: https://github.com/tigge/openant/blob/master/docs/src/openant.md Methods for interacting with file properties and parsing. ```APIDOC ## File Operations ### Description Provides methods to get specific attributes of a file or to parse file content. ### Methods - `File.get_fit_sub_type()` - `File.get_flags_string()` - `File.get_identifier()` - `File.get_index()` - `File.get_size()` - `File.get_type()` - `File.is_append_only()` - `File.is_archived()` - `File.is_encrypted()` - `File.is_erasable()` - `File.is_readable()` - `File.is_writable()` - `File.parse()` ``` -------------------------------- ### Scan for ANT+ Devices Source: https://github.com/tigge/openant/blob/master/README.md Scan for nearby ANT+ devices. Options include printing to the terminal, saving to a JSON file, or automatically creating device objects for data printing. ```bash openant scan ``` ```bash openant scan --outfile devices.json ``` ```bash openant scan --auto_create ``` -------------------------------- ### Channel Methods Source: https://github.com/tigge/openant/blob/master/docs/src/openant.md Methods available for interacting with communication channels. ```APIDOC ## Channel.on_burst_data() ### Description Handles incoming burst data on a channel. ### Method (Not specified, likely a callback or event handler) ### Endpoint (Not applicable for SDK methods) ### Parameters (Not specified) ### Request Example (Not applicable) ### Response (Not specified) ``` ```APIDOC ## Channel.open() ### Description Opens a communication channel. ### Method (Not specified) ### Endpoint (Not applicable) ### Parameters (Not specified) ### Request Example (Not applicable) ### Response (Not specified) ``` ```APIDOC ## Channel.open_rx_scan_mode() ### Description Opens the channel in receive scan mode. ### Method (Not specified) ### Endpoint (Not applicable) ### Parameters (Not specified) ### Request Example (Not applicable) ### Response (Not specified) ``` ```APIDOC ## Channel.request_message() ### Description Requests a message on the channel. ### Method (Not specified) ### Endpoint (Not applicable) ### Parameters (Not specified) ### Request Example (Not applicable) ### Response (Not specified) ``` ```APIDOC ## Channel.send_acknowledged_data() ### Description Sends data on the channel with acknowledgment. ### Method (Not specified) ### Endpoint (Not applicable) ### Parameters (Not specified) ### Request Example (Not applicable) ### Response (Not specified) ``` ```APIDOC ## Channel.send_broadcast_data() ### Description Sends broadcast data on the channel. ### Method (Not specified) ### Endpoint (Not applicable) ### Parameters (Not specified) ### Request Example (Not applicable) ### Response (Not specified) ``` ```APIDOC ## Channel.send_burst_transfer() ### Description Initiates a burst data transfer on the channel. ### Method (Not specified) ### Endpoint (Not applicable) ### Parameters (Not specified) ### Request Example (Not applicable) ### Response (Not specified) ``` ```APIDOC ## Channel.send_burst_transfer_packet() ### Description Sends a packet as part of a burst transfer. ### Method (Not specified) ### Endpoint (Not applicable) ### Parameters (Not specified) ### Request Example (Not applicable) ### Response (Not specified) ``` ```APIDOC ## Channel.set_id() ### Description Sets the channel identifier. ### Method (Not specified) ### Endpoint (Not applicable) ### Parameters (Not specified) ### Request Example (Not applicable) ### Response (Not specified) ``` ```APIDOC ## Channel.set_period() ### Description Sets the channel's communication period. ### Method (Not specified) ### Endpoint (Not applicable) ### Parameters (Not specified) ### Request Example (Not applicable) ### Response (Not specified) ``` ```APIDOC ## Channel.set_rf_freq() ### Description Sets the radio frequency for the channel. ### Method (Not specified) ### Endpoint (Not applicable) ### Parameters (Not specified) ### Request Example (Not applicable) ### Response (Not specified) ``` ```APIDOC ## Channel.set_search_timeout() ### Description Sets the timeout for channel search operations. ### Method (Not specified) ### Endpoint (Not applicable) ### Parameters (Not specified) ### Request Example (Not applicable) ### Response (Not specified) ``` ```APIDOC ## Channel.set_search_waveform() ### Description Sets the waveform used for channel searching. ### Method (Not specified) ### Endpoint (Not applicable) ### Parameters (Not specified) ### Request Example (Not applicable) ### Response (Not specified) ``` ```APIDOC ## Channel.wait_for_event() ### Description Waits for a specific event on the channel. ### Method (Not specified) ### Endpoint (Not applicable) ### Parameters (Not specified) ### Request Example (Not applicable) ### Response (Not specified) ``` ```APIDOC ## Channel.wait_for_response() ### Description Waits for a response on the channel. ### Method (Not specified) ### Endpoint (Not applicable) ### Parameters (Not specified) ### Request Example (Not applicable) ### Response (Not specified) ``` ```APIDOC ## Channel.wait_for_special() ### Description Waits for a special condition or event on the channel. ### Method (Not specified) ### Endpoint (Not applicable) ### Parameters (Not specified) ### Request Example (Not applicable) ### Response (Not specified) ``` -------------------------------- ### Channel Class Methods Source: https://github.com/tigge/openant/blob/master/docs/src/openant.easy.md Methods available for managing and interacting with an ANT channel. ```APIDOC ## Channel Class ### Description Represents an ANT channel, providing methods to control its state, send data, and manage communication. ### Methods - **close()**: Closes the ANT channel. - **enable_extended_messages(enable: bool)**: Enables or disables extended messages for the channel. - **on_acknowledge(data)**: Callback for acknowledging data. - **on_acknowledge_data(data)**: Callback for acknowledged data. - **on_broadcast_data(data)**: Callback for broadcast data. - **on_broadcast_tx_data(data)**: Callback for broadcast transmission data. - **on_burst_data(data)**: Callback for burst data. - **open()**: Opens the ANT channel. - **open_rx_scan_mode()**: Opens the channel in receive scan mode. - **request_message(messageId: int)**: Requests a specific message from the ANT device. - **send_acknowledged_data(data: List[int])**: Sends acknowledged data over the channel. - **send_broadcast_data(data: List[int])**: Sends broadcast data over the channel. - **send_burst_transfer(data: List[int])**: Initiates a burst data transfer. - **send_burst_transfer_packet(channelSeq, data: List[int], first: bool)**: Sends a packet for a burst data transfer. - **set_id(deviceNum: int, deviceType: int, transmissionType: int)**: Sets the channel ID, device number, device type, and transmission type. - **set_period(messagePeriod: int)**: Sets the message period for the channel. - **set_rf_freq(rfFreq: int)**: Sets the RF frequency for the channel. - **set_search_timeout(timeout: int)**: Sets the search timeout for the channel. - **set_search_waveform(waveform: int)**: Sets the search waveform for the channel. - **wait_for_event(ok_codes: list)**: Waits for a specific event code. - **wait_for_response(event_id: int)**: Waits for a response to a sent message. - **wait_for_special(event_id: int)**: Waits for special responses. ``` -------------------------------- ### Scan for ANT Devices Source: https://github.com/tigge/openant/blob/master/docs/index.md Scan for nearby ANT devices. Options include saving found devices to a JSON file or automatically creating device objects for data printing. ```bash # print devices found to terminal openant scan # capture devices found to devices.json for use with antinflux openant scan --outfile devices.json # instantiate object when found so that device data is also printed openant scan --auto_create ``` -------------------------------- ### DriverException Source: https://github.com/tigge/openant/blob/master/docs/src/openant.base.md Base exception class for driver-related errors. ```APIDOC ## *exception* openant.base.driver.DriverException Bases: `Exception` ``` -------------------------------- ### FitnessEquipment Class Source: https://github.com/tigge/openant/blob/master/docs/src/openant.devices.md Represents a fitness equipment device. Allows control over resistance and workout execution. ```APIDOC ## class openant.devices.fitness_equipment.FitnessEquipment ### Description Represents a fitness equipment device. ### Methods #### `close_channel()` Closes and removes the device channel on the Node. #### `on_data(data: array)` Override this to capture raw data when received in child classes. #### `run_workout(workout: Workout)` Executes a given workout on the fitness equipment. #### `set_basic_resistance(resistance: float)` Sets the basic resistance level. #### `set_target_power(power: int)` Sets the target power output. ``` -------------------------------- ### openant.devices.lev.LevDisplayCommand Source: https://github.com/tigge/openant/blob/master/docs/src/openant.devices.md Represents ANT+ light electric vehicle (LEV) data, including gear status, lights, and turn signals. ```APIDOC ## class openant.devices.lev.LevDisplayCommand(gear_rear: int = 0, gear_front: int = 0, lights: bool = False, light_high_beam: bool = False, turn_signal_left: bool = False, turn_signal_right: bool = False) Bases: [`DeviceData`](#openant.devices.common.DeviceData) ANT+ light electric vehicle (LEV) data #### gear_front *: int* *= 0* #### gear_rear *: int* *= 0* #### light_high_beam *: bool* *= False* #### lights *: bool* *= False* #### *static* to_bytes(dc) #### *static* to_int(dc) #### turn_signal_left *: bool* *= False* #### turn_signal_right *: bool* *= False* ``` -------------------------------- ### Ant Class Methods Source: https://github.com/tigge/openant/blob/master/docs/src/openant.md The Ant class provides methods for managing ANT channels, sending and receiving data, and configuring ANT device settings. ```APIDOC ## Ant Class Methods ### `assign_channel()` Assigns a channel to the ANT device. ### `channel_event_function()` Callback function for channel events. ### `close_channel()` Closes an assigned ANT channel. ### `enable_extended_messages()` Enables extended messaging capabilities for a channel. ### `open_channel()` Opens an ANT channel for communication. ### `open_rx_scan_mode()` Opens the ANT device in receive scan mode. ### `read_message()` Reads a message from an ANT channel. ### `request_message()` Requests a specific message from the ANT device. ### `reset_system()` Resets the ANT system. ### `response_function()` Callback function for ANT responses. ### `send_acknowledged_data()` Sends acknowledged data over an ANT channel. ### `send_broadcast_data()` Sends broadcast data over an ANT channel. ### `send_burst_transfer()` Initiates a burst data transfer. ### `send_burst_transfer_packet()` Sends a packet as part of a burst transfer. ### `set_channel_id()` Sets the channel identifier. ### `set_channel_period()` Sets the transmission period for a channel. ### `set_channel_rf_freq()` Sets the radio frequency for a channel. ### `set_channel_search_timeout()` Sets the search timeout for a channel. ### `set_led()` Controls the ANT device's LED. ### `set_network_key()` Sets the network key for ANT communication. ### `set_search_waveform()` Configures the search waveform for channel discovery. ### `start()` Starts the ANT device. ### `stop()` Stops the ANT device. ### `unassign_channel()` Unassigns an ANT channel. ### `write_message()` Writes a message to an ANT channel. ### `write_message_timeslot()` Writes a message to an ANT channel within a specific timeslot. ``` -------------------------------- ### openant.fs.manager.AntFSException Source: https://github.com/tigge/openant/blob/master/docs/src/openant.fs.md Base exception class for OpenANT File System errors. ```APIDOC ## exception openant.fs.manager.AntFSException(error, errno=None) Bases: `Exception` ### Methods #### get_error() ``` -------------------------------- ### HeartRate.on_data Source: https://github.com/tigge/openant/blob/master/docs/src/openant.devices.md Callback for receiving raw data from the heart rate monitor. ```APIDOC ## HeartRate.on_data ### Description Override this to capture raw data when received in child classes. ### Method `on_data(data)` ``` -------------------------------- ### openant.base.driver.find_driver() Source: https://github.com/tigge/openant/blob/master/docs/src/openant.base.md Automatically finds available ANT drivers. This function is crucial for initializing communication with ANT devices. ```APIDOC ## openant.base.driver.find_driver() ### Description Auto-find available driver. ### Raises * **DriverNotFound** – unable to find any compatible drivers ``` -------------------------------- ### AntFS Exceptions Source: https://github.com/tigge/openant/blob/master/docs/src/openant.md Custom exceptions for AntFS related errors. ```APIDOC ## AntFS Exceptions ### Description Defines custom exception classes to handle specific errors encountered during AntFS operations. ### Exception Classes - `AntFSAuthenticationException` - `AntFSCreateFileException` - `AntFSDownloadException` - `AntFSEraseException` - `AntFSException` - `AntFSException.get_error()` - `AntFSTimeException` - `AntFSUploadException` ``` -------------------------------- ### Stream ANT+ Data to InfluxDB Source: https://github.com/tigge/openant/blob/master/README.md Stream data from ANT+ devices to an InfluxDB instance. Supports filtering by device type, specific device ID, and configuration files for multiple devices. ```bash openant influx --verbose FitnessDevice ``` ```bash openant influx --id 12345 --verbose PowerMeter ``` ```bash openant influx --verbose --config devices.json config ```