device

package module
v1.2.0-dev.32 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2020 License: Apache-2.0 Imports: 0 Imported by: 1

README

Go Device Service SDK

Overview

This repository is a set of Go packages which can be used to build a Go-based EdgeX Foundry Device Service.

Usage

Developers could make their own Device Service by implementing the ProtocolDriver interface for the specific IoT protocol and main function to start the Device Service. To implement the main function, the startup package could be optional leveraged, or developers could write the customized bootstrap code by themselves. Please see the build-in Simple Device Service as an example.

Float value encodeing

In EdgeX, float value has two kinds of encoding, Base64, and eNotation.

When EdgeX is given (or returns) a float32 or float64 value as a string, the format of the string is by default a base64 encoded little-endian of the float32 or float64 value, but the “floatEncoding” attribute relating to the value may instead specify “eNotation” in which case the representation is a decimal with exponent (eg “1.234e-5”)

https://docs.google.com/document/d/1aMIQ0kb46VE5eeCpDlaTg8PP29-DBSBTlgeWrv6LuYk/edit

base64

The SDK should convert the float value to little-endian binary and then encode the binary as base64 string. Currently, C SDK converts float value to little-endian binary. GO SDK encodes convert float value to big-endian binary because SDK spec changed in fuji release, we will modify GO SDK to make the behavior consistent in the future.

Usage:

-
  name: "Temperature"
  description: "Temperature value"
  properties:
    value:
      { type: "FLOAT64", readWrite: "RW", floatEncoding: "Base64"}
    units:
      { type: "String", readWrite: "R", defaultValue: "degrees Celsius"}
eNoation

The SDK should convert the float value to string with eNotaion representation.

Usage:

-
  name: "Temperature"
  description: "Temperature value"
  properties:
    value:
      { type: "FLOAT64", readWrite: "RW", floatEncoding: "eNotation"}
    units:
      { type: "String", readWrite: "R", defaultValue: "degrees Celsius"}

Community

License

Apache-2.0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version string = "to be replaced by makefile"

Global version for device-sdk-go

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
example
cmd/device-simple
This package provides a simple example of a device service.
This package provides a simple example of a device service.
driver
This package provides a simple example implementation of ProtocolDriver interface.
This package provides a simple example implementation of ProtocolDriver interface.
internal
urlclient
urlclient provides functions to integrate the client code in go-mod-core-contracts with application specific code
urlclient provides functions to integrate the client code in go-mod-core-contracts with application specific code
pkg
models
This package defines interfaces and structs used to build an EdgeX Foundry Device Service.
This package defines interfaces and structs used to build an EdgeX Foundry Device Service.
service
This package provides a basic EdgeX Foundry device service implementation meant to be embedded in an application, similar in approach to the builtin net/http package.
This package provides a basic EdgeX Foundry device service implementation meant to be embedded in an application, similar in approach to the builtin net/http package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL