Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@betaflight/api

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@betaflight/api

A high-level API to read data from betaflight flight controllers

  • 0.4.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

@betaflight/api

A high level api for Betaflight

Betaflight api is a package built on top of the MSP protocol to provide a high level API to query objects and values from betaflight flight controllers, managing backwards compatibilty, and providing type information.

This library should be used if you want to write a user interface or query data specifically from betaflight flight controllers. This library is not gaurenteed to work with other types of flight controller.

Please see @betaflight/api-server for an even higher level graph based api for betaflight flight controllers.

PLEASE NOTE: THIS API IS CHANGING ALL THE TIME, IT IS NOT RECOMMENDED FOR PRODUCTION USAGE YET

Usage

$ yarn add @beteflight/api
import { ports, open, close, apiVersion, readFeatures, readAttitude, readGps } from "@betaflight/api";

(async () => {
  const portsList = await ports();

  console.log(portsList);

  const port = portsList[0];

  // Connect to the device, estabilsh it's an MSP device and read its API version
  await open(port, () => {
    console.log("Closed callback")
  });
  console.log(apiVersion(port));

  consolt.log(await readFeatures(port));

  while (true) {
    console.log(Promise.all([
      readAttitude(port),
      readAnalogValues(port)
    ]);
    ...
  }

  // Close the port when you are done with it
  await close(port)
})();

Keywords

FAQs

Package last updated on 11 Nov 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc