Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wifi connector #21

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
"VERSION": false,
"LICENSE": false
},
"parserOptions": {
"ecmaVersion": 2017
},
"rules": {
"comma-dangle": [1,"always-multiline"],
"no-cond-assign": [1,"always"],
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Node CI

on: [push, pull_request]
on:
pull_request:
push:
branches:
- 'master'

jobs:
build:
Expand All @@ -16,6 +20,8 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Install OS Packages
run: sudo apt update && sudo apt install libavahi-compat-libdnssd-dev \
- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
Expand Down
10 changes: 7 additions & 3 deletions examples/doAFlip.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
const {DroneConnection, CommandParser} = require('minidrone-js');
const {DroneConnection, CommandParser, BLEConnector} = require('minidrone-js');
const {WifiConnector} = require("../src");

// const connector = new BLEConnector();
const connector = new WifiConnector();
const parser = new CommandParser();
const drone = new DroneConnection();
const drone = new DroneConnection(connector);
const takeoff = parser.getCommand('minidrone', 'Piloting', 'TakeOff');
const landing = parser.getCommand('minidrone', 'Piloting', 'Landing');
const backFlip = parser.getCommand('minidrone', 'Animations', 'Flip', {direction: 'back'});

connector.connect('192.168.99.3', 44444);

drone.on('connected', () => {
console.log('Connected!')
Expand All @@ -16,6 +20,6 @@ drone.on('connected', () => {
// runCommand(takeoff);

// setTimeout(runCommand, 2000, backFlip);
// setTimeout(runCommand, 2000, landing);
setTimeout(runCommand, 2000, landing);
setTimeout(process.exit, 5000);
});
Loading
Loading