Coder Social home page Coder Social logo

device-sdk-tools's Introduction

README

This Java project can be used to generate device service scaffolding using newly developed Device Service SDK.

Setup

The project can be run directly from Spring Tools. It can also be exported as Runnable JAR and run from command line.

Run configuration expects two parameters:

  1. Output directory name where files are generated.

  2. Device Service description file. By default the file is expected to be in the project root directory. Examples are included in the tools project root directory.

To generate a new device service:

  1. Create a new service configuration file using the included file 'Demo' as a template.

a. Set the Service name field of the new service. Convention is device-

b. Set the service port. Be sure to check the current service ports being used and pick an unused one. Current conventions place device services in the 49000-49999 port range

c. Set the (CSV) service labels. For the service to be recognized as capable of running schedules, leave the scheduler label in place

d. Set the profile attributes that will be generated in the domain.Attribute.java file. These fields are passed to the driver layer and must also be included in each deviceResource attribute field of every device profile for a service. These are protocol specific metadata objects characteristics of a protocol (i.e. uuid for BLE, oid and community for SNMP, etc.). The first column is the Attribute name, the second is the java type.

  1. Run the Generate Device Service command with and as arguments

  2. Import your newly generated Device Service project into the IDE of your choice

  3. Run a maven install on the project to install the project dependencies

  4. Replace the numbered TODOs in the src/main/ directory:

a. TODO 1-7 are in the .Driver.java file

b. TODO 8 is in the domain.SimpleWatcher.java file

c. TODO 9 is in the resources/schedule.properties file

d. TODO 10 is in the resources/watcher.properties file

Note: TODOs marked [Optional] may be left as is for some services, see the note with the TODO

  1. Generate a device profile for use by the service. Use the included resources/JC.RR-NAE-9.ConfRoom.Padre.Island.profile.yaml as a template. Be sure to replace the deviceResources attributes with the profile attributes in your service configuration file

  2. Run and test the service locally until satisfied with functionality

  3. Dockerize the service (may require injecting different .properties files as part of the build chain, see the device-bluetooth Jenkins Configuration for an example of this)

  4. Deploy to EdgeX

device-sdk-tools's People

Contributors

jpwhitemn avatar trcox avatar tykeal avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.