From 6e4bd30a47f58c549ec2d70df2c1d40532331874 Mon Sep 17 00:00:00 2001 From: Greg Ingram Date: Mon, 7 Jan 2019 18:38:50 -0500 Subject: [PATCH] Added device binding template readme (#136) * Added device binding template readme * Folder name was clipped * Heck wording --- src/devices/Device Binding Template.md | 18 ------- src/devices/README.md | 2 +- .../templates/DeviceBindingTemplate/README.md | 47 +++++++++++++++++++ 3 files changed, 48 insertions(+), 19 deletions(-) delete mode 100644 src/devices/Device Binding Template.md create mode 100644 tools/templates/DeviceBindingTemplate/README.md diff --git a/src/devices/Device Binding Template.md b/src/devices/Device Binding Template.md deleted file mode 100644 index e41b926b..00000000 --- a/src/devices/Device Binding Template.md +++ /dev/null @@ -1,18 +0,0 @@ -# [Component Name Here] - -## Summary -Provide a brief description on what the component is and its functonality. - -## Device Family -Provide a list of component names and link to datasheets (if available) the binding will work with. - -**[Family Name Here]**: [Datasheet link here] - -## Binding Notes - -Provide any specifics related to binding API. This could include how to configure component for particular functions and example code. - -**NOTE**: Don't repeat the basics related to System.Device.API* (e.g. connection settings, etc.). This helps keep text/steps down to a minimum for maintainability. - -## References -Provide any references to other tutorials, blogs and hardware related to the component that could help others get started. diff --git a/src/devices/README.md b/src/devices/README.md index 270c2989..bfd907c0 100644 --- a/src/devices/README.md +++ b/src/devices/README.md @@ -17,7 +17,7 @@ We may publish NuGet packages of device bindings at a later date. ## Contributing a binding -Anyone can contribute a binding. Please do! Bindings should follow the model that is used for the [Mcp23xxx](Mcp23xxx/README.md) or [Mcp3008](Mcp3008/README.md) implementations. There is a [Binding Markdown template](Device%20Binding%20Template.md) that can help you get started, as well. +Anyone can contribute a binding. Please do! Bindings should follow the model that is used for the [Mcp23xxx](Mcp23xxx/README.md) or [Mcp3008](Mcp3008/README.md) implementations. There is a [Device Binding Template](../../tools/templates/DeviceBindingTemplate/README.md) that can help you get started, as well. Bindings must: diff --git a/tools/templates/DeviceBindingTemplate/README.md b/tools/templates/DeviceBindingTemplate/README.md new file mode 100644 index 00000000..6f8db648 --- /dev/null +++ b/tools/templates/DeviceBindingTemplate/README.md @@ -0,0 +1,47 @@ +# Device Binding Template + +The Device Binding Template provides an easy way to create device binding projects. This template is based on the [.NET Templates](https://github.com/dotnet/templating). + +## How to Install +Currently, there is no NuGet package available so the template folder must be stored locally. Use the following command to install the template where `PATH` is the directory path the template was stored. + +```console +dotnet new -i C:\[PATH]\iot\tools\templates\DeviceBindingTemplate\dotnet_new_device-binding_csharp +``` + +## How to Uninstall +The template can be uninstalled by using the following command where `PATH` is the directory path the template was stored. + +```console +dotnet new -u C:\[PATH]\iot\tools\templates\DeviceBindingTemplate\dotnet_new_device-binding_csharp +``` + +## Example Device Binding +Use the following command to create a device binding project. + + * `PATH` is the recommended directory path where other device bindings are located in the repo structure. + * The output parameter (-o) is not required when working in the current directory expected to create the binding project. + +```console +dotnet new device-binding -n Foo -o C:\[PATH]\iot\src\devices\Foo +``` +The following device binding structure will be created after running the command. + +``` +iot/ + src/ + devices/ + Foo/ + Foo.csproj + Foo.cs + README.md + samples/ + Foo.Sample.csproj + Foo.Sample.cs + tests/ <-- Tests are optional + Foo_Not_Required.Tests.csproj + Foo.Tests.cs +``` + +## Tests Project +There is an optional test project created when the device binding project is created. The tests folder can be deleted if not used. \ No newline at end of file -- GitLab