5.2.2 • Published 1 year ago

@synapticon/motion-master-proto v5.2.2

Weekly downloads
37
License
ISC
Repository
-
Last release
1 year ago

motion-master-proto

Motion Master Proto contains statically generated code used to communicate with the Motion Master. This library is meant to be used by all applications that will interact with the Motion Master protobuf messages and it contains the code generated for TypeScript, Java, C++ and JavaScript. The protobuf.js is used to generate the TypeScript code and protoc is used for all other languages.

protobuf.js

Install

npm install motion-master-proto --save

Usage

Import:

import * as motionMasterProto from 'motion-master-proto';
export import motionmaster = motionMasterProto.motionmaster;

Create devices message example:

let devices = motionmaster.Devices.create();

See how this library is used in Motion Master Simulator.

Develop

Replace motion-master.proto file with the latest version and run $ npm run build.

When developing consider symlinking a package folder with npm-link.

Generate

$ pbjs --target static-module --wrap commonjs --out motion-master.proto.js motion-master.proto
$ pbts --out motion-master.proto.d.ts motion-master.proto.js

C++

Usage

Include:

#include <motion-master.pb.h>

using namespace motionmaster;

Example - Create a status meesage with a single device:

Status status;
Devices *devices = status.mutable_devices();
Devices::Device *device = devices->add_device();
device->set_device_id(i);
device->set_device_type(Devices::CIA402_DRIVE);
device->mutable_firmware()->set_version("0.0.1");

Generate

protoc --cpp_out=$PWD -I=$PWD $PWD/motion-master.proto

or simply execute the following script:

$ generation_scripts/compile_protocol_buffer_C++_API.sh

Java

Usage

Build the Java library as a local Maven package (from the "Java" directory):

$ mvn clean install -DskipTests

and include it inside the "pom.xml" file of the Java project:

<dependencies>
    <dependency>
        <groupId>com.synapticon.motionmaster-api</groupId>
        <artifactId>motionmaster-api</artifactId>
        <version>0.0.34</version>
    </dependency>
</dependencies>

Generate

protoc --java_out=$PWD -I=$PWD $PWD/motion-master.proto

or simply execute the following script:

$ generation_scripts/compile_protocol_buffer_Java_API.sh

JavaScript

The code generated for JavaScript is used only for the SOMANETdrive web application and can be considered as legacy code.

Generate

$ protoc --js_out=import_style=commonjs,binary:$PWD -I=$PWD $PWD/motion-master.proto

or simply execute the following script:

$ generation_scripts/compile_protocol_buffer_JavaScript_API.sh
5.2.2

1 year ago

5.2.1

2 years ago

5.2.0

2 years ago

5.1.2

3 years ago

5.1.1

3 years ago

6.0.0-es6.2

2 years ago

6.0.0-es6.1

2 years ago

6.0.0-es6.0

2 years ago

5.0.1

3 years ago

5.0.0

3 years ago

4.10.2

3 years ago

4.10.1

3 years ago

4.10.0

3 years ago

4.9.0

3 years ago

4.8.2

3 years ago

4.8.1

3 years ago

4.8.0

3 years ago

4.7.3

3 years ago

4.7.2

3 years ago

4.7.1

3 years ago

4.7.0

3 years ago

4.6.0

3 years ago

4.5.6

3 years ago

4.5.5

3 years ago

4.5.4

4 years ago

4.5.3

4 years ago

4.5.2

4 years ago

4.5.0

4 years ago

4.4.0

4 years ago

4.3.5

4 years ago

4.3.4

4 years ago

4.3.3

4 years ago

4.3.2

4 years ago

4.3.1

4 years ago

4.3.0

4 years ago

4.2.0

4 years ago

4.1.0

4 years ago

4.0.0

4 years ago

3.4.0

4 years ago

3.3.1

4 years ago

3.3.0

4 years ago

3.1.2

4 years ago

3.2.0

4 years ago

3.2.0-beta.0

4 years ago

3.1.1

4 years ago

3.1.0

4 years ago

3.0.0

4 years ago

3.0.0-beta.11

4 years ago

3.0.0-beta.10

4 years ago

3.0.0-beta.9

5 years ago

3.0.0-beta.8

5 years ago

3.0.0-beta.6

5 years ago

3.0.0-beta.5

5 years ago

3.0.0-beta.4

5 years ago

3.0.0-beta.3

5 years ago