0.9.52 • Published 11 months ago

@tfdidesign/fsuipc-typescript-client v0.9.52

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
11 months ago

fsuipc-typescript-client

fsuipc-typescript-client is a node dependency wirtten to allow easy access to the FSUIPC API.

This package offers:

  • Read offset
  • Write offset*
  • Ability to get raw fsuipc data
  • Error handling/disconnect handling
  • Easily controllable update interval

*Write support is only supported for Bit and Numbers offset types.

Disclamer

This package is a modifided version of fsuipc-node (fsuipc-node) and built off fsuipc (fsuipc)

Requirements

In order for fsuipc (fsuipc-node) and @tfdidesign/fsuipc-typescript-client to work, and and therefore, this API, you must have on your machine:

  • Windows 10 64bit or Windows 11 64bit
  • Node 12+
  • Python 3.7 (don't forget to add it to your PATH)
  • Visual Studio 2017+ with desktop C++ package
  • FSUIPC installed as flight simulator plugin

Node API usage requirements:

  • rxjs >= 6.5.0

Get Started

Download the dependency using the following options: npm :

npm i --save @tfdidesign/fsuipc-typescript-client

or yarn:

yarn add @tfdidesign/fsuipc-typescript-client

After import, you can use FsuipcClient to listen to provided values.

Import

new FsuipcClient() takes one argument:

import { FsuipcClient, Simulator } from '@tfdidesign/fsuipc-typescript-client';
const fsuipcClient = new  FsuipcClient({ interval :  1000, simulator :  Simulator.FSX, closeOnError :  false, includeRaw :  false });

options:

  • Interval type Number : time in ms passed after each stream update.
  • Simulator is type Simulator: targeted simulator.
  • closeOnError type boolean: if the client need to close connection with the simulator if error accours down the stream.
  • includeRaw type boolean: this will include raw data on each stream update.

Init

FsuipcClient.connect() returns a promise when you are properly connected to FSUIPC stream. In case your flight simulator isn't running, this will throw an error.

Listen to offsets values

FsuipcClient.listen() method take 1 argument :

  • offsetsList [string[]]: a list of string representing offsets you want to subscribe This method returns a ConvertedOffsetValues observable. You can subscribe to this observable to handle values polled from stream.

Complete example

import { FsuipcClient } from '@tfdidesign/fsuipc-typescript-client';

const fsuipcClient =  new  FsuipcClient({ interval :  1000, simulator : Simulator.FSX, closeOnError :  false, includeRaw :  false  });

fsuipcClient.connect().then(() => {
  fsuipcClient.listen([
    'gs',
    'altitude',
    'comFreq',
    'lights',
  ]).subscribe((result) => {
    // Use the result here
    console.log(JSON.stringify(result));
  });
}).catch((e) =>
  console.error(e)
);
0.9.52

11 months ago

0.9.50

1 year ago

0.9.51

1 year ago

0.9.49

1 year ago

0.9.48

1 year ago

0.9.47

1 year ago

0.9.45

2 years ago

0.9.41

2 years ago

0.9.42

2 years ago

0.9.43

2 years ago

0.9.44

2 years ago

0.9.40

2 years ago

0.9.36

2 years ago

0.9.37

2 years ago

0.9.38

2 years ago

0.9.39

2 years ago

0.9.28

2 years ago

0.9.27

2 years ago

0.9.12

2 years ago

0.9.13

2 years ago

0.9.15

2 years ago

0.9.9

2 years ago

0.9.10

2 years ago

0.9.11

2 years ago

0.9.17

2 years ago

0.9.18

2 years ago

0.9.23

2 years ago

0.9.24

2 years ago

0.9.25

2 years ago

0.9.26

2 years ago

0.9.20

2 years ago

0.9.21

2 years ago

0.9.22

2 years ago

0.9.8

2 years ago

0.9.7

2 years ago

0.9.4

2 years ago

0.9.3

2 years ago

0.9.6

2 years ago

0.9.5

2 years ago

0.9.0

2 years ago

0.8.0

2 years ago

0.9.2

2 years ago

0.9.1

2 years ago

0.5.0

2 years ago

0.7.0

2 years ago

0.6.0

2 years ago

0.3.0

3 years ago

0.3.5

3 years ago

0.4.0

2 years ago

0.3.1

3 years ago

0.2.7

3 years ago

0.2.6

3 years ago

0.2.5

3 years ago

0.2.4

3 years ago

0.1.2

4 years ago

0.2.3

4 years ago

0.1.3

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago