0.9.51 • Published 1 month ago

@tfdidesign/fsuipc-typescript-client v0.9.51

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
1 month 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.50

1 month ago

0.9.51

1 month ago

0.9.49

1 month ago

0.9.48

2 months ago

0.9.47

2 months ago

0.9.45

9 months ago

0.9.41

9 months ago

0.9.42

9 months ago

0.9.43

9 months ago

0.9.44

9 months ago

0.9.40

9 months ago

0.9.36

10 months ago

0.9.37

10 months ago

0.9.38

9 months ago

0.9.39

9 months ago

0.9.28

10 months ago

0.9.27

11 months ago

0.9.12

1 year ago

0.9.13

1 year ago

0.9.15

1 year ago

0.9.9

1 year ago

0.9.10

1 year ago

0.9.11

1 year ago

0.9.17

1 year ago

0.9.18

1 year ago

0.9.23

12 months ago

0.9.24

12 months ago

0.9.25

12 months ago

0.9.26

12 months ago

0.9.20

12 months ago

0.9.21

12 months ago

0.9.22

12 months ago

0.9.8

1 year ago

0.9.7

1 year ago

0.9.4

1 year ago

0.9.3

1 year ago

0.9.6

1 year ago

0.9.5

1 year ago

0.9.0

1 year ago

0.8.0

1 year ago

0.9.2

1 year ago

0.9.1

1 year ago

0.5.0

1 year ago

0.7.0

1 year ago

0.6.0

1 year ago

0.3.0

1 year ago

0.3.5

1 year ago

0.4.0

1 year ago

0.3.1

1 year ago

0.2.7

2 years ago

0.2.6

2 years ago

0.2.5

2 years ago

0.2.4

2 years ago

0.1.2

3 years ago

0.2.3

3 years ago

0.1.3

3 years ago

0.2.2

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago