Overview
The SDK is designed to create a new Asset Link, you need to implement the interfaces for the features that the particular Asset Link is intended to provide. Currently, one interface is supported:
Discovery Interface (enables device discovery and consists of three functions):
-
Discover
: This interface handles device discovery requests. It ensures only one discovery job runs at a time, retrieves option and filter settings from the provided configuration, performs device discovery logic, and publishes discovered devices using the provided data publisher. -
GetSupportedOptions
: This interface returns a list of supported discovery options, describing which configuration options can be used during device discovery.
Example:interface to scan
,timeout
-
GetSupportedFilters
: This interface returns a list of supported discovery filters, describing which filter criteria can be applied to limit or customize the discovery process. Example:IP
,MAC
,device type
Once the interfaces are implemented, the specific Asset Link uses the assetLinkBuilder
to construct an AssetLink
with the implemented features. On AssetLink.Start()
, the Asset Link will start the grpc server, allowing device management to interact with it.
Pre-requisites
Tooling:
- Go Version >=1.23.12 is required
- cookiecutter
- GoReleaser
Gateway:
Have a gateway stack running to connect the Asset Link to. The gateway needs to implement a server for the grpcRegistry and implement the necessary clients for the specific Asset Link capabilities. For discovery, these clients need to be implemented:
You can download and use the Asset Gateway from the Siemens Industrial Asset Hub (IAH) for that purpose.
To ease local development, a container image of a registry server is provided as part of the Asset Gateway. Additionally, a command line tool called al-ctl is provided to locally run and test the Asset Links.
To run these components, use the following commands:
# to start the registry
$ docker-compose -f registry/docker-compose.yml up
# to start the al-ctl
$ go run ./cmd/al-ctl/al-ctl.go
# or
$ go run ./cmd/al-ctl/al-ctl.go --help