diff --git a/.github_changelog_generator b/.github_changelog_generator new file mode 100644 index 0000000..ef4d9c7 --- /dev/null +++ b/.github_changelog_generator @@ -0,0 +1,14 @@ +user=nanoframework +project=lib-nanoFramework.TI.EasyLink +issues=true +add_issues_wo_labels=false +add_pr_wo_labels=false +add_issues_wo_labels=false +filter_issues_by_milestone=false +exclude_labels=Area: Config-and-Build,Area: Infrastructure-and-Organization,reverted +enhancement_labels=Type: enhancement +bug_labels=Type: bug +merge_prefix=**Documentation and other chores:** +unreleased_label=**Changes available only in 'Preview' NuGet packages:** +issue_line_labels=Breaking-Change,documentation +author=false diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ce3e1b1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,255 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config +# NuGet v3's project.json files produces more ignoreable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +#SoundCloud +*.sonarqube/ diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..0b3a0e4 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,167 @@ +# Change Log + +## [v1.0.13-preview.1](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/tree/v1.0.13-preview.1) (2019-08-27) +[Full Changelog](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/compare/v1.0.12-preview.1...v1.0.13-preview.1) + +## [v1.0.12-preview.1](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/tree/v1.0.12-preview.1) (2019-08-26) +[Full Changelog](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/compare/v1.0.11-preview.1...v1.0.12-preview.1) + +## [v1.0.11-preview.1](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/tree/v1.0.11-preview.1) (2019-08-26) +[Full Changelog](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/compare/v1.0.10-preview.1...v1.0.11-preview.1) + +## [v1.0.10-preview.1](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/tree/v1.0.10-preview.1) (2019-08-23) +[Full Changelog](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/compare/v1.0.9-preview.2...v1.0.10-preview.1) + +## [v1.0.9-preview.2](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/tree/v1.0.9-preview.2) (2019-08-23) +[Full Changelog](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/compare/v1.0.9-preview.1...v1.0.9-preview.2) + +## [v1.0.9-preview.1](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/tree/v1.0.9-preview.1) (2019-08-23) +[Full Changelog](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/compare/v1.0.7-preview.1...v1.0.9-preview.1) + +## [v1.0.7-preview.1](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/tree/v1.0.7-preview.1) (2019-07-18) +[Full Changelog](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/compare/v1.0.6-preview.26...v1.0.7-preview.1) + +## [v1.0.6-preview.26](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/tree/v1.0.6-preview.26) (2019-07-18) +[Full Changelog](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/compare/v1.0.6-preview.23...v1.0.6-preview.26) + +**Documentation and other chores:** + +- Bumps nanoFramework.CoreLibrary from 1.2.6-preview.7 to 1.2.6-preview.16 [\#46](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/pull/46) +- Update readme.txt [\#45](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/pull/45) + +## [v1.0.6-preview.23](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/tree/v1.0.6-preview.23) (2019-06-23) +[Full Changelog](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/compare/v1.0.6-preview.9...v1.0.6-preview.23) + +**Documentation and other chores:** + +- Bumps nanoFramework.CoreLibrary from 1.2.6-preview.1 to 1.2.6-preview.7 [\#44](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/pull/44) +- Work on native assembly declaration [\#42](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/pull/42) [[Breaking-Change](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/labels/Breaking-Change)] + +## [v1.0.6-preview.9](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/tree/v1.0.6-preview.9) (2019-06-20) +[Full Changelog](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/compare/v1.0.6-preview.6...v1.0.6-preview.9) + +**Documentation and other chores:** + +- Bumps nanoFramework.CoreLibrary from 1.2.5-preview.1 to 1.2.6-preview.1 [\#40](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/pull/40) + +## [v1.0.6-preview.6](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/tree/v1.0.6-preview.6) (2019-06-12) +[Full Changelog](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/compare/v1.0.6-preview.2...v1.0.6-preview.6) + +**Documentation and other chores:** + +- Bumps nanoFramework.CoreLibrary from 1.2.4-preview.1 to 1.2.5-preview.1 [\#39](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/pull/39) + +## [v1.0.6-preview.2](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/tree/v1.0.6-preview.2) (2019-06-12) +[Full Changelog](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/compare/v1.0.5-preview-001...v1.0.6-preview.2) + +**Documentation and other chores:** + +- Bumps nanoFramework.CoreLibrary from 1.2.2-preview.20 to 1.2.4-preview.1 [\#38](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/pull/38) +- Bumps nanoFramework.CoreLibrary from 1.2.1-preview-001 to 1.2.2-preview.20 [\#37](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/pull/37) +- Release v1.0.4 [\#31](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/pull/31) + +## [v1.0.5-preview-001](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/tree/v1.0.5-preview-001) (2019-04-23) +[Full Changelog](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/compare/v1.0.3-preview-012...v1.0.5-preview-001) + +## [v1.0.3-preview-012](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/tree/v1.0.3-preview-012) (2019-04-23) +[Full Changelog](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/compare/v1.0.4...v1.0.3-preview-012) + +**Documentation and other chores:** + +- Bumps nanoFramework.CoreLibrary from 1.2.0 to 1.2.1-preview-001 [\#33](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/pull/33) +- Bumps nanoFramework.CoreLibrary from 1.1.1 to 1.2.0 [\#32](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/pull/32) + +## [v1.0.4](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/tree/v1.0.4) (2019-01-21) +[Full Changelog](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/compare/v1.0.2...v1.0.4) + +**Documentation and other chores:** + +- Bumps nanoFramework.CoreLibrary from 1.1.0 to 1.1.1 [\#30](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/pull/30) +- Merge back from Release v1.0.2 [\#29](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/pull/29) + +## [v1.0.2](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/tree/v1.0.2) (2018-12-15) +[Full Changelog](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/compare/v1.0.2-preview-049...v1.0.2) + +**Documentation and other chores:** + +- Release v1.0.2 [\#28](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/pull/28) +- Bumps nanoFramework.CoreLibrary from 1.0.6-preview-021 to 1.1.0 [\#27](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/pull/27) +- Bumps nanoFramework.CoreLibrary from 1.0.6-preview-010 to 1.0.6-preview-021 [\#26](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/pull/26) + +## [v1.0.2-preview-049](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/tree/v1.0.2-preview-049) (2018-11-27) +[Full Changelog](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/compare/v1.0.2-preview-048...v1.0.2-preview-049) + +## [v1.0.2-preview-048](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/tree/v1.0.2-preview-048) (2018-11-27) +[Full Changelog](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/compare/v1.0.2-preview-042...v1.0.2-preview-048) + +## [v1.0.2-preview-042](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/tree/v1.0.2-preview-042) (2018-11-26) +[Full Changelog](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/compare/v1.0.2-preview-040...v1.0.2-preview-042) + +## [v1.0.2-preview-040](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/tree/v1.0.2-preview-040) (2018-11-26) +[Full Changelog](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/compare/v1.0.2-preview-038...v1.0.2-preview-040) + +## [v1.0.2-preview-038](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/tree/v1.0.2-preview-038) (2018-11-23) +[Full Changelog](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/compare/v1.0.2-preview-034...v1.0.2-preview-038) + +## [v1.0.2-preview-034](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/tree/v1.0.2-preview-034) (2018-11-23) +[Full Changelog](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/compare/v1.0.2-preview-027...v1.0.2-preview-034) + +## [v1.0.2-preview-027](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/tree/v1.0.2-preview-027) (2018-11-21) +[Full Changelog](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/compare/v1.0.2-preview-026...v1.0.2-preview-027) + +## [v1.0.2-preview-026](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/tree/v1.0.2-preview-026) (2018-11-21) +[Full Changelog](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/compare/v1.0.2-preview-021...v1.0.2-preview-026) + +## [v1.0.2-preview-021](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/tree/v1.0.2-preview-021) (2018-11-21) +[Full Changelog](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/compare/v1.0.2-preview-012...v1.0.2-preview-021) + +## [v1.0.2-preview-012](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/tree/v1.0.2-preview-012) (2018-11-19) +[Full Changelog](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/compare/v1.0.2-preview-005...v1.0.2-preview-012) + +**Documentation and other chores:** + +- Bumps nanoFramework.CoreLibrary from 1.0.6-preview-001 to 1.0.6-preview-010 [\#20](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/pull/20) + +## [v1.0.2-preview-005](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/tree/v1.0.2-preview-005) (2018-11-08) +[Full Changelog](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/compare/v1.0.2-preview-002...v1.0.2-preview-005) + +**Documentation and other chores:** + +- Bumps nanoFramework.CoreLibrary from 1.0.5-preview024 to 1.0.6-preview-001 [\#19](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/pull/19) + +## [v1.0.2-preview-002](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/tree/v1.0.2-preview-002) (2018-11-06) +[Full Changelog](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/compare/v1.0.2-preview-032...v1.0.2-preview-002) + +**Documentation and other chores:** + +- Bumps nanoFramework.CoreLibrary from 1.0.4 to 1.0.5-preview024 [\#16](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/pull/16) +- merge back changes from Release 1.0.0 branch [\#14](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/pull/14) + +## [v1.0.2-preview-032](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/tree/v1.0.2-preview-032) (2018-10-17) +[Full Changelog](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/compare/v1.0.2-preview-033...v1.0.2-preview-032) + +## [v1.0.2-preview-033](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/tree/v1.0.2-preview-033) (2018-10-17) +[Full Changelog](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/compare/v1.0.2-preview-036...v1.0.2-preview-033) + +## [v1.0.2-preview-036](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/tree/v1.0.2-preview-036) (2018-10-17) +[Full Changelog](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/compare/v1.0.0...v1.0.2-preview-036) + +## [v1.0.0](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/tree/v1.0.0) (2018-10-17) +**Implemented enhancements:** + +- Add strong name signing [\#3](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/pull/3) + +**Documentation and other chores:** + +- Merge 'develop' for Release 1.0.0 [\#13](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/pull/13) +- Bumps nanoFramework.CoreLibrary from 1.0.1-preview134 to 1.0.4 [\#12](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/pull/12) +- Bumps nanoFramework.CoreLibrary from 1.0.1-preview127 to 1.0.1-preview134 [\#10](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/pull/10) +- Bumps nanoFramework.CoreLibrary from 1.0.1-preview123 to 1.0.1-preview127 [\#9](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/pull/9) +- Bumps nanoFramework.CoreLibrary from 1.0.1-preview118 to 1.0.1-preview123 [\#8](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/pull/8) +- 📦 Bumps nanoFramework.CoreLibrary from 1.0.1-preview106 to 1.0.1-preview118 [\#7](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/pull/7) +- Bump nanoFramework.CoreLibrary from 1.0.0-preview062 to 1.0.0-preview073 in /source [\#2](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/pull/2) +- 📦 Update mscorlib Nuget to 1.0.0-preview062 [\#1](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/pull/1) + + + +\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)* \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8dada3e --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md index efa7dd6..1b38d9a 100644 --- a/README.md +++ b/README.md @@ -1 +1,33 @@ -# lib-nanoFramework.TI.EasyLink \ No newline at end of file +[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=nanoframework_lib-nanoFramework.TI.EasyLink&metric=alert_status)](https://sonarcloud.io/dashboard?id=nanoframework_lib-nanoFramework.TI.EasyLink) [![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=nanoframework_lib-nanoFramework.TI.EasyLink&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=nanoframework_lib-nanoFramework.TI.EasyLink) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/nanoframework/Home/blob/master/LICENSE) [![NuGet](https://img.shields.io/nuget/dt/nanoFramework.TI.EasyLink.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.TI.EasyLink/) [![#yourfirstpr](https://img.shields.io/badge/first--timers--only-friendly-blue.svg)](https://github.com/nanoframework/Home/blob/master/CONTRIBUTING.md) [![Discord](https://img.shields.io/discord/478725473862549535.svg?logo=discord&logoColor=white&label=Discord&color=7289DA)](https://discord.gg/gCyBu8T) + +![nanoFramework logo](https://github.com/nanoframework/Home/blob/master/resources/logo/nanoFramework-repo-logo.png) + +----- + +### Welcome to the **nanoFramework** Texas Instruments EasyLink Library repository! + +## Build status + +| Component | Build Status | NuGet Package | +|:-|---|---| +| nanoFramework.TI.EasyLink | [![Build Status](https://dev.azure.com/nanoframework/nanoFramework.TI.EasyLink/_apis/build/status/nanoframework.lib-nanoFramework.TI.EasyLink?branchName=master)](https://dev.azure.com/nanoframework/nanoFramework.TI.EasyLink/_build/latest?definitionId=51&branchName=master) | [![NuGet](https://img.shields.io/nuget/v/nanoFramework.TI.EasyLink.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.TI.EasyLink/) | +| nanoFramework.TI.EasyLink (preview) | [![Build Status](https://dev.azure.com/nanoframework/nanoFramework.TI.EasyLink/_apis/build/status/nanoframework.lib-nanoFramework.TI.EasyLink?branchName=develop)](https://dev.azure.com/nanoframework/nanoFramework.TI.EasyLink/_build/latest?definitionId=51&branchName=develop) | [![](https://badgen.net/badge/NuGet/preview/D7B023?icon=https://simpleicons.now.sh/azuredevops/fff)](https://dev.azure.com/nanoframework/feed/_packaging?_a=package&feed=sandbox&package=nanoFramework.TI.EasyLink&protocolType=NuGet&view=overview) | + +## Feedback and documentation + +For documentation, providing feedback, issues and finding out how to contribute please refer to the [Home repo](https://github.com/nanoframework/Home). + +Join our Discord community [here](https://discord.gg/gCyBu8T). + +## Credits + +The list of contributors to this project can be found at [CONTRIBUTORS](https://github.com/nanoframework/Home/blob/master/CONTRIBUTORS.md). + +## License + +The **nanoFramework** Class Libraries are licensed under the [Apache 2.0 license](http://www.apache.org/licenses/LICENSE-2.0). + +## Code of Conduct + +This project has adopted the code of conduct defined by the [Contributor Covenant](http://contributor-covenant.org/) +to clarify expected behavior in our community. diff --git a/azure-pipelines.yml b/azure-pipelines.yml index aa91291..a7e61da 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,19 +1,48 @@ -# Starter pipeline -# Start with a minimal pipeline that you can customize to build and deploy your code. -# Add steps that build, run tests, deploy, and more: -# https://aka.ms/yaml - trigger: -- master + branches: + include: ["master", "develop", "release-*", "refs/tags/*" ] + paths: + exclude: [ "doc", "*.md", ".gitignore" ] + # waiting for feature to become available + # tags: + # include: + # - v/* + +pr: + branches: + include: ["master", "develop", "release*"] + autoCancel: true + +# add nf-tools repo to resources (for Azure Pipelines templates) +resources: + repositories: + - repository: templates + type: github + name: nanoframework/nf-tools + endpoint: nanoframework pool: - vmImage: 'ubuntu-latest' + vmImage: 'VS2017-Win2016' + +variables: + solution: '**/source/*.sln' + buildPlatform: 'Any CPU' + buildConfiguration: 'Release' + nugetPackageName: 'nanoFramework.TI.EasyLink' + repoName: 'lib-nanoFramework.TI.EasyLink' steps: -- script: echo Hello, world! - displayName: 'Run a one-line script' -- script: | - echo Add other tasks to build, test, and deploy your project. - echo See https://aka.ms/yaml - displayName: 'Run a multi-line script' +# step from template @ nf-tools repo +# all build, update and publish steps +- template: azure-pipelines-templates/class-lib-build.yml@templates + parameters: + sonarCloudProject: 'nanoframework_lib-nanoFramework.TI.EasyLink' + +# step from template @ nf-tools repo +# report error +- template: azure-pipelines-templates/discord-webhook-task.yml@templates + parameters: + status: 'failure' + webhookUrl: '$(DiscordWebhook)' + message: '' diff --git a/source/NuGet.Config b/source/NuGet.Config new file mode 100644 index 0000000..ef0bacf --- /dev/null +++ b/source/NuGet.Config @@ -0,0 +1,7 @@ + + + + + + + diff --git a/source/nanoFramework.TI.EasyLink.DELIVERABLES.nuspec b/source/nanoFramework.TI.EasyLink.DELIVERABLES.nuspec new file mode 100644 index 0000000..71e2d99 --- /dev/null +++ b/source/nanoFramework.TI.EasyLink.DELIVERABLES.nuspec @@ -0,0 +1,32 @@ + + + + nanoFramework.TI.EasyLink.DELIVERABLES + $version$ + nanoFramework.TI.EasyLink.DELIVERABLES + nanoFramework project contributors + nanoFramework project contributors + false + + + false + https://github.com/nanoframework/lib-nanoFramework.TI.EasyLink + https://secure.gravatar.com/avatar/97d0e092247f0716db6d4b47b7d1d1ad + Copyright (c) 2019 The nanoFramework project contributors + ** DON'T REFERENCE THIS PACKAGE ** Not meant for development. This package includes the deliverable artifacts of the nanoFramework.TI.EasyLink assembly for nanoFramework. These are for testing purposes and for updating the native code base of the library. + nanoFramework.TI.EasyLink.DELIVERABLES is not meant for development. + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/source/nanoFramework.TI.EasyLink.nuspec b/source/nanoFramework.TI.EasyLink.nuspec new file mode 100644 index 0000000..f811d35 --- /dev/null +++ b/source/nanoFramework.TI.EasyLink.nuspec @@ -0,0 +1,35 @@ + + + + nanoFramework.TI.EasyLink + $version$ + nanoFramework.TI.EasyLink + nanoFramework project contributors + nanoFramework project contributors + false + Apache-2.0 + + + false + https://github.com/nanoframework/lib-nanoFramework.TI.EasyLink + https://secure.gravatar.com/avatar/97d0e092247f0716db6d4b47b7d1d1ad + + Copyright (c) 2019 The nanoFramework project contributors + This package includes the nanoFramework.TI.EasyLink assembly for nanoFramework C# projects. +This package requires a target with nanoFramework.TI.EasyLink v$nativeVersion$. + nanoFramework.TI.EasyLink assembly for nanoFramework C# projects + nanoFramework C# csharp netmf netnf TI EasyLink + + + + + + + + + + + + + + \ No newline at end of file diff --git a/source/nanoFramework.TI.EasyLink.sln b/source/nanoFramework.TI.EasyLink.sln new file mode 100644 index 0000000..ea0a864 --- /dev/null +++ b/source/nanoFramework.TI.EasyLink.sln @@ -0,0 +1,27 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27703.2042 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{11A8DD76-328B-46DF-9F39-F559912D0360}") = "nanoFramework.TI.EasyLink", "nanoFramework.TI.EasyLink\nanoFramework.TI.EasyLink.nfproj", "{0ECD244B-3715-49AB-98F1-BEB907007B13}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {0ECD244B-3715-49AB-98F1-BEB907007B13}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0ECD244B-3715-49AB-98F1-BEB907007B13}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0ECD244B-3715-49AB-98F1-BEB907007B13}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {0ECD244B-3715-49AB-98F1-BEB907007B13}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0ECD244B-3715-49AB-98F1-BEB907007B13}.Release|Any CPU.Build.0 = Release|Any CPU + {0ECD244B-3715-49AB-98F1-BEB907007B13}.Release|Any CPU.Deploy.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {ff47eca2-3395-4639-8e3f-4efb7a31e00c} + EndGlobalSection +EndGlobal diff --git a/source/nanoFramework.TI.EasyLink/ControlOption.cs b/source/nanoFramework.TI.EasyLink/ControlOption.cs new file mode 100644 index 0000000..6a613d7 --- /dev/null +++ b/source/nanoFramework.TI.EasyLink/ControlOption.cs @@ -0,0 +1,60 @@ +// +// Copyright (c) 2019 The nanoFramework project contributors +// Portions Copyright (c) 2015-2019 Texas Instruments Incorporated +// See LICENSE file in the project root for full license information. +// + +namespace nanoFramework.TI.EasyLink +{ + /// + /// EasyLink Status and error codes. + /// + public enum ControlOption : byte + { + /////////////////////////////////////////////////////////////////////////////////////////////// + // !!! KEEP IN SYNC WITH with EasyLink_CtrlOption in SDK @ source\ti\easylink\EasyLink.h !!! // + /////////////////////////////////////////////////////////////////////////////////////////////// + + /// + /// Set the number of bytes in Address for both address filter and Tx/Rx operations. + /// + AddressSize, + + /// + /// Set a timeout value for inactivity on the radio. + /// + /// + ///If the radio stays idle for this amount of time it is automatically powered down. + /// + IdleTimeout, + + /// + /// Set Multi-client mode for applications that will use multiple RF clients. + /// + /// + /// Must be set before calling . + /// + MultiClientMode, + + /// + /// Relative time in ticks from asynchronous Rx start to TimeOut. + /// A value of 0 means no timeout. + /// + AsyncRxTimeout, + + /// + /// Enable/Disable Test mode for Tone. + /// + TestTone, + + /// + /// Enable/Disable Test mode for Signal. + /// + TestSignal, + + /// + /// Enable/Disable Rx Test mode for Tone. + /// + RxTestTone, + } +} diff --git a/source/nanoFramework.TI.EasyLink/EasyLinkController.cs b/source/nanoFramework.TI.EasyLink/EasyLinkController.cs new file mode 100644 index 0000000..20be95f --- /dev/null +++ b/source/nanoFramework.TI.EasyLink/EasyLinkController.cs @@ -0,0 +1,316 @@ +// +// Copyright (c) 2019 The nanoFramework project contributors +// Portions Copyright (c) 2015-2019 Texas Instruments Incorporated +// See LICENSE file in the project root for full license information. +// + +using System; +using System.Collections; +using System.Runtime.CompilerServices; +using System.Threading; + +namespace nanoFramework.TI.EasyLink +{ + /// + /// The CC13xx/CC26xx EasyLink API is a simple abstraction layer on top of the CC13xx/CC26xx RF Driver and is intended as a starting point for developers creating a proprietor Sub1G protocol. + /// + /// + /// The EasyLink layer does not support any regional RF conformance such as 'Listen Before Talk' required for the license free frequency band. + /// Customers need to add support for the regional conformance that their product requires under the EasyLink API. + /// + public sealed class EasyLinkController : IDisposable + { + // this is used as the lock object + // a lock is required because multiple threads can access the SerialDevice + [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)] + private readonly object _syncLock; + + [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)] + private bool _disposed = false; + + [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)] + private readonly PhyType _phyType; + +#pragma warning disable S2933 // this field is updated in a method and can't be readonly + [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)] + private ArrayList _addressFilter; +#pragma warning restore S2933 // Fields that are only assigned in the constructor should be "readonly" + + /// + /// + /// + public PhyType PhyType => _phyType; + + /// + /// Absolute radio time. + /// This can be used for monitoring or Tx and Rx events using the AbsoluteTime field from or . + /// + /// Absolute radio time. + public extern uint AbsoluteTime + { + [MethodImpl(MethodImplOptions.InternalCall)] + get; + } + + /// + /// RSSI value of an ongoing radio operation. + /// It is useful in receiver test modes to detect the presence of both modulated and unmodulated carrier waves. + /// + /// Signed RSSI value (dBm)e. + /// + /// If no RSSI is available the return value is -128. + /// + public extern sbyte Rssi + { + [MethodImpl(MethodImplOptions.InternalCall)] + get; + } + + /// + /// Sets/gets the radio frequency in units of kHz. + /// When setting the radio frequency the value will be rounded to the nearest frequency supported by the Frequency Synthesizer. + /// The returned frequency is value set in the Frequency Synthesizer and may not be exactly the same that was set. + /// + /// + /// This value does not include any offsets for deviations due to factors such as temperature and hence this API + /// should not be used to get an accurate measure of frequency. + /// + public extern uint Frequency + { + [MethodImpl(MethodImplOptions.InternalCall)] + get; + + [MethodImpl(MethodImplOptions.InternalCall)] + set; + } + + /// + /// Sets/gets the Tx Power in dBm. + /// Accepted values range from -10 to 14 dBm, depending on the platform. + /// + /// + /// All platforms other than the CC1352P: Value of -10 dBm or values in the range of 0-14 dBm are accepted. + /// Values above 14 are set to 14 dBm while those below 0 are set to -10 dBm. + /// CC1352P Default PA: -20 to 14 dBm. Values above 14 dBm will be set to 14 dBm, while values below -20 dBm will cause a configuration error. + /// CC1352P High PA: 14 to 20 dBm. Values above 20 dBm will be set to 20 dBm, while values below 14 dBm will cause a configuration error. + /// This value does not include any offsets for deviations due to factors such as temperature and hence this API + /// should not be used to get an accurate measure of frequency. + /// + public extern sbyte RfPower + { + [MethodImpl(MethodImplOptions.InternalCall)] + get; + + [MethodImpl(MethodImplOptions.InternalCall)] + set; + } + + /// + /// Gets the IEEE address. + /// + public extern byte[] IeeeAddress + { + [MethodImpl(MethodImplOptions.InternalCall)] + get; + } + + /// + /// Initializes the radio with specified Phy settings. + /// + /// + /// + /// + /// + public EasyLinkController(PhyType phyTYpe = PhyType._50kbps2gfsk) + { + _phyType = phyTYpe; + + _addressFilter = new ArrayList(); + + _syncLock = new object(); + } + + /// + /// Initializes the EsayLink module. + /// + /// The operation result. + public Status Initialize() + { + lock (_syncLock) + { + return (Status)InitNative(); + } + } + + /// + /// Sends a Packet with blocking call. This method blocks execution of the current thread until the packet transmission in complete. + /// + /// The to be transmitted. + /// The operation result. + public Status Transmit(TransmitPacket packet) + { + lock (_syncLock) + { + return (Status)TransmitNative(packet, Timeout.Infinite, 0); + } + } + + /// + /// Sends a Packet. This method blocks execution of the current thread until the packet transmission in complete. + /// + /// The to be transmitted. + /// The timeout value (in milliseconds) for the transmission operation to complete successfully. + /// The amount of time to delay before starting the transmission, in milliseconds. + /// Specify zero (0) to start the timer immediately. + /// + /// The operation result. + public Status Transmit(TransmitPacket packet, int timeout, int dueTime = 0) + { + lock (_syncLock) + { + return (Status)TransmitNative(packet, timeout, dueTime); + } + } + + /// + /// Waits for packet to be received. + /// This method blocks execution of the current thread until a packet is received. + /// + /// The received packet. + /// The operation result. + public Status Receive(out ReceivedPacket packet) + { + lock (_syncLock) + { + return (Status)ReceiveNative(out packet, Timeout.Infinite); + } + } + + /// + /// Waits for packet to be received. + /// This method blocks execution of the current thread until a packet is received. + /// If no packet is receive before the expires an is thrown. + /// + /// The received packet. + /// The timeout value for the reception operation to complete successfully. + /// The operation result. + public Status Receive(out ReceivedPacket packet, int timeout) + { + lock (_syncLock) + { + return (Status)ReceiveNative(out packet, timeout); + } + } + + /// + /// Sets advanced configuration options. + /// + /// The control option to be set. + /// The value to set the control option to. + /// The operation result. + public Status SetConfiguration(ControlOption option, uint value) + { + lock (_syncLock) + { + return (Status)SetConfigurationNative(option, value); + } + } + + /// + /// Gets the current value of an advanced configuration option. + /// + /// The control option to get. + /// The control option value. + [MethodImpl(MethodImplOptions.InternalCall)] +#pragma warning disable S4200 // It's OK to have native methods unwrapped in nanoFramework + public extern uint GetConfiguration(ControlOption option); +#pragma warning restore S4200 // Native methods should be wrapped + + /// + /// Add an address to the receive address filter. + /// Any packet received for an address that is not in the filter will be discarded. + /// Addresses are entered as array. + /// + /// + /// If the address is already on the list it won't be added. + /// + public void AddAddressToFilter(byte[] address) + { + lock(_addressFilter) + if(!_addressFilter.Contains(address)) + { + _addressFilter.Add(address); + + UpdateRxAddressFilterNative(); + } + } + + /// + /// Removes an address from the receive address filter. + /// + /// + /// If the address is not on the filter list no error will be returned. + /// + public void RemoveAddressFromFilter(byte[] address) + { + if (_addressFilter.Contains(address)) + { + _addressFilter.Remove(address); + + UpdateRxAddressFilterNative(); + } + } + + #region IDisposable Support + + void Dispose(bool disposing) + { + if (!_disposed) + { + DisposeNative(); + + _disposed = true; + } + } + +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + ~EasyLinkController() +#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member + { + Dispose(false); + } + + +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + public void Dispose() +#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member + { + Dispose(true); + GC.SuppressFinalize(this); + } + + #endregion + + #region Native calls + + [MethodImpl(MethodImplOptions.InternalCall)] + private extern void DisposeNative(); + + [MethodImpl(MethodImplOptions.InternalCall)] + private extern void UpdateRxAddressFilterNative(); + + [MethodImpl(MethodImplOptions.InternalCall)] + private extern int InitNative(); + + [MethodImpl(MethodImplOptions.InternalCall)] + private extern int ReceiveNative(out ReceivedPacket packet, int timeout); + + [MethodImpl(MethodImplOptions.InternalCall)] + private extern int SetConfigurationNative(ControlOption option, uint value); + + [MethodImpl(MethodImplOptions.InternalCall)] + private extern int TransmitNative(TransmitPacket packet, int timeout, int dueTime); + + #endregion + } +} diff --git a/source/nanoFramework.TI.EasyLink/PhyType.cs b/source/nanoFramework.TI.EasyLink/PhyType.cs new file mode 100644 index 0000000..83f7fe5 --- /dev/null +++ b/source/nanoFramework.TI.EasyLink/PhyType.cs @@ -0,0 +1,63 @@ +// +// Copyright (c) 2019 The nanoFramework project contributors +// Portions Copyright (c) 2015-2019 Texas Instruments Incorporated +// See LICENSE file in the project root for full license information. +// + +namespace nanoFramework.TI.EasyLink +{ + /// + /// Phy settings to initialize the radio. + /// + /// + /// The support for a particular Phy configuration is target dependent. + /// If the request type is not available an will be thrown. + /// + public enum PhyType : byte + { + /////////////////////////////////////////////////////////////////////////////////////////// + // !!! KEEP IN SYNC WITH with EasyLink_PhyType in SDK @ source\ti\easylink\EasyLink. !!! // + /////////////////////////////////////////////////////////////////////////////////////////// + + /// + /// Customer Phy specific settings. + /// + Custom = 0, + + /// + /// Sub1G 50kbps data rate, IEEE 802.15.4g GFSK + /// + _50kbps2gfsk = 1, + + /// + /// Sub1G 625bps data rate, Long Range Mode + /// + _625bpsLrm = 2, + + /// + /// 2.4Ghz 200kbps data rate, IEEE 802.15.4g GFSK. + /// + _2_4_200kbps2gfsk = 3, + + /// + /// SimpleLink Long Range (5 kbps). + /// + _5kbpsSlLr = 4, + + /// + /// 2.4Ghz 100kbps data rate, IEEE 802.15.4g GFSK. + /// + _2_4_100kbps2gfs = 5, + + /// + /// 2.4Ghz 250kbps data rate, IEEE 802.15.4g GFSK. + /// + _2_4_250kbps2gfsk = 6, + + /// + /// 200kbps data rate, IEEE 802.15.4g GFSK. + /// + _200kbps2gfsk = 7, + + } +} diff --git a/source/nanoFramework.TI.EasyLink/Properties/AssemblyInfo.cs b/source/nanoFramework.TI.EasyLink/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..26936f3 --- /dev/null +++ b/source/nanoFramework.TI.EasyLink/Properties/AssemblyInfo.cs @@ -0,0 +1,20 @@ +using System.Reflection; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("nanoFramework.TI.EasyLink")] +[assembly: AssemblyCompany("nanoFramework Contributors")] +[assembly: AssemblyProduct("nanoFramework.TI.EasyLink")] +[assembly: AssemblyCopyright("Copyright © nanoFramework Contributors 2019")] + +//////////////////////////////////////////////////////////////// +// update this whenever the native assembly signature changes // +[assembly: AssemblyNativeVersion("100.0.0.0")] +//////////////////////////////////////////////////////////////// + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] diff --git a/source/nanoFramework.TI.EasyLink/ReceivedPacket.cs b/source/nanoFramework.TI.EasyLink/ReceivedPacket.cs new file mode 100644 index 0000000..2709817 --- /dev/null +++ b/source/nanoFramework.TI.EasyLink/ReceivedPacket.cs @@ -0,0 +1,62 @@ +// +// Copyright (c) 2019 The nanoFramework project contributors +// Portions Copyright (c) 2015-2019 Texas Instruments Incorporated +// See LICENSE file in the project root for full license information. +// + +namespace nanoFramework.TI.EasyLink +{ + //////////////////////////////////////////////////////////////////////////////////////// + // !!! KEEP IN SYNC WITH EasyLink_RxPacket in SDK @ source\ti\easylink\EasyLink.h !!! // + //////////////////////////////////////////////////////////////////////////////////////// + + /// + /// Class with definitions and data of a received packet. + /// + public class ReceivedPacket + { +#pragma warning disable S3459 // These fields are assigned in native code +#pragma warning disable IDE0044 // Add readonly modifier + [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)] + private byte[] _address; + + [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)] + private byte[] _payload; + + [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)] + private sbyte _rssi; + + [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)] private uint _absoluteTime; + private uint _rxTimeout; + +#pragma warning restore IDE0044 // Add readonly modifier +#pragma warning restore S3459 // Unassigned members should be removed + + /// + /// Destination address. + /// + public byte[] DestinationAddress => _address; + + /// + /// Payload data. + /// + public byte[] Payload => _payload; + + /// + /// RSSI of received packet. + /// + public sbyte Rssi => _rssi; + + /// + /// Absolute radio time that the packet was received. + /// + public uint AbsoluteTime => _absoluteTime; + + /// + /// Relative radio time from Rx start to Rx Timeout, + /// or absolute time that packet was Rx'ed when returned. + /// A value of 0 means no timeout. + /// + public uint RxTimeout => _rxTimeout; + } +} diff --git a/source/nanoFramework.TI.EasyLink/Status.cs b/source/nanoFramework.TI.EasyLink/Status.cs new file mode 100644 index 0000000..05a9ea1 --- /dev/null +++ b/source/nanoFramework.TI.EasyLink/Status.cs @@ -0,0 +1,73 @@ +// +// Copyright (c) 2019 The nanoFramework project contributors +// Portions Copyright (c) 2015-2019 Texas Instruments Incorporated +// See LICENSE file in the project root for full license information. +// + +namespace nanoFramework.TI.EasyLink +{ + /// + /// EasyLink Status and error codes. + /// + public enum Status : byte + { + /////////////////////////////////////////////////////////////////////////////////////////// + // !!! KEEP IN SYNC WITH with EasyLink_Status in SDK @ source\ti\easylink\EasyLink.h !!! // + /////////////////////////////////////////////////////////////////////////////////////////// + + /// + /// Operation successful. + /// + Success, + + /// + /// Configuration error. + /// + ConfigurationError, + + /// + /// Parameter error. + /// + ParameterError, + + /// + /// Memory error + /// + MemoryError, + + /// + /// Command error. + /// + CommandError, + + /// + /// Transmit error. + /// + TxError, + + /// + /// Receive error. + /// + RxError, + + /// + /// Receive timeout. + /// + RxTimeout, + + /// + /// Receive buffer error. + /// + RxBufferError, + + /// + /// Busy error. + /// + Busy, + + /// + /// Command stopped or aborted. + /// + Aborted, + } +} diff --git a/source/nanoFramework.TI.EasyLink/TransmitPacket.cs b/source/nanoFramework.TI.EasyLink/TransmitPacket.cs new file mode 100644 index 0000000..7fb43e2 --- /dev/null +++ b/source/nanoFramework.TI.EasyLink/TransmitPacket.cs @@ -0,0 +1,45 @@ +// +// Copyright (c) 2019 The nanoFramework project contributors +// Portions Copyright (c) 2015-2019 Texas Instruments Incorporated +// See LICENSE file in the project root for full license information. +// + +namespace nanoFramework.TI.EasyLink +{ + ///////////////////////////////////////////////////////////////////////////////////////////// + // !!! KEEP IN SYNC WITH with EasyLink_TxPacket in SDK @ source\ti\easylink\EasyLink.h !!! // + ///////////////////////////////////////////////////////////////////////////////////////////// + + /// + /// Class with definitions and data of a packet to be transmited. + /// + public class TransmitPacket + { + [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)] + private readonly byte[] _address; + + [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)] + private readonly byte[] _payload; + + /// + /// Destination address. + /// + public byte[] DestinationAddress { get => _address; } + + /// + /// Payload data. + /// + public byte[] Payload { get => _payload; } + + /// + /// + /// + /// + /// + public TransmitPacket(byte[] address, byte[] data) + { + _address = address; + _payload = data; + } + } +} diff --git a/source/nanoFramework.TI.EasyLink/key.snk b/source/nanoFramework.TI.EasyLink/key.snk new file mode 100644 index 0000000..67c9bb0 Binary files /dev/null and b/source/nanoFramework.TI.EasyLink/key.snk differ diff --git a/source/nanoFramework.TI.EasyLink/nanoFramework.TI.EasyLink.nfproj b/source/nanoFramework.TI.EasyLink/nanoFramework.TI.EasyLink.nfproj new file mode 100644 index 0000000..2327743 --- /dev/null +++ b/source/nanoFramework.TI.EasyLink/nanoFramework.TI.EasyLink.nfproj @@ -0,0 +1,89 @@ + + + + $(MSBuildToolsPath)..\..\..\nanoFramework\v1.0\ + + + + Debug + AnyCPU + {11A8DD76-328B-46DF-9F39-F559912D0360};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 0ecd244b-3715-49ab-98f1-beb907007b13 + Library + Properties + 512 + nanoFramework.TI.EasyLink + nanoFramework.TI.EasyLink + v1.0 + True + bin\$(Configuration)\nanoFramework.TI.EasyLink.xml + + + true + + + key.snk + + + false + + + + false + false + true + + false + true + + true + true + Stubs\nf_ti_easylink + nf_ti_easylink + false + nanoFramework.TI.EasyLink + + + + false + + + + + false + + + + + + + + + + + + + + + + + + + ..\packages\nanoFramework.CoreLibrary.1.2.6-preview.19\lib\mscorlib.dll + True + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105.The missing file is {0}. + + + + \ No newline at end of file diff --git a/source/nanoFramework.TI.EasyLink/packages.config b/source/nanoFramework.TI.EasyLink/packages.config new file mode 100644 index 0000000..beb30e6 --- /dev/null +++ b/source/nanoFramework.TI.EasyLink/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/source/readme.txt b/source/readme.txt new file mode 100644 index 0000000..9568694 --- /dev/null +++ b/source/readme.txt @@ -0,0 +1,21 @@ + _____ _ + _ __ __ _ _ __ ___ | ___| __ __ _ _ __ ___ _____ _____ _ __| | __ + | '_ \ / _` | '_ \ / _ \| |_ | '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ / + | | | | (_| | | | | (_) | _|| | | (_| | | | | | | __/\ V V / (_) | | | < + |_| |_|\__,_|_| |_|\___/|_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_\ + +=================================================================================== + +API docs: https://docs.nanoframework.net/api/nanoFramework.TI.EasyLink.html + +Browse our samples repository: https://github.com/nanoframework/samples + +Check our documentation online: https://docs.nanoframework.net + +Join our lively Discord community: https://discord.gg/gCyBu8T + +Report issues: https://github.com/nanoframework/Home/issues + +Follow us on Twitter: https://twitter.com/nanoframework + +Follow our YouTube channel: https://www.youtube.com/c/nanoFramework diff --git a/source/version.json b/source/version.json new file mode 100644 index 0000000..d8b0f2a --- /dev/null +++ b/source/version.json @@ -0,0 +1,24 @@ +{ + "$schema": "https://raw.githubusercontent.com/AArnott/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", + "version": "1.0.14-preview.{height}", + "release": { + "branchName" : "release-v{version}", + "versionIncrement" : "minor", + "firstUnstableTag" : "preview" + }, + "assemblyVersion": { + "precision": "revision" + }, + "semVer1NumericIdentifierPadding": 3, + "nugetPackageVersion": { + "semVer": 2 + }, + "publicReleaseRefSpec": [ + "^refs/heads/master$", + "^refs/heads/v\\d+(?:\\.\\d+)?$" + ], + "cloudBuild": { + "setVersionVariables": true, + "setAllVariables": true + } +} diff --git a/template.vssettings b/template.vssettings new file mode 100644 index 0000000..0485070 --- /dev/null +++ b/template.vssettings @@ -0,0 +1,74 @@ + + + + + + + 4 + false + 4 + true + + + 1 + 0 + 1 + 1 + 1 + 1 + 1 + 2 + 1 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 0 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + + + +