Showing preview only (1,769K chars total). Download the full file or copy to clipboard to get everything.
Repository: andijakl/universal-beacon
Branch: master
Commit: 9967adefd64b
Files: 126
Total size: 1.7 MB
Directory structure:
gitextract_ntbw8kz2/
├── .gitignore
├── LICENSE
├── LICENSE.GPL
├── Library/
│ ├── NuGetPackage.bat
│ ├── NuGetPush.bat
│ ├── UniversalBeacon.Library.Android/
│ │ ├── AndroidBluetoothPacketProvider.cs
│ │ ├── BLEScanCallback.cs
│ │ ├── PacketExtensions.cs
│ │ ├── Properties/
│ │ │ └── AssemblyInfo.cs
│ │ ├── RecordParser.cs
│ │ ├── Resources/
│ │ │ ├── AboutResources.txt
│ │ │ ├── Resource.Designer.cs
│ │ │ └── Values/
│ │ │ └── Strings.xml
│ │ └── UniversalBeacon.Library.Android.csproj
│ ├── UniversalBeacon.Library.Cocoa/
│ │ ├── CocoaBluetoothCentralDelegate.cs
│ │ ├── CocoaBluetoothPacketProvider.cs
│ │ ├── UniversalBeacon.Library.Cocoa.projitems
│ │ └── UniversalBeacon.Library.Cocoa.shproj
│ ├── UniversalBeacon.Library.Core/
│ │ ├── Entities/
│ │ │ ├── Beacon.cs
│ │ │ ├── BeaconException.cs
│ │ │ ├── BeaconFrameBase.cs
│ │ │ ├── BeaconFrameHelper.cs
│ │ │ ├── BeaconManager.cs
│ │ │ ├── EidEddystoneFrame.cs
│ │ │ ├── ProximityBeaconFrame.cs
│ │ │ ├── TlmEddystoneFrame.cs
│ │ │ ├── UidEddystoneFrame.cs
│ │ │ ├── UnknownBeaconFrame.cs
│ │ │ └── UrlEddystoneFrame.cs
│ │ ├── Interfaces/
│ │ │ └── IBluetoothPacketProvider.cs
│ │ ├── Interop/
│ │ │ ├── BLEAdvertisement.cs
│ │ │ ├── BLEAdvertisementDataSection.cs
│ │ │ ├── BLEAdvertisementPacket.cs
│ │ │ ├── BLEAdvertisementPacketArgs.cs
│ │ │ ├── BLEAdvertisementType.cs
│ │ │ ├── BLEAdvertisementWatcherStatusCodes.cs
│ │ │ ├── BLEFlagRecord.cs
│ │ │ ├── BLEGenericRecord.cs
│ │ │ ├── BLEManufacturerData.cs
│ │ │ ├── BLENameRecord.cs
│ │ │ ├── BLEPacketType.cs
│ │ │ ├── BLERecord.cs
│ │ │ ├── BTError.cs
│ │ │ └── BTMember.cs
│ │ └── UniversalBeacon.Library.Core.csproj
│ ├── UniversalBeacon.Library.UWP/
│ │ ├── PacketExtensions.cs
│ │ ├── Properties/
│ │ │ ├── AssemblyInfo.cs
│ │ │ └── UniversalBeacon.Library.UWP.rd.xml
│ │ ├── UniversalBeacon.Library.UWP.csproj
│ │ └── WindowsBluetoothPacketProvider.cs
│ ├── UniversalBeacon.Library.iOS/
│ │ ├── Properties/
│ │ │ └── AssemblyInfo.cs
│ │ ├── UniversalBeacon.Library.iOS.csproj
│ │ └── iOSBluetoothPacketProvider.cs
│ └── UniversalBeaconLibrary.nuspec
├── README.md
├── Samples/
│ ├── UniversalBeacon.Sample/
│ │ ├── UniversalBeacon.Sample/
│ │ │ ├── App.xaml
│ │ │ ├── App.xaml.cs
│ │ │ ├── FrameTemplateSelector.cs
│ │ │ ├── Models/
│ │ │ │ └── BeaconService.cs
│ │ │ ├── UniversalBeacon.Sample.csproj
│ │ │ ├── ViewCells/
│ │ │ │ ├── EddystoneTLMViewCell.xaml
│ │ │ │ ├── EddystoneTLMViewCell.xaml.cs
│ │ │ │ ├── GenericViewCell.xaml
│ │ │ │ └── GenericViewCell.xaml.cs
│ │ │ ├── ViewModels/
│ │ │ │ └── HomeViewModel.cs
│ │ │ └── Views/
│ │ │ ├── HomeView.xaml
│ │ │ └── HomeView.xaml.cs
│ │ ├── UniversalBeacon.Sample.Android/
│ │ │ ├── Assets/
│ │ │ │ └── AboutAssets.txt
│ │ │ ├── Main.storyboard
│ │ │ ├── MainActivity.cs
│ │ │ ├── MainApplication.cs
│ │ │ ├── Properties/
│ │ │ │ ├── AndroidManifest.xml
│ │ │ │ └── AssemblyInfo.cs
│ │ │ ├── Resources/
│ │ │ │ ├── AboutResources.txt
│ │ │ │ ├── Resource.Designer.cs
│ │ │ │ ├── layout/
│ │ │ │ │ ├── Tabbar.axml
│ │ │ │ │ └── Toolbar.axml
│ │ │ │ └── values/
│ │ │ │ └── styles.xml
│ │ │ └── UniversalBeacon.Sample.Android.csproj
│ │ ├── UniversalBeacon.Sample.UWP/
│ │ │ ├── App.xaml
│ │ │ ├── App.xaml.cs
│ │ │ ├── MainPage.xaml
│ │ │ ├── MainPage.xaml.cs
│ │ │ ├── Package.appxmanifest
│ │ │ ├── Properties/
│ │ │ │ ├── AssemblyInfo.cs
│ │ │ │ └── Default.rd.xml
│ │ │ ├── UniversalBeacon.Sample.UWP.csproj
│ │ │ ├── UniversalBeacon.Sample.UWP.nuget.targets
│ │ │ └── project.lock.json
│ │ └── UniversalBeacon.Sample.iOS/
│ │ ├── AppDelegate.cs
│ │ ├── Entitlements.plist
│ │ ├── Info.plist
│ │ ├── Main.cs
│ │ ├── Properties/
│ │ │ └── AssemblyInfo.cs
│ │ ├── Resources/
│ │ │ └── LaunchScreen.storyboard
│ │ ├── UniversalBeacon.Sample.iOS.csproj
│ │ ├── iTunesArtwork
│ │ ├── iTunesArtwork@2x
│ │ └── packages.config
│ └── WindowsBeacons/
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── ApplicationInsights.config
│ ├── Converter/
│ │ ├── BeaconFrameTypeToTextConverter.cs
│ │ ├── BeaconTypeToTextConverter.cs
│ │ ├── IdToHexTextConverter.cs
│ │ └── IntToGridLengthConverter.cs
│ ├── FrameTemplateSelector.cs
│ ├── MainPage.xaml
│ ├── MainPage.xaml.cs
│ ├── Package.appxmanifest
│ ├── Properties/
│ │ ├── Annotations.cs
│ │ ├── AssemblyInfo.cs
│ │ └── Default.rd.xml
│ ├── Service References/
│ │ └── Application Insights/
│ │ └── ConnectedService.json
│ ├── Strings/
│ │ ├── de-DE/
│ │ │ └── Resources.resw
│ │ ├── en-US/
│ │ │ └── Resources.resw
│ │ ├── fr-FR/
│ │ │ └── Resources.resw
│ │ ├── pt-BR/
│ │ │ └── Resources.resw
│ │ ├── ru-RU/
│ │ │ └── Resources.resw
│ │ └── zh-CN/
│ │ └── Resources.resw
│ ├── WindowsBeacons.csproj
│ ├── WindowsBeacons.nuget.targets
│ └── _pkginfo.txt
├── UniversalBeacon.Library.sln
├── UniversalBeaconLibrary.sln.DotSettings
└── WindowsBeacons.sln
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
## 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/
build/
bld/
[Bb]in/
[Oo]bj/
*.appx
# Visual Studo 2015 cache/options directory
.vs/
# 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
*_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
*.opensdf
*.sdf
*.cachefile
# Visual Studio profiler
*.psess
*.vsp
*.vspx
# 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 addin-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# NCrunch
_NCrunch_*
.*crunch*.local.xml
# 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
# 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
# Windows Azure Build Output
csx/
*.build.csdef
# Windows Store app package directory
AppPackages/
# Others
*.[Cc]ache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
node_modules/
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/
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
/UniversalBeaconLibrary/nuget.exe
/UniversalBeaconLibrary/project.lock.json
/WindowsBeacons/project.lock.json
/WindowsBeacons/BundleArtifacts
/WindowsBeacons/Package.StoreAssociation.xml
/Samples/WindowsBeacons/BundleArtifacts
/Samples/WindowsBeacons/Package.StoreAssociation.xml
# OS X
.DS_Store
================================================
FILE: LICENSE
================================================
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.
================================================
FILE: LICENSE.GPL
================================================
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
================================================
FILE: Library/NuGetPackage.bat
================================================
@echo --------------------------------------------------------------------------
@echo Remember to update the release notes in /UniversalBeaconLibrary.nuspec
@echo --------------------------------------------------------------------------
nuget pack ./UniversalBeaconLibrary.nuspec -OutputDirectory ./nupkg -Build -Symbols -Prop Configuration=Release
================================================
FILE: Library/NuGetPush.bat
================================================
nuget push .\nupkg\UniversalBeaconLibrary.3.2.0.nupkg -source https://www.nuget.org/api/v2/package
================================================
FILE: Library/UniversalBeacon.Library.Android/AndroidBluetoothPacketProvider.cs
================================================
using System;
using Android.Bluetooth;
using Android.Content;
using UniversalBeacon.Library.Core.Interfaces;
using UniversalBeacon.Library.Core.Interop;
namespace UniversalBeacon.Library
{
public class AndroidBluetoothPacketProvider : Java.Lang.Object, IBluetoothPacketProvider
{
public event EventHandler<BLEAdvertisementPacketArgs> AdvertisementPacketReceived;
public event EventHandler<BTError> WatcherStopped;
private readonly BluetoothAdapter _adapter;
private readonly BLEScanCallback _scanCallback;
public AndroidBluetoothPacketProvider(Context context)
{
var manager = (BluetoothManager)context.GetSystemService("bluetooth");
_adapter = manager.Adapter;
_scanCallback = new BLEScanCallback();
}
private void ScanCallback_OnAdvertisementPacketReceived(object sender, BLEAdvertisementPacketArgs e)
{
AdvertisementPacketReceived?.Invoke(this, e);
}
public void Start()
{
_scanCallback.OnAdvertisementPacketReceived += ScanCallback_OnAdvertisementPacketReceived;
_adapter.BluetoothLeScanner.StartScan(_scanCallback);
}
public void Stop()
{
_scanCallback.OnAdvertisementPacketReceived -= ScanCallback_OnAdvertisementPacketReceived;
_adapter.CancelDiscovery();
}
}
}
================================================
FILE: Library/UniversalBeacon.Library.Android/BLEScanCallback.cs
================================================
using System;
using Android.Bluetooth;
using Android.Bluetooth.LE;
using Android.Runtime;
using UniversalBeacon.Library.Core.Interop;
namespace UniversalBeacon.Library
{
internal class BLEScanCallback : ScanCallback
{
public event EventHandler<BLEAdvertisementPacketArgs> OnAdvertisementPacketReceived;
public override void OnScanFailed([GeneratedEnum] ScanFailure errorCode)
{
base.OnScanFailed(errorCode);
}
public override void OnScanResult([GeneratedEnum] ScanCallbackType callbackType, ScanResult result)
{
base.OnScanResult(callbackType, result);
switch (result.Device.Type)
{
case BluetoothDeviceType.Le:
case BluetoothDeviceType.Unknown:
try
{
var p = new BLEAdvertisementPacket
{
// address will be in the form "D1:36:E6:9D:46:52"
BluetoothAddress = result.Device.Address.ToNumericAddress(),
RawSignalStrengthInDBm = (short) result.Rssi,
// TODO: probably needs adjustment
Timestamp = DateTimeOffset.FromUnixTimeMilliseconds(result.TimestampNanos / 1000),
// TODO: validate this
AdvertisementType = (BLEAdvertisementType) result.ScanRecord.AdvertiseFlags,
Advertisement = new BLEAdvertisement
{
LocalName = result.ScanRecord.DeviceName
}
};
if (result.ScanRecord.ServiceUuids != null)
{
foreach(var svc in result.ScanRecord.ServiceUuids)
{
var guid = new Guid(svc.Uuid.ToString());
var data = result.ScanRecord.GetServiceData(svc);
p.Advertisement.ServiceUuids.Add(guid);
}
}
var recordData = result.ScanRecord.GetBytes();
var rec = RecordParser.Parse(recordData);
foreach (var curRec in rec)
{
if (curRec is BLEManufacturerData md)
{
p.Advertisement.ManufacturerData.Add(md);
}
if (curRec is BLEAdvertisementDataSection sd)
{
p.Advertisement.DataSections.Add(sd);
}
}
OnAdvertisementPacketReceived?.Invoke(this, new BLEAdvertisementPacketArgs(p));
}
catch (Exception)
{
// TODO
}
break;
default:
break;
}
// result.Device;
}
}
}
================================================
FILE: Library/UniversalBeacon.Library.Android/PacketExtensions.cs
================================================
using System;
namespace UniversalBeacon.Library
{
internal static class PacketExtensions
{
public static ulong ToNumericAddress(this string addressString)
{
ulong address = 0;
var parts = addressString.Split(new[] { ':' }, StringSplitOptions.RemoveEmptyEntries);
for(var i = 0; i < parts.Length; i++)
{
var b = (ulong)byte.Parse(parts[i], System.Globalization.NumberStyles.HexNumber);
// they're in reverse order due to endianness
address |= (b << ((parts.Length - i - 1) * 8));
}
return address;
}
}
}
================================================
FILE: Library/UniversalBeacon.Library.Android/Properties/AssemblyInfo.cs
================================================
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Android.App;
// 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("UniversalBeacon.Library.Android")]
[assembly: AssemblyDescription("Universal Bluetooth Beacon Library - Extension to interface Xamarin / Android APIs to the Cross Platform Implementation")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Chris Tacke, Andreas Jakl")]
[assembly: AssemblyProduct("UniversalBeacon.Library.Android")]
[assembly: AssemblyCopyright("Copyright © 2015 - 2017 Chris Tacke, Andreas Jakl")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.2.0.0")]
[assembly: AssemblyFileVersion("3.2.0.0")]
================================================
FILE: Library/UniversalBeacon.Library.Android/RecordParser.cs
================================================
using System;
using System.Collections.Generic;
using System.Linq;
using UniversalBeacon.Library.Core.Interop;
namespace UniversalBeacon.Library
{
internal class RecordParser
{
public static BLERecord[] Parse(byte[] recordData)
{
var results = new List<BLERecord>();
var index = 0;
while (index < recordData.Length)
{
// first byte in the record length
var length = recordData[index++];
if (length == 0) break;
// get the type
var type = (BLEPacketType)recordData[index];
// copy off the packetData - the type is part of the length so adjust for that
var data = recordData.Skip(index + 1).Take(length - 1).ToArray();
switch (type)
{
case BLEPacketType.Invalid:
// zero is invalid
break;
case BLEPacketType.Flags:
results.Add(new BLEFlagRecord(type, data[0]));
break;
case BLEPacketType.LocalName:
results.Add(new BLENameRecord(type, data));
break;
case BLEPacketType.ManufacturerData:
results.Add(new BLEManufacturerData(type, data));
break;
case BLEPacketType.ServiceData:
results.Add(new BLEAdvertisementDataSection(type, data));
break;
case BLEPacketType.UUID16List:
// swap endianness
Array.Reverse(data);
results.Add(new BLEGenericRecord(type, data));
break;
default:
results.Add(new BLEGenericRecord(type, data));
break;
}
index += length;
/*
if (!Enum.IsDefined(typeof(AdvertisementRecordType), type))
{
Trace.Message("Advertisment record type not defined: {0}", type);
break;
}
//data length is length -1 because type takes the first byte
byte[] data = new byte[length - 1];
Array.Copy(scanRecord, index + 1, data, 0, length - 1);
// don't forget that data is little endian so reverse
// Supplement to Bluetooth Core Specification 1
// NOTE: all relevant devices are already little endian, so this is not necessary for any type except UUIDs
//var record = new AdvertisementRecord((AdvertisementRecordType)type, data.Reverse().ToArray());
switch ((AdvertisementRecordType)type)
{
case AdvertisementRecordType.ServiceDataUuid32Bit:
case AdvertisementRecordType.SsUuids128Bit:
case AdvertisementRecordType.SsUuids16Bit:
case AdvertisementRecordType.SsUuids32Bit:
case AdvertisementRecordType.UuidCom32Bit:
case AdvertisementRecordType.UuidsComplete128Bit:
case AdvertisementRecordType.UuidsComplete16Bit:
case AdvertisementRecordType.UuidsIncomple16Bit:
case AdvertisementRecordType.UuidsIncomplete128Bit:
Array.Reverse(data);
break;
}
var record = new AdvertisementRecord((AdvertisementRecordType)type, data);
Trace.Message(record.ToString());
records.Add(record);
//Advance
index += length;
}
*/
}
return results.ToArray();
}
}
}
================================================
FILE: Library/UniversalBeacon.Library.Android/Resources/AboutResources.txt
================================================
Images, layout descriptions, binary blobs and string dictionaries can be included
in your application as resource files. Various Android APIs are designed to
operate on the resource IDs instead of dealing with images, strings or binary blobs
directly.
For example, a sample Android app that contains a user interface layout (main.axml),
an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
would keep its resources in the "Resources" directory of the application:
Resources/
drawable/
icon.png
layout/
main.axml
values/
strings.xml
In order to get the build system to recognize Android resources, set the build action to
"AndroidResource". The native Android APIs do not operate directly with filenames, but
instead operate on resource IDs. When you compile an Android application that uses resources,
the build system will package the resources for distribution and generate a class called "R"
(this is an Android convention) that contains the tokens for each one of the resources
included. For example, for the above Resources layout, this is what the R class would expose:
public class R {
public class drawable {
public const int icon = 0x123;
}
public class layout {
public const int main = 0x456;
}
public class strings {
public const int first_string = 0xabc;
public const int second_string = 0xbcd;
}
}
You would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main
to reference the layout/main.axml file, or R.strings.first_string to reference the first
string in the dictionary file values/strings.xml.
================================================
FILE: Library/UniversalBeacon.Library.Android/Resources/Resource.Designer.cs
================================================
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
[assembly: global::Android.Runtime.ResourceDesignerAttribute("UniversalBeacon.Library.Resource", IsApplication=false)]
namespace UniversalBeacon.Library
{
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "1.0.0.0")]
public partial class Resource
{
static Resource()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
public partial class Attribute
{
static Attribute()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
private Attribute()
{
}
}
public partial class String
{
// aapt resource value: 0x7f020001
public static int ApplicationName = 2130837505;
// aapt resource value: 0x7f020000
public static int Hello = 2130837504;
static String()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
private String()
{
}
}
}
}
#pragma warning restore 1591
================================================
FILE: Library/UniversalBeacon.Library.Android/Resources/Values/Strings.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="Hello">Hello World, Click Me!</string>
<string name="ApplicationName">$projectname$</string>
</resources>
================================================
FILE: Library/UniversalBeacon.Library.Android/UniversalBeacon.Library.Android.csproj
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{6ADC54D4-3B9B-495E-A2B8-F9CF5FD623CE}</ProjectGuid>
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>UniversalBeacon.Library</RootNamespace>
<AssemblyName>UniversalBeacon.Library.Android</AssemblyName>
<FileAlignment>512</FileAlignment>
<AndroidResgenFile>Resources\Resource.Designer.cs</AndroidResgenFile>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<TargetFrameworkVersion>v8.1</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Mono.Android" />
<Reference Include="mscorlib" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="PacketExtensions.cs" />
<Compile Include="RecordParser.cs" />
<Compile Include="BLEScanCallback.cs" />
<Compile Include="AndroidBluetoothPacketProvider.cs" />
<Compile Include="Resources\Resource.Designer.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\AboutResources.txt" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\Values\Strings.xml" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\UniversalBeacon.Library.Core\UniversalBeacon.Library.Core.csproj">
<Project>{83be2e56-2400-40a2-8d88-b5dae98213e1}</Project>
<Name>UniversalBeacon.Library.Core</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
================================================
FILE: Library/UniversalBeacon.Library.Cocoa/CocoaBluetoothCentralDelegate.cs
================================================
using System;
using System.Collections.Generic;
using System.Diagnostics;
using CoreBluetooth;
using Foundation;
using UniversalBeacon.Library.Core.Interop;
namespace UniversalBeacon.Library
{
internal class CocoaBluetoothCentralDelegate : CBCentralManagerDelegate
{
public event EventHandler<BLEAdvertisementPacketArgs> OnAdvertisementPacketReceived;
#region CBCentralManagerDelegate
public override void ConnectedPeripheral(CBCentralManager central, CBPeripheral peripheral)
{
Debug.WriteLine($"ConnectedPeripheral(CBCentralManager central, CBPeripheral {peripheral})");
}
public override void DisconnectedPeripheral(CBCentralManager central, CBPeripheral peripheral, NSError error)
{
Debug.WriteLine($"DisconnectedPeripheral(CBCentralManager central, CBPeripheral {peripheral}, NSError {error})");
}
public override void DiscoveredPeripheral(CBCentralManager central, CBPeripheral peripheral, NSDictionary advertisementData, NSNumber RSSI)
{
Debug.WriteLine($"Cocoa peripheral {peripheral}");
Debug.WriteLine($"Cocoa advertisementData {advertisementData}");
Debug.WriteLine($"Cocoa RSSI {RSSI}");
var bLEAdvertisementPacket = new BLEAdvertisementPacket()
{
Advertisement = new BLEAdvertisement()
{
LocalName = peripheral.Name,
ServiceUuids = new List<Guid>(),
DataSections = new List<BLEAdvertisementDataSection>(),
ManufacturerData = new List<BLEManufacturerData>()
},
AdvertisementType = BLEAdvertisementType.ScanResponse,
BluetoothAddress = (ulong)peripheral.Identifier.GetHashCode(),
RawSignalStrengthInDBm = RSSI.Int16Value,
Timestamp = DateTimeOffset.Now
};
//https://developer.apple.com/documentation/corebluetooth/cbadvertisementdataserviceuuidskey
//if (advertisementData.ContainsKey(CBAdvertisement.DataServiceUUIDsKey))
//{
// bLEAdvertisementPacket.Advertisement.ServiceUuids.Add(
// item: new BLEManufacturerData(packetType: BLEPacketType.UUID16List,
// data: (advertisementData[CBAdvertisement.DataServiceUUIDsKey])));
//}
//https://developer.apple.com/documentation/corebluetooth/cbadvertisementdataservicedatakey
//if (advertisementData.ContainsKey(CBAdvertisement.DataServiceDataKey))
//{
// bLEAdvertisementPacket.Advertisement.DataSections.Add(
// item: new BLEManufacturerData(packetType: BLEPacketType.ServiceData,
// data: advertisementData[CBAdvertisement.DataServiceDataKey]));
//}
//https://developer.apple.com/documentation/corebluetooth/cbadvertisementdatamanufacturerdatakey
if (advertisementData.ContainsKey(CBAdvertisement.DataManufacturerDataKey))
{
bLEAdvertisementPacket.Advertisement.ManufacturerData.Add(
item: new BLEManufacturerData(packetType: BLEPacketType.ManufacturerData,
data: (advertisementData[CBAdvertisement.DataManufacturerDataKey]
as NSData).ToArray()));
}
// Missing CBAdvertisement.DataTxPowerLevelKey
var bLEAdvertisementPacketArgs = new BLEAdvertisementPacketArgs(data: bLEAdvertisementPacket);
OnAdvertisementPacketReceived?.Invoke(this, bLEAdvertisementPacketArgs);
}
public override void FailedToConnectPeripheral(CBCentralManager central, CBPeripheral peripheral, NSError error)
{
Debug.WriteLine($"FailedToConnectPeripheral(CBCentralManager central, CBPeripheral {peripheral}, NSError {error})");
}
public override void UpdatedState(CBCentralManager central)
{
switch (central.State)
{
case CBCentralManagerState.Unknown:
Debug.WriteLine("CBCentralManagerState.Unknown");
break;
case CBCentralManagerState.Resetting:
Debug.WriteLine("CBCentralManagerState.Resetting");
break;
case CBCentralManagerState.Unsupported:
Debug.WriteLine("CBCentralManagerState.Unsupported");
break;
case CBCentralManagerState.Unauthorized:
Debug.WriteLine("CBCentralManagerState.Unauthorized");
break;
case CBCentralManagerState.PoweredOff:
Debug.WriteLine("CBCentralManagerState.PoweredOff");
break;
case CBCentralManagerState.PoweredOn:
Debug.WriteLine("CBCentralManagerState.PoweredOn");
central.ScanForPeripherals(peripheralUuids: new CBUUID[] { },
options: new PeripheralScanningOptions { AllowDuplicatesKey = true });
break;
default:
throw new NotImplementedException();
}
}
public override void WillRestoreState(CBCentralManager central, NSDictionary dict)
{
Debug.WriteLine($"WillRestoreState(CBCentralManager central, NSDictionary {dict})");
}
#endregion CBCentralManagerDelegate
}
}
================================================
FILE: Library/UniversalBeacon.Library.Cocoa/CocoaBluetoothPacketProvider.cs
================================================
using System;
using System.Diagnostics;
using CoreBluetooth;
using Foundation;
using UniversalBeacon.Library.Core.Interfaces;
using UniversalBeacon.Library.Core.Interop;
namespace UniversalBeacon.Library
{
public class CocoaBluetoothPacketProvider : NSObject, IBluetoothPacketProvider
{
public event EventHandler<BLEAdvertisementPacketArgs> AdvertisementPacketReceived;
public event EventHandler<BTError> WatcherStopped;
private readonly CocoaBluetoothCentralDelegate centralDelegate;
private readonly CBCentralManager central;
public CocoaBluetoothPacketProvider()
{
Debug.WriteLine("BluetoothPacketProvider()");
centralDelegate = new CocoaBluetoothCentralDelegate();
central = new CBCentralManager(centralDelegate, null);
}
private void ScanCallback_OnAdvertisementPacketReceived(object sender, BLEAdvertisementPacketArgs e)
{
AdvertisementPacketReceived?.Invoke(this, e);
}
public void Start()
{
Debug.WriteLine("BluetoothPacketProvider:Start()");
centralDelegate.OnAdvertisementPacketReceived += ScanCallback_OnAdvertisementPacketReceived;
// Wait for the PoweredOn state
//if(CBCentralManagerState.PoweredOn == central.State) {
// central.ScanForPeripherals(peripheralUuids: new CBUUID[] { },
// options: new PeripheralScanningOptions { AllowDuplicatesKey = false });
//}
}
public void Stop()
{
Debug.WriteLine("BluetoothPacketProvider:Stop()");
centralDelegate.OnAdvertisementPacketReceived -= ScanCallback_OnAdvertisementPacketReceived;
central.StopScan();
WatcherStopped?.Invoke(sender: this, e: new BTError(BTError.BluetoothError.Success));
}
}
}
================================================
FILE: Library/UniversalBeacon.Library.Cocoa/UniversalBeacon.Library.Cocoa.projitems
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
<HasSharedItems>true</HasSharedItems>
<SharedGUID>{2D1EF39A-A3B4-46B5-BFF0-FE0D59BDA92B}</SharedGUID>
</PropertyGroup>
<PropertyGroup Label="Configuration">
<Import_RootNamespace>UniversalBeacon.Library</Import_RootNamespace>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)CocoaBluetoothCentralDelegate.cs" />
<Compile Include="$(MSBuildThisFileDirectory)CocoaBluetoothPacketProvider.cs" />
</ItemGroup>
</Project>
================================================
FILE: Library/UniversalBeacon.Library.Cocoa/UniversalBeacon.Library.Cocoa.shproj
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{2D1EF39A-A3B4-46B5-BFF0-FE0D59BDA92B}</ProjectGuid>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props" />
<Import Project="UniversalBeacon.Library.Cocoa.projitems" Label="Shared" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets" />
</Project>
================================================
FILE: Library/UniversalBeacon.Library.Core/Entities/Beacon.cs
================================================
// Copyright 2015 - 2017 Andreas Jakl. All rights reserved.
// https://github.com/andijakl/universal-beacon
//
// Based on the Eddystone specification by Google,
// available under Apache License, Version 2.0 from
// https://github.com/google/eddystone
//
// 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.
using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using UniversalBeacon.Library.Core.Interop;
namespace UniversalBeacon.Library.Core.Entities
{
/// <summary>
/// Represents a single unique beacon that has a specified Bluetooth MAC address.
/// Construction and updates are usually handled by the BeaconManager.
///
/// Construct this class based on a Bluetooth advertisement received from the
/// Windows Bluetooth API. When further advertisements are received for this beacon,
/// call its UpdateBeacon() method to update the frames.
/// </summary>
public class Beacon : INotifyPropertyChanged
{
/// <summary>
/// Bluetooth Service UUID for Eddystone beacons.
/// </summary>
private readonly Guid _eddystoneGuid = new Guid("0000FEAA-0000-1000-8000-00805F9B34FB");
public enum BeaconTypeEnum
{
/// <summary>
/// Bluetooth LE advertisment that is not recognized as one of the beacon formats
/// supported by this library.
/// </summary>
Unknown,
/// <summary>
/// Beacon conforming to the Eddystone specification by Google.
/// </summary>
Eddystone,
/// <summary>
/// Beacon conforming to the Apple iBeacon specification.
/// iBeacon is a Trademark of Apple Inc.
/// Note: the beacon broadcast payload is not parsed by this library.
/// </summary>
iBeacon
}
/// <summary>
/// Type of this beacon.
/// Defines how the beacon will parse the individual frames to extract information from the
/// advertisements.
/// </summary>
public BeaconTypeEnum BeaconType { get; set; } = BeaconTypeEnum.Unknown;
/// <summary>
/// List of all the different frames that have been observed for this beacon so far.
/// If a new frame with the same type is collected, it replaces the previous frame.
/// </summary>
public ObservableCollection<BeaconFrameBase> BeaconFrames { get; set; } = new ObservableCollection<BeaconFrameBase>();
private short _rssi;
/// <summary>
/// Raw signal strength in dBM.
/// If a new advertisement is received for the same beacon (with the same
/// Bluetooth MAC address), always the latest signal strength is recorded.
/// </summary>
public short Rssi
{
get => _rssi;
set
{
if (_rssi == value) return;
_rssi = value;
OnPropertyChanged();
}
}
private ulong _bluetoothAddress;
/// <summary>
/// The Bluetooth MAC address.
/// Used to cluster the different received Bluetooth advertisements and to
/// collect multiple advertisements for unique beacons.
/// </summary>
public ulong BluetoothAddress
{
get => _bluetoothAddress;
set
{
if (_bluetoothAddress == value) return;
_bluetoothAddress = value;
OnPropertyChanged();
OnPropertyChanged(nameof(BluetoothAddressAsString));
}
}
/// <summary>
/// Retrieves the Bluetooth MAC address formatted as a hex string.
/// </summary>
public string BluetoothAddressAsString
{
get
{
return string.Join(":", BitConverter.GetBytes(BluetoothAddress).Reverse().Select(b => b.ToString("X2"))).Substring(6);
}
}
private DateTimeOffset _timestamp;
/// <summary>
/// Timestamp when the last advertisement was received for this beacon.
/// </summary>
public DateTimeOffset Timestamp
{
get => _timestamp;
set
{
if (_timestamp == value) return;
_timestamp = value;
OnPropertyChanged();
}
}
/// <summary>
/// Construct a new Bluetooth beacon based on the received advertisement.
/// Tries to find out if it's a known type, and then parses the contents accordingly.
/// </summary>
/// <param name="btAdv">Bluetooth advertisement to parse, as received from
/// the Windows Bluetooth LE API.</param>
public Beacon(BLEAdvertisementPacket btAdv)
{
BluetoothAddress = btAdv.BluetoothAddress;
UpdateBeacon(btAdv);
}
/// <summary>
/// Manually create a new Beacon instance.
/// </summary>
/// <param name="beaconType">Beacon type to use for this manually constructed beacon.</param>
public Beacon(BeaconTypeEnum beaconType)
{
BeaconType = beaconType;
}
/// <summary>
/// Received a new advertisement for this beacon.
/// If the Bluetooth address of the new advertisement matches this beacon,
/// it will parse the contents of the advertisement and extract known frames.
/// </summary>
/// <param name="btAdv">Bluetooth advertisement to parse, as received from
/// the Windows Bluetooth LE API.</param>
public void UpdateBeacon(BLEAdvertisementPacket btAdv)
{
if (btAdv == null) return;
// Only update beacon info if it's the same beacon
if (btAdv.BluetoothAddress != BluetoothAddress)
{
throw new BeaconException("Bluetooth address of beacon does not match - not updating beacon information");
}
Rssi = btAdv.RawSignalStrengthInDBm;
Timestamp = btAdv.Timestamp;
//Debug.WriteLine($"Beacon advertisment detected (Strength: {Rssi}): Address: {BluetoothAddress}");
// Check if beacon advertisement contains any actual usable data
if (btAdv.Advertisement == null) return;
// Service UUID identifies Eddystone beacon - iBeacon is identified via manufacturer ID
if (btAdv.Advertisement.ServiceUuids.Any())
{
foreach (var serviceUuid in btAdv.Advertisement.ServiceUuids)
{
// If we have multiple service UUIDs and already recognized a beacon type,
// don't overwrite it with another service Uuid.
if (BeaconType == BeaconTypeEnum.Unknown)
{
BeaconType = serviceUuid.Equals(_eddystoneGuid)
? BeaconTypeEnum.Eddystone
: BeaconTypeEnum.Unknown;
}
}
}
else
{
//Debug.WriteLine("Bluetooth LE device does not send Service UUIDs");
}
// Data sections - used by Eddystone Beacon type
if (btAdv.Advertisement.DataSections.Any())
{
if (BeaconType == BeaconTypeEnum.Eddystone)
{
// This beacon is according to the Eddystone specification - parse data
ParseEddystoneData(btAdv);
}
else if (BeaconType == BeaconTypeEnum.Unknown)
{
// Unknown beacon type
//Debug.WriteLine("\nUnknown beacon");
//foreach (var dataSection in btAdv.Advertisement.DataSections)
//{
// Debug.WriteLine("Data section 0x: " + dataSection.DataType.ToString("X") + " = " +
// BitConverter.ToString(dataSection.Data.ToArray()));
//}
}
}
// Manufacturer data - used by Proximity Beacon type (iBeacon)
if (btAdv.Advertisement.ManufacturerData.Any())
{
foreach (var manufacturerData in btAdv.Advertisement.ManufacturerData)
{
// Print the company ID + the raw data in hex format
//var manufacturerDataString = $"0x{manufacturerData.CompanyId.ToString("X")}: {BitConverter.ToString(manufacturerData.Data.ToArray())}";
//Debug.WriteLine("Manufacturer data: " + manufacturerDataString);
var manufacturerDataArry = manufacturerData.Data.ToArray();
if (BeaconFrameHelper.IsProximityBeaconPayload(manufacturerData.CompanyId, manufacturerDataArry))
{
BeaconType = BeaconTypeEnum.iBeacon;
//Debug.WriteLine("iBeacon Frame: " + BitConverter.ToString(manufacturerDataArry));
var beaconFrame = new ProximityBeaconFrame(manufacturerDataArry);
// Only one relevant data frame for iBeacons
if (BeaconFrames.Any())
{
BeaconFrames[0].Update(beaconFrame);
}
else
{
BeaconFrames.Add(beaconFrame);
}
}
}
}
}
private void ParseEddystoneData(BLEAdvertisementPacket btAdv)
{
// Parse Eddystone data
foreach (var dataSection in btAdv.Advertisement.DataSections)
{
//Debug.WriteLine("Beacon data: " + dataSection.DataType + " = " +
// BitConverter.ToString(dataSection.Data.ToArray()));
//+ " (" + Encoding.UTF8.GetString(dataSection.Data.ToArray()) + ")\n");
// Relvant data of Eddystone is in data section 0x16
// Windows receives: 0x01 = 0x06
// 0x03 = 0xAA 0xFE
// 0x16 = 0xAA 0xFE [type] [data]
if ((dataSection.DataType == 0x16) || (dataSection.Manufacturer == (ushort)BTMember.GoogleEddystone))
{
var beaconFrame = dataSection.Data.ToArray().CreateEddystoneBeaconFrame();
if (beaconFrame == null) continue;
var found = false;
for (var i = 0; i < BeaconFrames.Count; i++)
{
if (BeaconFrames[i].GetType() == beaconFrame.GetType())
{
var updateFrame = false;
if (beaconFrame.GetType() == typeof(UnknownBeaconFrame))
{
// Unknown frame - also compare eddystone type
var existingEddystoneFrameType =
BeaconFrames[i].Payload.GetEddystoneFrameType();
var newEddystoneFrameType = beaconFrame.Payload.GetEddystoneFrameType();
if (existingEddystoneFrameType != null &&
existingEddystoneFrameType == newEddystoneFrameType)
{
updateFrame = true;
}
}
else
{
// Frame type of the new frame is equal to the stored one in BeaconFrames[i] - udpate it right away.
updateFrame = true;
}
// If we know this frame already, update the existing info.
if (updateFrame)
{
BeaconFrames[i].Update(beaconFrame);
found = true;
break; // Don't analyze any other known frames of this beacon
}
}
}
if (!found)
{
// We didn't know this beacon frame so far - add it to the list of known frames.
BeaconFrames.Add(beaconFrame);
}
}
}
}
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
}
================================================
FILE: Library/UniversalBeacon.Library.Core/Entities/BeaconException.cs
================================================
// Copyright 2015 - 2017 Andreas Jakl. All rights reserved.
// https://github.com/andijakl/universal-beacon
//
// Based on the Eddystone specification by Google,
// available under Apache License, Version 2.0 from
// https://github.com/google/eddystone
//
// 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.
using System;
namespace UniversalBeacon.Library.Core.Entities
{
/// <summary>
/// Exception occured when parsing or assembling Bluetooth Beacons.
/// </summary>
public class BeaconException : Exception
{
public BeaconException() { }
public BeaconException(string message) : base(message) { }
public BeaconException(string message, Exception inner) : base(message, inner) { }
}
}
================================================
FILE: Library/UniversalBeacon.Library.Core/Entities/BeaconFrameBase.cs
================================================
// Copyright 2015 - 2017 Andreas Jakl. All rights reserved.
// https://github.com/andijakl/universal-beacon
//
// Based on the Eddystone specification by Google,
// available under Apache License, Version 2.0 from
// https://github.com/google/eddystone
//
// 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.
using System;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
namespace UniversalBeacon.Library.Core.Entities
{
/// <summary>
/// Abstract class for every Bluetooth Beacon frame.
/// Common is that every frame has a payload / data, which derived classes can
/// further parse and make it more accessible through custom properties depending
/// on the beacon specification.
/// </summary>
public abstract class BeaconFrameBase : INotifyPropertyChanged
{
protected byte[] _payload;
/// <summary>
/// The raw byte payload of this beacon frame.
/// Derived classes can add additional functionality to parse or update the payload.
///
/// Note: directly setting the payload does not lead to the class re-parsing the payload
/// into its instance variables (if applicable in the derived class).
/// Call ParsePayload() manually from the derived class if you wish to enable this behavior.
/// </summary>
public byte[] Payload
{
get => _payload;
set
{
if (value == null)
{
_payload = null;
return;
}
if (_payload != null && _payload.SequenceEqual(value)) return;
_payload = new byte[value.Length];
Array.Copy(value, _payload, value.Length);
OnPropertyChanged();
}
}
protected BeaconFrameBase()
{
}
protected BeaconFrameBase(byte[] payload)
{
Payload = payload;
}
protected BeaconFrameBase(BeaconFrameBase other)
{
Payload = other.Payload;
}
/// <summary>
/// Update payload based on supplied other frame.
/// </summary>
/// <param name="otherFrame"></param>
public virtual void Update(BeaconFrameBase otherFrame)
{
Payload = otherFrame.Payload;
}
/// <summary>
/// Checks if the payload is valid.
/// Base implementation only checks if payload is not null.
/// </summary>
/// <returns></returns>
public virtual bool IsValid()
{
return Payload != null;
}
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
}
================================================
FILE: Library/UniversalBeacon.Library.Core/Entities/BeaconFrameHelper.cs
================================================
// Copyright 2015 - 2017 Andreas Jakl. All rights reserved.
// https://github.com/andijakl/universal-beacon
//
// Based on the Eddystone specification by Google,
// available under Apache License, Version 2.0 from
// https://github.com/google/eddystone
//
// 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.
using System;
namespace UniversalBeacon.Library.Core.Entities
{
public static class BeaconFrameHelper
{
/// <summary>
/// Number of bytes of the Eddystone header that is the same in all frame types.
/// * 2 bytes for 0xAA, 0xFE to identify Eddystone.
/// * 1 byte for the frame type.
/// </summary>
public const int EddystoneHeaderSize = 3;
/// <summary>
/// Frame types as defined by the Eddystone specification.
/// </summary>
public enum EddystoneFrameType : byte
{
UidFrameType = 0x00,
UrlFrameType = 0x10,
TelemetryFrameType = 0x20,
EidFrameType = 0x30
}
/// <summary>
/// Analyzes the payload of the Bluetooth Beacon frame and instantiates
/// the according specialized Bluetooth frame class.
/// Currently handles Eddystone frames.
/// </summary>
/// <param name="payload">New payload to analyze.</param>
/// <returns>Base class for Bluetooth frames, which is either a specialized
/// class or an UnknownBeaconFrame.</returns>
public static BeaconFrameBase CreateEddystoneBeaconFrame(this byte[] payload)
{
if (!payload.IsEddystoneFrameType()) return null;
switch (payload.GetEddystoneFrameType())
{
case EddystoneFrameType.UidFrameType:
return new UidEddystoneFrame(payload);
case EddystoneFrameType.UrlFrameType:
return new UrlEddystoneFrame(payload);
case EddystoneFrameType.TelemetryFrameType:
return new TlmEddystoneFrame(payload);
case EddystoneFrameType.EidFrameType:
return new EidEddystoneFrame(payload);
case null:
return null;
default:
return new UnknownBeaconFrame(payload);
}
}
/// <summary>
/// Analyzes the header of the payload to check if the frame is
/// a valid Eddystone frame.
/// It needs to start with 0xAA 0xFE and then as the third byte
/// have the Eddystone frame type according to the specification.
///
/// Does not analyze if the rest of the contents are valid
/// according to the specification - this task is up to the
/// spezialized handler classes.
/// </summary>
/// <param name="payload">Frame payload to analyze.</param>
/// <returns>True if this is an Eddystone frame, false if not.</returns>
public static bool IsEddystoneFrameType(this byte[] payload)
{
if (payload == null || payload.Length < 3) return false;
if (!(payload[0] == 0xAA && payload[1] == 0xFE)) return false;
var frameTypeByte = payload[2];
return Enum.IsDefined(typeof(EddystoneFrameType), frameTypeByte);
}
/// <summary>
/// Retrieve the Eddystone frame type for this frame.
/// </summary>
/// <param name="payload">Frame payload to analyze.</param>
/// <returns>The Eddystone frame type that has been determined.
/// If it is not a valid or known Eddystone frame type, returns null.</returns>
public static EddystoneFrameType? GetEddystoneFrameType(this byte[] payload)
{
if (!IsEddystoneFrameType(payload)) return null;
return (EddystoneFrameType)payload[2];
}
/// <summary>
/// Create the first three bytes of the Eddystone payload.
/// 0xAA 0xFE [Eddystone type].
/// </summary>
/// <param name="eddystoneType">Eddystone type to use for this frame.</param>
/// <returns>Byte array with the size of 3 containing the Eddystone frame header.</returns>
public static byte[] CreateEddystoneHeader(EddystoneFrameType eddystoneType)
{
return new byte[] {0xAA, 0xFE, (byte)eddystoneType};
}
/// <summary>
/// Check if the beacon information corresponds to the Proximity Beacon type (compatible to iBeacon).
/// </summary>
/// <param name="companyId">Company ID of the beacon advertisment to check.</param>
/// <param name="manufacturerData">Manufacturer data segment of the beacon advertisment to check.</param>
/// <returns>True if the supplied data indicates that this is Proximity Beacon (iBeacon) frame data.</returns>
public static bool IsProximityBeaconPayload(ushort companyId, byte[] manufacturerData)
{
return companyId == ProximityBeaconFrame.CompanyId &&
manufacturerData.Length >= 23 &&
manufacturerData[0] == ProximityBeaconFrame.DataType &&
manufacturerData[1] == ProximityBeaconFrame.DataLength;
}
}
}
================================================
FILE: Library/UniversalBeacon.Library.Core/Entities/BeaconManager.cs
================================================
// Copyright 2015 - 2017 Andreas Jakl. All rights reserved.
// https://github.com/andijakl/universal-beacon
//
// Based on the Eddystone specification by Google,
// available under Apache License, Version 2.0 from
// https://github.com/google/eddystone
//
// 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.
using System;
using System.Collections.ObjectModel;
using UniversalBeacon.Library.Core.Interfaces;
using UniversalBeacon.Library.Core.Interop;
namespace UniversalBeacon.Library.Core.Entities
{
/// <summary>
/// Manages multiple beacons and distributes received Bluetooth LE
/// Advertisements based on unique Bluetooth beacons.
///
/// Whenever your app gets a callback that it has received a new Bluetooth LE
/// advertisement, send it to the ReceivedAdvertisement() method of this class,
/// which will handle the data and either add a new Bluetooth beacon to the list
/// of beacons observed so far, or update a previously known beacon with the
/// new advertisement information.
/// </summary>
public class BeaconManager
{
/// <summary>
/// Event that is invoked whenever a new (unknown) beacon is discovered and added to the list
/// of known beacons (BluetoothBeacons).
/// To subscribe to updates of every single received Bluetooth advertisment packet,
/// subscribe to the OnAdvertisementPacketReceived event of the IBluetoothPacketProvider.
/// </summary>
public event EventHandler<Beacon> BeaconAdded;
/// <summary>
/// List of known beacons so far, which all have a unique Bluetooth MAC address
/// and can have multiple data frames.
/// </summary>
public ObservableCollection<Beacon> BluetoothBeacons { get; set; } = new ObservableCollection<Beacon>();
/// <summary>
/// Provider that emits events whenever new Bluetooth advertisement packets have been received.
/// </summary>
private readonly IBluetoothPacketProvider _provider;
/// <summary>
/// Optional action that is used to handle the received Bluetooth event, e.g., to handle it in a different
/// thread. Can be used to handle the added beacons on the UI thread, if these are received in a background thread.
/// </summary>
private readonly Action<Action> _invokeAction;
/// <summary>
/// Create new Beacon Manager based on the provider that is going to update the manager with
/// new received Bluetooth Packets.
/// </summary>
/// <param name="provider">Package provider that emits events whenever Bluetooth advertisement packets
/// have been received.</param>
/// <param name="invokeAction">Optional invoke action, e.g., to run the code to handle the received
/// event in a different thread.</param>
public BeaconManager(IBluetoothPacketProvider provider, Action<Action> invokeAction = null)
{
_provider = provider;
_provider.AdvertisementPacketReceived += OnAdvertisementPacketReceived;
_invokeAction = invokeAction;
}
/// <summary>
/// Relay the start event to the Blueooth packet provider.
/// </summary>
public void Start()
{
_provider.Start();
}
/// <summary>
/// Relay the stop event to the Blueooth packet provider.
/// </summary>
public void Stop()
{
_provider.Stop();
}
private void OnAdvertisementPacketReceived(object sender, BLEAdvertisementPacketArgs e)
{
if (_invokeAction != null)
{
_invokeAction(() => { ReceivedAdvertisement(e.Data); });
}
else
{
ReceivedAdvertisement(e.Data);
}
}
/// <summary>
/// Analyze the received Bluetooth LE advertisement, and either add a new unique
/// beacon to the list of known beacons, or update a previously known beacon
/// with the new information.
/// </summary>
/// <param name="btAdv">Bluetooth advertisement to parse, as received from
/// the Windows Bluetooth LE API.</param>
private void ReceivedAdvertisement(BLEAdvertisementPacket btAdv)
{
if (btAdv == null) return;
// Check if we already know this bluetooth address
foreach (var bluetoothBeacon in BluetoothBeacons)
{
if (bluetoothBeacon.BluetoothAddress == btAdv.BluetoothAddress)
{
// We already know this beacon
// Update / Add info to existing beacon
bluetoothBeacon.UpdateBeacon(btAdv);
return;
}
}
// Beacon was not yet known - add it to the list.
var newBeacon = new Beacon(btAdv);
BluetoothBeacons.Add(newBeacon);
BeaconAdded?.Invoke(this, newBeacon);
}
}
}
================================================
FILE: Library/UniversalBeacon.Library.Core/Entities/EidEddystoneFrame.cs
================================================
using System;
using System.IO;
using System.Linq;
namespace UniversalBeacon.Library.Core.Entities
{
/// <summary>
/// An Eddystone EID (encrypted ephemeral identifier) frame, according to the
/// Google specification at:
/// https://github.com/google/eddystone/tree/master/eddystone-eid
///
/// This implementation does not contain cryptography or key management.
/// It parses the Eddystone frame and the 8 byte Ephemeral Identifier out
/// of the beacon advertisment.
/// For more information on how to compute the EID, see:
/// https://github.com/google/eddystone/blob/master/eddystone-eid/eid-computation.md
/// </summary>
public class EidEddystoneFrame : BeaconFrameBase
{
private sbyte _rangingData;
/// <summary>
/// Tx power level - the received power level at 0 m, in dBm.
/// Values range from -100 to +20 dBM, with a resolution of 1 dBm.
/// Signed 8 bit integer according to:
/// https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.tx_power_level.xml
/// Conversion between sbyte and byte works at runtime with simple casting for variables.
/// In order to convert constants at compile time, you might need to run the conversion in
/// an unchecked() context. For example:
/// sbyte rangingData = unchecked((sbyte)0xEE);
/// According to the documentation, this corresponds to the dBm value of -18.
/// </summary>
public sbyte RangingData
{
get => _rangingData;
set
{
if (_rangingData == value) return;
_rangingData = value;
UpdatePayload();
OnPropertyChanged();
}
}
private const int EphemeralIdentifierLength = 8;
private byte[] _ephemeralIdentifier;
/// <summary>
/// 8-byte Ephemeral Identifier, used for cryptography.
/// For hints how to compute the EID, see:
/// https://github.com/google/eddystone/blob/master/eddystone-eid/eid-computation.md
/// </summary>
public byte[] EphemeralIdentifier
{
get => _ephemeralIdentifier;
set
{
if (_ephemeralIdentifier == value) return;
if (value == null || value.Length != EphemeralIdentifierLength)
{
_ephemeralIdentifier = null;
return;
}
if (_ephemeralIdentifier != null && _ephemeralIdentifier.SequenceEqual(value)) return;
_ephemeralIdentifier = new byte[value.Length];
Array.Copy(value, _ephemeralIdentifier, value.Length);
UpdatePayload();
OnPropertyChanged();
}
}
/// <summary>
/// Create new instance of the EID Eddystone frame based on the provided payload.
/// Parses the payload and initializes the instance.
/// </summary>
/// <param name="payload">Payload to parse for this frame type.</param>
public EidEddystoneFrame(byte[] payload) : base(payload)
{
ParsePayload();
}
/// <summary>
/// Create new EID Eddystone frame based on the provided data.
/// </summary>
/// <param name="rangingData">Ranging data (Tx power level) - see property documentation.</param>
/// <param name="ephemeralIdentifier">Ephemeral Identifier (8 bytes) - see property documentation.</param>
public EidEddystoneFrame(sbyte rangingData, byte[] ephemeralIdentifier)
{
_rangingData = rangingData;
if (ephemeralIdentifier != null && ephemeralIdentifier.Length == EphemeralIdentifierLength)
{
_ephemeralIdentifier = new byte[EphemeralIdentifierLength];
Array.Copy(ephemeralIdentifier, _ephemeralIdentifier, ephemeralIdentifier.Length);
}
UpdatePayload();
}
/// <summary>
/// Parse the current payload into the properties exposed by this class.
/// Has to be called if manually modifying the raw payload.
/// </summary>
public void ParsePayload()
{
if (!IsValid()) return;
// The Ranging Data is the Tx power in dBm emitted by the beacon at 0 meters.
// Note that this is different from other beacon protocol specifications that require the Tx power
// to be measured at 1 m.The value is an 8-bit integer as specified by the Tx Power Level Characteristic
// and ranges from -100 dBm to +20 dBm to a resolution of 1 dBm.
var newRangingData = (sbyte)Payload[BeaconFrameHelper.EddystoneHeaderSize];
if (newRangingData != RangingData)
{
_rangingData = newRangingData;
OnPropertyChanged(nameof(RangingData));
}
// 8-byte Ephemeral Identifier
var newEphemeralIdentifier = new byte[EphemeralIdentifierLength];
Array.Copy(Payload, BeaconFrameHelper.EddystoneHeaderSize + 1, newEphemeralIdentifier, 0, EphemeralIdentifierLength);
if (EphemeralIdentifier == null || !newEphemeralIdentifier.SequenceEqual(EphemeralIdentifier))
{
_ephemeralIdentifier = newEphemeralIdentifier;
OnPropertyChanged(nameof(EphemeralIdentifier));
}
//Debug.WriteLine("Eddystone EID Frame: Ranging data = "
// + RangingData + ", Ephemeral Identifier = " + BitConverter.ToString(InstanceId));
}
/// <summary>
/// Update the raw payload when properties have changed.
/// </summary>
private void UpdatePayload()
{
var header =
BeaconFrameHelper.CreateEddystoneHeader(BeaconFrameHelper.EddystoneFrameType.EidFrameType);
using (var ms = new MemoryStream())
{
// Frame header
ms.Write(header, 0, header.Length);
}
}
/// <summary>
/// Update the information stored in this frame with the information from the other frame.
/// Useful for example when binding the UI to beacon information, as this will emit
/// property changed notifications whenever a value changes - which would not be possible if
/// you would overwrite the whole frame.
/// </summary>
/// <param name="otherFrame">Frame to use as source for updating the information in this beacon
/// frame.</param>
public override void Update(BeaconFrameBase otherFrame)
{
base.Update(otherFrame);
ParsePayload();
}
/// <summary>
/// Check if the contents of this frame are generally valid.
/// Does not currently perform a deep analysis, but checks the header as well
/// as the frame length.
/// </summary>
/// <returns>True if the frame is a valid Eddystone EID frame.</returns>
public override bool IsValid()
{
if (!base.IsValid()) return false;
// 2 bytes ID: AA FE
// 1 byte frame type
if (!Payload.IsEddystoneFrameType()) return false;
// Check if the frame type is correct for EID
var eddystoneFrameType = Payload.GetEddystoneFrameType();
if (eddystoneFrameType == null || eddystoneFrameType !=
BeaconFrameHelper.EddystoneFrameType.EidFrameType) return false;
// 1 byte ranging data
// 8 bytes 8-byte Ephemeral Identifier
return true; // TODO: check, seems like EID frame can be longer (0-padding at the end) in practice.
// Payload.Length == BeaconFrameHelper.EddystoneHeaderSize + 9;
}
}
}
================================================
FILE: Library/UniversalBeacon.Library.Core/Entities/ProximityBeaconFrame.cs
================================================
// 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.
using System;
namespace UniversalBeacon.Library.Core.Entities
{
/// <summary>
/// Frame type for Proximity Beacon frames (compatible to iBeacon).
/// </summary>
public class ProximityBeaconFrame : BeaconFrameBase
{
public const ushort CompanyId = 0x004C;
public const byte DataType = 0x02;
public const byte DataLength = 0x15;
private Guid _uuid;
private ushort _major;
private ushort _minor;
private sbyte _txPower;
public ProximityBeaconFrame(byte[] payload)
: base(payload)
{
ParsePayload();
}
public string UuidAsString => Uuid.ToString("D");
public Guid Uuid
{
get => _uuid;
set
{
if (_uuid == value) return;
_uuid = value;
OnPropertyChanged();
OnPropertyChanged(nameof(UuidAsString));
}
}
public string MajorAsString => Major.ToString("x4");
public ushort Major
{
get => _major;
set
{
if (_major == value) return;
_major = value;
OnPropertyChanged();
OnPropertyChanged(nameof(MajorAsString));
}
}
public string MinorAsString => Minor.ToString("x4");
public ushort Minor
{
get => _minor;
set
{
if (_minor == value) return;
_minor = value;
OnPropertyChanged();
OnPropertyChanged(nameof(MinorAsString));
}
}
public sbyte TxPower
{
get => _txPower;
set
{
if (_txPower == value) return;
_txPower = value;
OnPropertyChanged();
}
}
private void ParsePayload()
{
var dataType = Payload[0];
var dataLength = Payload[1];
if (dataType != DataType || dataLength != DataLength)
throw new InvalidOperationException();
// need to swap to big-endian
var uuidBytes = new byte[16];
if (BitConverter.IsLittleEndian)
{
Array.ConstrainedCopy(Payload, 2, uuidBytes, 0, 16);
Array.Reverse(uuidBytes, 0, 4);
Array.Reverse(uuidBytes, 4, 2);
Array.Reverse(uuidBytes, 6, 2);
}
Uuid = new Guid(uuidBytes);
var majorBytes = new byte[2];
Array.ConstrainedCopy(Payload, 18, majorBytes, 0, 2);
if (BitConverter.IsLittleEndian)
Array.Reverse(majorBytes);
Major = BitConverter.ToUInt16(majorBytes,0);
var minorBytes = new byte[2];
Array.ConstrainedCopy(Payload, 20, minorBytes, 0, 2);
if (BitConverter.IsLittleEndian)
Array.Reverse(minorBytes);
Minor = BitConverter.ToUInt16(minorBytes, 0);
TxPower = (sbyte) Payload[22];
}
public override void Update(BeaconFrameBase otherFrame)
{
base.Update(otherFrame);
ParsePayload();
}
}
}
================================================
FILE: Library/UniversalBeacon.Library.Core/Entities/TlmEddystoneFrame.cs
================================================
// Copyright 2015 - 2017 Andreas Jakl. All rights reserved.
// https://github.com/andijakl/universal-beacon
//
// Based on the Eddystone specification by Google,
// available under Apache License, Version 2.0 from
// https://github.com/google/eddystone
//
// 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.
using System;
using System.IO;
namespace UniversalBeacon.Library.Core.Entities
{
/// <summary>
/// An Eddystone Telemetry frame, according to the Google Specification from
/// https://github.com/google/eddystone/tree/master/eddystone-tlm
/// </summary>
public class TlmEddystoneFrame : BeaconFrameBase
{
private byte _version;
private ushort _batteryInMilliV;
private float _temperatureInC;
private uint _advertisementFrameCount;
private uint _timeSincePowerUp;
/// <summary>
/// Version of the Eddystone Telemetry (TLM) frame.
/// Current and supported value is 0.
/// </summary>
public byte Version
{
get => _version;
set
{
if (_version == value) return;
_version = value;
UpdatePayload();
OnPropertyChanged();
}
}
/// <summary>
/// The current battery voltage in millivolts [mV].
/// If not supported (e.g., USB powerd beacon) = 0.
/// </summary>
public ushort BatteryInMilliV
{
get => _batteryInMilliV;
set
{
if (_batteryInMilliV == value) return;
_batteryInMilliV = value;
UpdatePayload();
OnPropertyChanged();
}
}
/// <summary>
/// Beacon temperature in degrees Celsius.
/// Note: does not have full float precision, not more than 2 decimal places.
/// If not supported, -128 °C.
/// </summary>
public float TemperatureInC
{
get => _temperatureInC;
set
{
if (Math.Abs(_temperatureInC - value) < 0.0001) return;
_temperatureInC = value;
UpdatePayload();
OnPropertyChanged();
}
}
/// <summary>
/// Running count of advertisement frames of all types emitted
/// by the beacon since the last power up / reboot.
/// </summary>
public uint AdvertisementFrameCount
{
get => _advertisementFrameCount;
set
{
if (_advertisementFrameCount == value) return;
_advertisementFrameCount = value;
UpdatePayload();
OnPropertyChanged();
}
}
/// <summary>
/// Time in 0.1 second resolution since the last beacon power up / reboot.
/// </summary>
public uint TimeSincePowerUp
{
get => _timeSincePowerUp;
set
{
if (_timeSincePowerUp == value) return;
_timeSincePowerUp = value;
UpdatePayload();
OnPropertyChanged();
}
}
public TlmEddystoneFrame(byte version, ushort batteryInMv, float temperatureInC,
uint advertisementFrameCount, uint timeSincePowerUp)
{
_version = version;
_batteryInMilliV = batteryInMv;
_temperatureInC = temperatureInC;
_advertisementFrameCount = advertisementFrameCount;
_timeSincePowerUp = timeSincePowerUp;
UpdatePayload();
}
/// <summary>
/// Create new instance of the TLM Eddystone frame based on the provided payload.
/// Parses the payload and initializes the instance.
/// </summary>
/// <param name="payload">Payload to parse for this frame type.</param>
public TlmEddystoneFrame(byte[] payload) : base(payload)
{
ParsePayload();
}
/// <summary>
/// Parse the current payload into the properties exposed by this class.
/// Has to be called if manually modifying the raw payload.
/// </summary>
public void ParsePayload()
{
using (var ms = new MemoryStream(Payload, false))
{
using (var reader = new BinaryReader(ms))
{
// Skip frame header
ms.Position = BeaconFrameHelper.EddystoneHeaderSize;
// At present the value must be 0x00
var newVersion = reader.ReadByte();
if (newVersion != Version)
{
_version = newVersion;
OnPropertyChanged(nameof(Version));
}
// Battery voltage is the current battery charge in millivolts, expressed as 1 mV per bit.
// If not supported (for example in a USB-powered beacon) the value should be zeroed.
var batteryBytes = reader.ReadBytes(2);
if (BitConverter.IsLittleEndian)
{
Array.Reverse(batteryBytes);
}
var newBatteryInMilliV = BitConverter.ToUInt16(batteryBytes, 0);
if (BatteryInMilliV != newBatteryInMilliV)
{
_batteryInMilliV = newBatteryInMilliV;
OnPropertyChanged(nameof(BatteryInMilliV));
}
// Beacon temperature is the temperature in degrees Celsius sensed by the beacon and
// expressed in a signed 8.8 fixed-point notation.
// If not supported the value should be set to 0x8000, -128 °C.
// use signed https://courses.cit.cornell.edu/ee476/Math/
// #define float2fix(a) ((int)((a)*256.0)) //Convert float to fix. a is a float
// #define fix2float(a) ((float)(a)/256.0) //Convert fix to float. a is an int
var temperatureBytes = reader.ReadBytes(2);
if (BitConverter.IsLittleEndian)
{
Array.Reverse(temperatureBytes);
}
var newTemperatureInC = BitConverter.ToInt16(temperatureBytes, 0) / (float)256.0;
if (Math.Abs(newTemperatureInC - TemperatureInC) > 0.0001 )
{
_temperatureInC = newTemperatureInC;
OnPropertyChanged(nameof(TemperatureInC));
}
// ADV_CNT is the running count of advertisement frames of all types
// emitted by the beacon since power-up or reboot, useful for monitoring
// performance metrics that scale per broadcast frame.
// If this value is reset (e.g.on reboot), the current time field must also be reset.
var advCntBytes = reader.ReadBytes(4);
if (BitConverter.IsLittleEndian)
{
Array.Reverse(advCntBytes);
}
var newAdvertisementFrameCount = BitConverter.ToUInt32(advCntBytes, 0);
if (newAdvertisementFrameCount != AdvertisementFrameCount)
{
_advertisementFrameCount = newAdvertisementFrameCount;
OnPropertyChanged(nameof(AdvertisementFrameCount));
}
// SEC_CNT is a 0.1 second resolution counter that represents time since beacon power -
// up or reboot. If this value is reset (e.g.on a reboot), the ADV count field must also be reset.
var secCntBytes = reader.ReadBytes(4);
if (BitConverter.IsLittleEndian)
{
Array.Reverse(secCntBytes);
}
var newTimeSincePowerUp = BitConverter.ToUInt32(secCntBytes, 0);
if (newTimeSincePowerUp != TimeSincePowerUp)
{
_timeSincePowerUp = newTimeSincePowerUp;
OnPropertyChanged(nameof(TimeSincePowerUp));
}
//Debug.WriteLine("Eddystone Tlm Frame: Version = "
// + Version + ", Battery = " + (BatteryInMilliV / 1000.0) + "V, Temperature = " + TemperatureInC
// + "°C, Frame count = " + AdvertisementFrameCount + ", Time since power up = " + TimeSincePowerUp);
}
}
}
/// <summary>
/// Update the raw payload when properties have changed.
/// </summary>
private void UpdatePayload()
{
var header = BeaconFrameHelper.CreateEddystoneHeader(BeaconFrameHelper.EddystoneFrameType.TelemetryFrameType);
using (var ms = new MemoryStream())
{
// Frame header
ms.Write(header, 0, header.Length);
// Version
ms.WriteByte(Version);
// Battery
var batBytes = BitConverter.GetBytes(BatteryInMilliV);
if (BitConverter.IsLittleEndian)
Array.Reverse(batBytes);
ms.Write(batBytes, 0, batBytes.Length);
// Temperature
// #define float2fix(a) ((int)((a)*256.0)) //Convert float to fix. a is a float
var temp = ((int)((TemperatureInC) * 256.0));
var tempBytes = BitConverter.GetBytes(temp);
if (BitConverter.IsLittleEndian)
Array.Reverse(tempBytes);
ms.Write(tempBytes, 2, 2);
// ADV_CNT
var advCntBytes = BitConverter.GetBytes(AdvertisementFrameCount);
if (BitConverter.IsLittleEndian)
Array.Reverse(advCntBytes);
ms.Write(advCntBytes, 0, 4);
// SEC_CNT
var secCntBytes = BitConverter.GetBytes(TimeSincePowerUp);
if (BitConverter.IsLittleEndian)
Array.Reverse(secCntBytes);
ms.Write(secCntBytes, 0, 4);
// Save to payload (to direct array to prevent re-parsing and a potential endless loop of updating and parsing)
_payload = ms.ToArray();
}
}
/// <summary>
/// Update the information stored in this frame with the information from the other frame.
/// Useful for example when binding the UI to beacon information, as this will emit
/// property changed notifications whenever a value changes - which would not be possible if
/// you would overwrite the whole frame.
/// </summary>
/// <param name="otherFrame">Frame to use as source for updating the information in this beacon
/// frame.</param>
public override void Update(BeaconFrameBase otherFrame)
{
base.Update(otherFrame);
ParsePayload();
}
/// <summary>
/// Check if the contents of this frame are generally valid.
/// Does not currently perform a deep analysis, but checks the header as well
/// as the frame length.
/// </summary>
/// <returns>True if the frame is a valid Eddystone TLM frame.</returns>
public override bool IsValid()
{
if (!base.IsValid()) return false;
// 2 bytes ID: AA FE
// 1 byte frame type
if (!Payload.IsEddystoneFrameType()) return false;
// Check if the frame type is correct for TLM
var eddystoneFrameType = Payload.GetEddystoneFrameType();
if (eddystoneFrameType == null || eddystoneFrameType !=
BeaconFrameHelper.EddystoneFrameType.TelemetryFrameType) return false;
// 1 byte version
// 2 bytes battery voltage
// 2 bytes beacon temperature
// 4 bytes adv_cnt (AdvertisementFrameCount)
// 4 bytes sec_cnt (TimeSincePowerUp)
return Payload.Length == BeaconFrameHelper.EddystoneHeaderSize + 13;
}
}
}
================================================
FILE: Library/UniversalBeacon.Library.Core/Entities/UidEddystoneFrame.cs
================================================
// Copyright 2015 - 2017 Andreas Jakl. All rights reserved.
// https://github.com/andijakl/universal-beacon
//
// Based on the Eddystone specification by Google,
// available under Apache License, Version 2.0 from
// https://github.com/google/eddystone
//
// 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.
using System;
using System.IO;
using System.Linq;
using System.Numerics;
namespace UniversalBeacon.Library.Core.Entities
{
/// <summary>
/// An Eddystone UID frame, according to the Google Specification from
/// https://github.com/google/eddystone/tree/master/eddystone-uid
/// </summary>
public class UidEddystoneFrame : BeaconFrameBase
{
private sbyte _rangingData;
/// <summary>
/// Tx power level - the received power level at 0 m, in dBm.
/// Values range from -100 to +20 dBM, with a resolution of 1 dBm.
/// Signed 8 bit integer according to:
/// https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.tx_power_level.xml
/// Conversion between sbyte and byte works at runtime with simple casting for variables.
/// In order to convert constants at compile time, you might need to run the conversion in
/// an unchecked() context. For example:
/// sbyte rangingData = unchecked((sbyte)0xEE);
/// According to the documentation, this corresponds to the dBm value of -18.
/// </summary>
public sbyte RangingData
{
get => _rangingData;
set
{
if (_rangingData == value) return;
_rangingData = value;
UpdatePayload();
OnPropertyChanged();
}
}
private byte[] _namespaceId;
/// <summary>
/// 10-byte namespace, intended to ensure ID uniqueness accross multiple
/// Eddystone implementers.
/// For hints how to construct the namespace ID, see:
/// https://github.com/google/eddystone/tree/master/eddystone-uid
/// </summary>
public byte[] NamespaceId
{
get => _namespaceId;
set
{
if (_namespaceId == value) return;
if (value == null)
{
_namespaceId = null;
return;
}
if (_namespaceId != null && _namespaceId.SequenceEqual(value)) return;
_namespaceId = new byte[value.Length];
Array.Copy(value, _namespaceId, value.Length);
UpdatePayload();
OnPropertyChanged();
OnPropertyChanged(nameof(NamespaceIdAsNumber));
}
}
/// <summary>
/// Interprets the namespace ID as number.
/// As it is 10 bytes, returned as BigInteger.
/// </summary>
public BigInteger NamespaceIdAsNumber => new BigInteger(NamespaceId.Reverse().ToArray());
private byte[] _instanceId;
/// <summary>
/// 6-byte instance ID of the specific beacon belonging to a certain
/// namespace.
/// The ID can be assigned by your app in any custom way.
/// </summary>
public byte[] InstanceId
{
get => _instanceId;
set
{
if (value == null)
{
_instanceId = null;
return;
}
if (_instanceId != null && _instanceId.SequenceEqual(value)) return;
_instanceId = new byte[value.Length];
Array.Copy(value, _instanceId, value.Length);
UpdatePayload();
OnPropertyChanged();
OnPropertyChanged(nameof(InstanceIdAsNumber));
}
}
/// <summary>
/// Return the instance ID as number.
/// </summary>
public ulong InstanceIdAsNumber
{
get
{
var tmpArray = (BitConverter.IsLittleEndian) ? InstanceId.Reverse().ToArray() : InstanceId;
var tst = new byte[8];
Array.Copy(tmpArray, 0, tst, 0, 6);
return BitConverter.ToUInt64(tst, 0);
}
}
/// <summary>
/// Create new UID Eddystone frame based on the provided data.
/// </summary>
/// <param name="rangingData">Ranging data (Tx power level) - see property documentation.</param>
/// <param name="namespaceId">Namespace ID - see property documentation.</param>
/// <param name="instanceId">Instance ID - see property documentation.</param>
public UidEddystoneFrame(sbyte rangingData, byte[] namespaceId, byte[] instanceId)
{
_rangingData = rangingData;
if (namespaceId != null && namespaceId.Length == 10)
{
_namespaceId = new byte[10];
Array.Copy(namespaceId, _namespaceId, namespaceId.Length);
}
if (instanceId != null && instanceId.Length == 6)
{
_instanceId = new byte[6];
Array.Copy(instanceId, _instanceId, instanceId.Length);
}
UpdatePayload();
}
/// <summary>
/// Create new instance of the UID Eddystone frame based on the provided payload.
/// Parses the payload and initializes the instance.
/// </summary>
/// <param name="payload">Payload to parse for this frame type.</param>
public UidEddystoneFrame(byte[] payload) : base(payload)
{
ParsePayload();
}
/// <summary>
/// Parse the current payload into the properties exposed by this class.
/// Has to be called if manually modifying the raw payload.
/// </summary>
public void ParsePayload()
{
if (!IsValid()) return;
// The Ranging Data is the Tx power in dBm emitted by the beacon at 0 meters.
// Note that this is different from other beacon protocol specifications that require the Tx power
// to be measured at 1 m.The value is an 8-bit integer as specified by the Tx Power Level Characteristic
// and ranges from -100 dBm to +20 dBm to a resolution of 1 dBm.
var newRangingData = (sbyte)Payload[BeaconFrameHelper.EddystoneHeaderSize];
if (newRangingData != RangingData)
{
_rangingData = newRangingData;
OnPropertyChanged(nameof(RangingData));
}
// Namespace ID
var newNamespaceId = new byte[10];
Array.Copy(Payload, BeaconFrameHelper.EddystoneHeaderSize + 1, newNamespaceId, 0, 10);
if (NamespaceId == null || !newNamespaceId.SequenceEqual(NamespaceId))
{
_namespaceId = newNamespaceId;
OnPropertyChanged(nameof(NamespaceId));
OnPropertyChanged(nameof(NamespaceIdAsNumber));
}
// Instance ID
var newInstanceId = new byte[6];
Array.Copy(Payload, BeaconFrameHelper.EddystoneHeaderSize + 11, newInstanceId, 0, 6);
if (InstanceId == null || !newInstanceId.SequenceEqual(InstanceId))
{
_instanceId = newInstanceId;
OnPropertyChanged(nameof(InstanceId));
OnPropertyChanged(nameof(InstanceIdAsNumber));
}
_instanceId = newInstanceId;
//Debug.WriteLine("Eddystone Uid Frame: Ranging data = "
// + RangingData + ", NS = " + BitConverter.ToString(NamespaceId) + ", Instance = " + BitConverter.ToString(InstanceId));
}
/// <summary>
/// Update the raw payload when properties have changed.
/// </summary>
private void UpdatePayload()
{
if (NamespaceId == null || NamespaceId.Length != 10 ||
InstanceId == null || InstanceId.Length != 6)
{
_payload = null;
return;
}
var header = BeaconFrameHelper.CreateEddystoneHeader(BeaconFrameHelper.EddystoneFrameType.UidFrameType);
using (var ms = new MemoryStream())
{
// Frame header
ms.Write(header, 0, header.Length);
// Ranging data
ms.WriteByte((byte)RangingData);
// Namespace ID
ms.Write(NamespaceId, 0, NamespaceId.Length);
// Instance ID
ms.Write(InstanceId, 0, InstanceId.Length);
// RFU (2 bytes, must be 0x00)
ms.WriteByte(0x00);
ms.WriteByte(0x00);
// Save to payload (to direct array to prevent re-parsing and a potential endless loop of updating and parsing)
_payload = ms.ToArray();
}
}
/// <summary>
/// Update the information stored in this frame with the information from the other frame.
/// Useful for example when binding the UI to beacon information, as this will emit
/// property changed notifications whenever a value changes - which would not be possible if
/// you would overwrite the whole frame.
/// </summary>
/// <param name="otherFrame">Frame to use as source for updating the information in this beacon
/// frame.</param>
public override void Update(BeaconFrameBase otherFrame)
{
base.Update(otherFrame);
ParsePayload();
}
/// <summary>
/// Check if the contents of this frame are generally valid.
/// Does not currently perform a deep analysis, but checks the header as well
/// as the frame length.
/// </summary>
/// <returns>True if the frame is a valid Eddystone UID frame.</returns>
public override bool IsValid()
{
if (!base.IsValid()) return false;
// 2 bytes ID: AA FE
// 1 byte frame type
if (!Payload.IsEddystoneFrameType()) return false;
// Check if the frame type is correct for UID
var eddystoneFrameType = Payload.GetEddystoneFrameType();
if (eddystoneFrameType == null || eddystoneFrameType !=
BeaconFrameHelper.EddystoneFrameType.UidFrameType) return false;
// 1 byte ranging data
// 10 bytes namespace id
// 6 bytes instance id
// 2 bytes RFU - have to be present according to specfication, but are
// sometimes omitted in practice
return Payload.Length == BeaconFrameHelper.EddystoneHeaderSize + 17 ||
Payload.Length == BeaconFrameHelper.EddystoneHeaderSize + 17 + 2;
}
}
}
================================================
FILE: Library/UniversalBeacon.Library.Core/Entities/UnknownBeaconFrame.cs
================================================
// Copyright 2015 - 2017 Andreas Jakl. All rights reserved.
// https://github.com/andijakl/universal-beacon
//
// Based on the Eddystone specification by Google,
// available under Apache License, Version 2.0 from
// https://github.com/google/eddystone
//
// 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.
namespace UniversalBeacon.Library.Core.Entities
{
/// <summary>
/// Generic beacon frame class for a frame not known to this library.
/// It provides access to the raw payload for other classes to analyze.
/// </summary>
public class UnknownBeaconFrame : BeaconFrameBase
{
/// <summary>
/// Construct a new instance of an unknown beacon frame.
/// Only stores the payload, does not do any further processing.
/// </summary>
/// <param name="payload">Payload to parse for this frame type.</param>
public UnknownBeaconFrame(byte[] payload) : base(payload)
{
}
}
}
================================================
FILE: Library/UniversalBeacon.Library.Core/Entities/UrlEddystoneFrame.cs
================================================
// Copyright 2015 - 2017 Andreas Jakl. All rights reserved.
// https://github.com/andijakl/universal-beacon
//
// Based on the Eddystone specification by Google,
// available under Apache License, Version 2.0 from
// https://github.com/google/eddystone
//
// 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.
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
namespace UniversalBeacon.Library.Core.Entities
{
/// <summary>
/// An Eddystone URL frame, according to the Google Specification from
/// https://github.com/google/eddystone/tree/master/eddystone-url
/// </summary>
public class UrlEddystoneFrame : BeaconFrameBase
{
private sbyte _rangingData;
/// <summary>
/// Tx power level - the received power level at 0 m, in dBm.
/// Values range from -100 to +20 dBM, with a resolution of 1 dBm.
/// Signed 8 bit integer according to:
/// https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.tx_power_level.xml
/// </summary>
public sbyte RangingData
{
get => _rangingData;
set
{
if (_rangingData == value) return;
_rangingData = value;
UpdatePayload();
OnPropertyChanged();
}
}
private string _completeUrl;
/// <summary>
/// The decoded complete URL contained in this advertisement frame.
/// </summary>
public string CompleteUrl
{
get => _completeUrl;
set
{
if (_completeUrl == value) return;
_completeUrl = value;
UpdatePayload();
OnPropertyChanged();
}
}
/// <summary>
/// The encoded URL may only contain graphic printable characters of the US-ASCII coded character set.
/// Other byte values contained in the URL that are found in this dictionary are expanded to the
/// complete URL, to save bytes in the overall encoded URL.
/// </summary>
private static readonly Dictionary<byte, string> UrlCodeDictionary = new Dictionary<byte, string>
{
{0, ".com/"},
{1, ".org/"},
{2, ".edu/"},
{3, ".net/"},
{4, ".info/"},
{5, ".biz/"},
{6, ".gov/"},
{7, ".com"},
{8, ".org"},
{9, ".edu"},
{10, ".net"},
{11, ".info"},
{12, ".biz"},
{13, ".gov"},
};
/// <summary>
/// The first byte of the URL data contains the URL scheme.
/// This byte is mandatory and only the four values contained in this dictionary
/// are currently allowed in the specification.
/// </summary>
private static readonly Dictionary<byte, string> UrlSchemeDictionary = new Dictionary<byte, string>
{
{0, "http://www."},
{1, "https://www."},
{2, "http://"},
{3, "https://"}
};
/// <summary>
/// Create new URL Eddystone frame based on the provided data.
/// </summary>
/// <param name="rangingData">Ranging data (Tx power level) - see property documentation.</param>
/// <param name="completeUrl">URL to use for the frame.</param>
public UrlEddystoneFrame(sbyte rangingData, string completeUrl)
{
_rangingData = rangingData;
_completeUrl = completeUrl;
UpdatePayload();
}
/// <summary>
/// Create new instance of the URL Eddystone frame based on the provided payload.
/// Parses the payload and initializes the instance.
/// </summary>
/// <param name="payload">Payload to parse for this frame type.</param>
public UrlEddystoneFrame(byte[] payload) : base(payload)
{
ParsePayload();
}
/// <summary>
/// Parse the current payload into the properties exposed by this class.
/// Has to be called if manually modifying the raw payload.
/// </summary>
public void ParsePayload()
{
if (!IsValid()) return;
// Ranging data
var newRangingData = (sbyte)Payload[BeaconFrameHelper.EddystoneHeaderSize];
if (newRangingData != RangingData)
{
_rangingData = newRangingData;
OnPropertyChanged(nameof(RangingData));
}
// URL Scheme prefix (1 byte)
var urlSchemePrefix = Payload[BeaconFrameHelper.EddystoneHeaderSize + 1];
// Decode complete URL
var newCompleteUrl = UrlSchemePrefixAsString(urlSchemePrefix) + DecodeUrl(Payload, BeaconFrameHelper.EddystoneHeaderSize + 2);
if (newCompleteUrl != CompleteUrl)
{
_completeUrl = newCompleteUrl;
OnPropertyChanged(nameof(CompleteUrl));
}
//Debug.WriteLine("Eddystone URL Frame: Url = " + CompleteUrl);
}
/// <summary>
/// Update the raw payload when properties have changed.
/// </summary>
private void UpdatePayload()
{
if (string.IsNullOrEmpty(CompleteUrl))
{
_payload = null;
return;
}
var urlSchemeByte = EncodeUrlScheme(CompleteUrl);
// Check if the URL starts with a valid header (only the defined ones are allowed)
if (urlSchemeByte == null)
{
_payload = null;
return;
}
var header = BeaconFrameHelper.CreateEddystoneHeader(BeaconFrameHelper.EddystoneFrameType.UrlFrameType);
using (var ms = new MemoryStream())
{
// Frame header
ms.Write(header, 0, header.Length);
// Ranging data
ms.WriteByte((byte)RangingData);
// URL scheme byte
ms.WriteByte((byte)urlSchemeByte);
// Encoded URL
EncodeUrlToStream(CompleteUrl, UrlSchemeDictionary[(byte) urlSchemeByte].Length, ms);
// Save to payload (to direct array to prevent re-parsing and a potential endless loop of updating and parsing)
_payload = ms.ToArray();
}
}
/// <summary>
/// Return the URL scheme (starting characters of the URL) as encoded byte.
/// Returns null if the scheme is not found in the definition, which is not
/// valid for the Eddystone URL format.
/// </summary>
/// <param name="url">URL to analyze.</param>
/// <returns>Byte to use for the encoded URL.</returns>
private static byte? EncodeUrlScheme(string url)
{
foreach (var curScheme in UrlSchemeDictionary)
{
if (url.StartsWith(curScheme.Value, StringComparison.OrdinalIgnoreCase))
{
return curScheme.Key;
}
}
return null;
}
/// <summary>
/// Parse the provided URL starting at the provided position
/// (after the URL scheme) and write the encoded data into the provided stream.
/// </summary>
/// <param name="url">URL to encode.</param>
/// <param name="pos">Start position in the URL string, after the URL scheme.</param>
/// <param name="ms">Memory stream to encode the data to.</param>
private void EncodeUrlToStream(string url, int pos, Stream ms)
{
// Encode the rest of the URL string
while(pos < url.Length)
{
var code = FindUrlCode(url.Substring(pos));
if (code == null)
{
// Didn't find URL code at this position
var curCharByte = Encoding.ASCII.GetBytes(new[] {url[pos]});
ms.Write(curCharByte, 0, curCharByte.Length);
pos++;
}
else
{
// Write URL code
ms.WriteByte((byte)code);
pos += UrlCodeDictionary[(byte) code].Length;
}
}
}
/// <summary>
/// Check the if the provided URL string starts with one of the
/// URL codes from the dictionary.
/// </summary>
/// <param name="url">URL where the beginning should be analyzed.</param>
/// <returns>Returns the encoded byte value if the beginning of the URL
/// string is present in the dictionary, or null if not.</returns>
private byte? FindUrlCode(string url)
{
var dictPos = -1;
var expansionLength = 0;
for (var i = 0; i < UrlCodeDictionary.Count; i++)
{
if (UrlCodeDictionary[(byte)i].Length > expansionLength)
{
if (url.StartsWith(UrlCodeDictionary[(byte)i]))
{
expansionLength = UrlCodeDictionary[(byte)i].Length;
dictPos = i;
}
}
}
if (dictPos >= 0)
return (byte)dictPos;
return null;
}
/// <summary>
/// Decode the provided URL into a normal string.
/// Does not decode the URL scheme, use the extra method for that.
/// </summary>
/// <param name="rawUrl">Raw encoded URL to expand into a standard string.</param>
/// <param name="startAtArrayPos">Start analyzing the byte array at this position
/// (after the scheme)</param>
/// <returns>Decoded URL.</returns>
private static string DecodeUrl(byte[] rawUrl, int startAtArrayPos)
{
if (rawUrl.Length < startAtArrayPos) return null;
var sb = new StringBuilder(rawUrl.Length);
for(var i = startAtArrayPos; i < rawUrl.Length; i++)
{
sb.Append(UrlCodeDictionary.ContainsKey(rawUrl[i])
? UrlCodeDictionary[rawUrl[i]]
: Encoding.UTF8.GetString(new[] { rawUrl[i] }));
}
return sb.ToString();
}
/// <summary>
/// Get the URL scheme as string for the specified scheme prefix byte.
/// </summary>
/// <param name="urlSchemePrefix">URL prefix byte to analyze.</param>
/// <returns>Decoded URL scheme as string.</returns>
public string UrlSchemePrefixAsString(byte urlSchemePrefix)
{
return UrlSchemeDictionary.ContainsKey(urlSchemePrefix) ? UrlSchemeDictionary[urlSchemePrefix] : null;
}
/// <summary>
/// Update the information stored in this frame with the information from the other frame.
/// Useful for example when binding the UI to beacon information, as this will emit
/// property changed notifications whenever a value changes - which would not be possible if
/// you would overwrite the whole frame.
/// </summary>
/// <param name="otherFrame">Frame to use as source for updating the information in this beacon
/// frame.</param>
public override void Update(BeaconFrameBase otherFrame)
{
base.Update(otherFrame);
ParsePayload();
}
/// <summary>
/// Check if the contents of this frame are generally valid.
/// Does not currently perform a deep analysis, but checks the header as well
/// as the frame length.
/// </summary>
/// <returns>True if the frame is a valid Eddystone URL frame.</returns>
public override bool IsValid()
{
if (!base.IsValid()) return false;
// 2 bytes ID: AA FE
// 1 byte frame type
if (!Payload.IsEddystoneFrameType()) return false;
// Check if the frame type is correct for URL
var eddystoneFrameType = Payload.GetEddystoneFrameType();
if (eddystoneFrameType == null || eddystoneFrameType !=
BeaconFrameHelper.EddystoneFrameType.UrlFrameType) return false;
// 1 byte ranging data
// 1 byte url scheme prefix
return Payload.Length >= BeaconFrameHelper.EddystoneHeaderSize + 2;
}
}
}
================================================
FILE: Library/UniversalBeacon.Library.Core/Interfaces/IBluetoothPacketProvider.cs
================================================
using System;
using UniversalBeacon.Library.Core.Interop;
namespace UniversalBeacon.Library.Core.Interfaces
{
public interface IBluetoothPacketProvider
{
/// <summary>
/// Event is invoked whenever a new Bluetooth LE Advertisment Packet has been received.
/// Usually handled directly by the library. If required, your app implementation can
/// also subscribe to get notified about events.
/// </summary>
event EventHandler<BLEAdvertisementPacketArgs> AdvertisementPacketReceived;
/// <summary>
/// Wrapper for the Bluetooth LE Watcher stopped event of the underlying OS.
/// Currently used by UWP platform and invoked whenever there has been an issue
/// starting the Bluetooth LE watcher or if an issue occured while watching for
/// beacons (e.g., if the user turned off Bluetooth while the app is running).
/// </summary>
event EventHandler<BTError> WatcherStopped;
/// <summary>
/// Start watching for Bluetooth beacons.
/// </summary>
void Start();
/// <summary>
/// Stop watching for Bluetooth beacons.
/// </summary>
void Stop();
}
}
================================================
FILE: Library/UniversalBeacon.Library.Core/Interop/BLEAdvertisement.cs
================================================
// Copyright 2015 - 2017 Chris Tacke. All rights reserved.
// https://github.com/andijakl/universal-beacon
//
// Based on the Eddystone specification by Google,
// available under Apache License, Version 2.0 from
// https://github.com/google/eddystone
//
// 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. using System;
using System;
using System.Collections.Generic;
namespace UniversalBeacon.Library.Core.Interop
{
public sealed class BLEAdvertisement
{
public string LocalName { get; set; }
public List<Guid> ServiceUuids { get; set; }
public List<BLEAdvertisementDataSection> DataSections { get; set; }
public List<BLEManufacturerData> ManufacturerData { get; set; }
public BLEAdvertisement()
{
ServiceUuids = new List<Guid>();
DataSections = new List<BLEAdvertisementDataSection>();
ManufacturerData = new List<BLEManufacturerData>();
}
}
}
================================================
FILE: Library/UniversalBeacon.Library.Core/Interop/BLEAdvertisementDataSection.cs
================================================
// Copyright 2015 - 2017 Chris Tacke. All rights reserved.
// https://github.com/andijakl/universal-beacon
//
// Based on the Eddystone specification by Google,
// available under Apache License, Version 2.0 from
// https://github.com/google/eddystone
//
// 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. using System;
using System;
namespace UniversalBeacon.Library.Core.Interop
{
public sealed class BLEAdvertisementDataSection : BLERecord
{
public ushort Manufacturer { get; private set; }
public byte[] Data { get; set; }
public byte DataType { get; set; }
public BLEAdvertisementDataSection()
: base(BLEPacketType.ServiceData)
{
}
public BLEAdvertisementDataSection(BLEPacketType packetType, byte[] data)
: base(packetType)
{
Manufacturer = BitConverter.ToUInt16(data, 0);
Data = new byte[data.Length];
Buffer.BlockCopy(data, 0, Data, 0, Data.Length);
// TODO:
// it's unclear to me where this comes from
// The WIndows API sets it for Eddystone packets, but I can't find it in any documentation
//DataType = 0x16;
}
}
}
================================================
FILE: Library/UniversalBeacon.Library.Core/Interop/BLEAdvertisementPacket.cs
================================================
// Copyright 2015 - 2017 Chris Tacke. All rights reserved.
// https://github.com/andijakl/universal-beacon
//
// Based on the Eddystone specification by Google,
// available under Apache License, Version 2.0 from
// https://github.com/google/eddystone
//
// 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. using System;
using System;
namespace UniversalBeacon.Library.Core.Interop
{
public class BLEAdvertisementPacket
{
public BLEAdvertisement Advertisement { get; set; }
public BLEAdvertisementType AdvertisementType { get; set; }
public ulong BluetoothAddress { get; set; }
public short RawSignalStrengthInDBm { get; set; }
public DateTimeOffset Timestamp { get; set; }
}
}
================================================
FILE: Library/UniversalBeacon.Library.Core/Interop/BLEAdvertisementPacketArgs.cs
================================================
// Copyright 2015 - 2017 Chris Tacke. All rights reserved.
// https://github.com/andijakl/universal-beacon
//
// Based on the Eddystone specification by Google,
// available under Apache License, Version 2.0 from
// https://github.com/google/eddystone
//
// 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. using System;
using System;
namespace UniversalBeacon.Library.Core.Interop
{
public class BLEAdvertisementPacketArgs : EventArgs
{
public BLEAdvertisementPacket Data { get; private set; }
public BLEAdvertisementPacketArgs(BLEAdvertisementPacket data)
{
Data = data;
}
}
}
================================================
FILE: Library/UniversalBeacon.Library.Core/Interop/BLEAdvertisementType.cs
================================================
// Copyright 2015 - 2017 Chris Tacke. All rights reserved.
// https://github.com/andijakl/universal-beacon
//
// Based on the Eddystone specification by Google,
// available under Apache License, Version 2.0 from
// https://github.com/google/eddystone
//
// 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. using System;
namespace UniversalBeacon.Library.Core.Interop
{
public enum BLEAdvertisementType
{
ConnectableUndirected = 0,
ConnectableDirected = 1,
ScannableUndirected = 2,
NonConnectableUndirected = 3,
ScanResponse = 4
}
}
================================================
FILE: Library/UniversalBeacon.Library.Core/Interop/BLEAdvertisementWatcherStatusCodes.cs
================================================
using System;
using System.Collections.Generic;
using System.Text;
namespace UniversalBeacon.Library.Core.Interop
{
/// <summary>
/// Possible status codes of the Bluetooth LE Advertisment Watcher.
/// Binary compatible to the UWP implementation.
/// </summary>
public enum BLEAdvertisementWatcherStatusCodes
{
//
// Summary:
// The initial status of the watcher.
Created = 0,
//
// Summary:
// The watcher is started.
Started = 1,
//
// Summary:
// The watcher stop command was issued.
Stopping = 2,
//
// Summary:
// The watcher is stopped.
Stopped = 3,
//
// Summary:
// An error occurred during transition or scanning that stopped the watcher due
// to an error.
Aborted = 4
}
}
================================================
FILE: Library/UniversalBeacon.Library.Core/Interop/BLEFlagRecord.cs
================================================
// Copyright 2015 - 2017 Chris Tacke. All rights reserved.
// https://github.com/andijakl/universal-beacon
//
// Based on the Eddystone specification by Google,
// available under Apache License, Version 2.0 from
// https://github.com/google/eddystone
//
// 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. using System;
namespace UniversalBeacon.Library.Core.Interop
{
public class BLEFlagRecord : BLERecord
{
public byte Flags { get; private set; }
public BLEFlagRecord(BLEPacketType packetType, byte flags)
: base(packetType)
{
Flags = flags;
}
}
}
================================================
FILE: Library/UniversalBeacon.Library.Core/Interop/BLEGenericRecord.cs
================================================
// Copyright 2015 - 2017 Chris Tacke. All rights reserved.
// https://github.com/andijakl/universal-beacon
//
// Based on the Eddystone specification by Google,
// available under Apache License, Version 2.0 from
// https://github.com/google/eddystone
//
// 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. using System;
namespace UniversalBeacon.Library.Core.Interop
{
public sealed class BLEGenericRecord : BLERecord
{
public byte[] RawData { get; private set; }
public BLEGenericRecord(BLEPacketType packetType, byte[] data)
: base(packetType)
{
RawData = data;
}
}
}
================================================
FILE: Library/UniversalBeacon.Library.Core/Interop/BLEManufacturerData.cs
================================================
// Copyright 2015 - 2017 Chris Tacke. All rights reserved.
// https://github.com/andijakl/universal-beacon
//
// Based on the Eddystone specification by Google,
// available under Apache License, Version 2.0 from
// https://github.com/google/eddystone
//
// 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. using System;
using System;
namespace UniversalBeacon.Library.Core.Interop
{
public sealed class BLEManufacturerData : BLERecord
{
public ushort CompanyId { get; set; }
public byte[] Data { get; set; }
public BLEManufacturerData(BLEPacketType packetType, byte[] data)
: base(packetType)
{
CompanyId = BitConverter.ToUInt16(data, 0);
Data = new byte[data.Length - 2];
Buffer.BlockCopy(data, 2, Data, 0, Data.Length);
}
public BLEManufacturerData()
: base(BLEPacketType.ManufacturerData)
{
}
}
}
================================================
FILE: Library/UniversalBeacon.Library.Core/Interop/BLENameRecord.cs
================================================
// Copyright 2015 - 2017 Chris Tacke. All rights reserved.
// https://github.com/andijakl/universal-beacon
//
// Based on the Eddystone specification by Google,
// available under Apache License, Version 2.0 from
// https://github.com/google/eddystone
//
// 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. using System;
using System.Text;
namespace UniversalBeacon.Library.Core.Interop
{
public class BLENameRecord : BLERecord
{
public BLENameRecord(BLEPacketType packetType, byte[] data)
: base(packetType)
{
Name = Encoding.ASCII.GetString(data);
}
public string Name { get; }
}
}
================================================
FILE: Library/UniversalBeacon.Library.Core/Interop/BLEPacketType.cs
================================================
// Copyright 2015 - 2017 Chris Tacke. All rights reserved.
// https://github.com/andijakl/universal-beacon
//
// Based on the Eddystone specification by Google,
// available under Apache License, Version 2.0 from
// https://github.com/google/eddystone
//
// 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. using System;
namespace UniversalBeacon.Library.Core.Interop
{
// https://www.bluetooth.com/specifications/assigned-numbers/generic-access-profile
public enum BLEPacketType
{
Invalid = 0x00,
Flags = 0x01,
LocalName = 0x09,
UUID16List = 0x03,
ServiceData = 0x16,
ManufacturerData = 0xff
}
}
================================================
FILE: Library/UniversalBeacon.Library.Core/Interop/BLERecord.cs
================================================
// Copyright 2015 - 2017 Chris Tacke. All rights reserved.
// https://github.com/andijakl/universal-beacon
//
// Based on the Eddystone specification by Google,
// available under Apache License, Version 2.0 from
// https://github.com/google/eddystone
//
// 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. using System;
namespace UniversalBeacon.Library.Core.Interop
{
public abstract class BLERecord
{
public BLEPacketType PacketType { get; set; }
protected BLERecord(BLEPacketType packetType)
{
PacketType = packetType;
}
}
}
================================================
FILE: Library/UniversalBeacon.Library.Core/Interop/BTError.cs
================================================
namespace UniversalBeacon.Library.Core.Interop
{
public class BTError
{
/// <summary>
/// Possible error codes for Bluetooth handling.
/// Binary compatible to the UWP implementation.
/// </summary>
public enum BluetoothError
{
//
// Summary:
// The operation was successfully completed or serviced.
Success = 0,
//
// Summary:
// The Bluetooth radio was not available. This error occurs when the Bluetooth radio
// has been turned off.
RadioNotAvailable = 1,
//
// Summary:
// The operation cannot be serviced because the necessary resources are currently
// in use.
ResourceInUse = 2,
//
// Summary:
// The operation cannot be completed because the remote device is not connected.
DeviceNotConnected = 3,
//
// Summary:
// An unexpected error has occurred.
OtherError = 4,
//
// Summary:
// The operation is disabled by policy.
DisabledByPolicy = 5,
//
// Summary:
// The operation is not supported on the current Bluetooth radio hardware.
NotSupported = 6,
//
// Summary:
// The operation is disabled by the user.
DisabledByUser = 7,
//
// Summary:
// The operation requires consent.
ConsentRequired = 8,
//
TransportNotSupported = 9
}
public BluetoothError BluetoothErrorCode { get; set; }
public BTError(BluetoothError btErrorCode)
{
BluetoothErrorCode = btErrorCode;
}
}
}
================================================
FILE: Library/UniversalBeacon.Library.Core/Interop/BTMember.cs
================================================
// Copyright 2015 - 2017 Chris Tacke. All rights reserved.
// https://github.com/andijakl/universal-beacon
//
// Based on the Eddystone specification by Google,
// available under Apache License, Version 2.0 from
// https://github.com/google/eddystone
//
// 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. using System;
namespace UniversalBeacon.Library.Core.Interop
{
// https://www.bluetooth.com/specifications/assigned-numbers/16-bit-uuids-for-members
public enum BTMember
{
Estimote = 0xFE9A,
GoogleEddystone = 0xFEAA
}
}
================================================
FILE: Library/UniversalBeacon.Library.Core/UniversalBeacon.Library.Core.csproj
================================================
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard1.3</TargetFramework>
<NeutralLanguage>en</NeutralLanguage>
<PackageId>UniversalBeaconLibrary</PackageId>
<Version>4.0.0</Version>
<Authors>Andreas Jakl, Chris Tacke</Authors>
<Company>Andreas Jakl, Chris Tacke</Company>
<Product>Universal Beacon Library</Product>
<Description>Provides support for several Bluetooth Beacon specifications. Manages received Bluetooth advertisements, clusters them into individual beacons and parses the advertisement payloads according to specifications including the Eddystone open Bluetooth beacon format from Google, as well as beacons comparable to the iBeacon / Proximity Beacon format by Apple.</Description>
<Copyright>Copyright 2015 - 2017 Andreas Jakl, Chris Tacke. All rights reserved.</Copyright>
<PackageLicenseUrl>https://github.com/andijakl/universal-beacon/blob/master/LICENSE</PackageLicenseUrl>
<PackageProjectUrl>https://github.com/andijakl/universal-beacon</PackageProjectUrl>
<PackageIconUrl>https://raw.githubusercontent.com/andijakl/universal-beacon/master/UniversalBeaconLibraryLogo.png</PackageIconUrl>
<RepositoryUrl>https://github.com/andijakl/universal-beacon</RepositoryUrl>
<PackageTags>bluetooth beacon beacons ibeacon eddystone altbeacon bluetoothle bluetoothsmart bluetooth le bluetooth smart ble proximity universal</PackageTags>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
</PropertyGroup>
</Project>
================================================
FILE: Library/UniversalBeacon.Library.UWP/PacketExtensions.cs
================================================
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Devices.Bluetooth.Advertisement;
using UniversalBeacon.Library.Core.Interop;
namespace UniversalBeacon.Library.UWP
{
internal static class PacketExtensions
{
/// <summary>
/// Convert the Windows specific Bluetooth LE advertisment data to the universal cross-platform structure
/// used by the Universal Beacon Library.
/// </summary>
/// <param name="args">Windows Bluetooth LE advertisment data to convert to cross-platform format.</param>
/// <returns>Packet data converted to cross-platform format.</returns>
public static BLEAdvertisementPacket ToUniversalBLEPacket(this BluetoothLEAdvertisementReceivedEventArgs args)
{
var packet = new BLEAdvertisementPacket
{
Timestamp = args.Timestamp,
BluetoothAddress = args.BluetoothAddress,
RawSignalStrengthInDBm = args.RawSignalStrengthInDBm,
AdvertisementType = (BLEAdvertisementType) args.AdvertisementType,
Advertisement = args.Advertisement.ToUniversalAdvertisement()
};
return packet;
}
/// <summary>
/// Convert the Windows specific Bluetooth LE advertisment to the universal cross-platform structure
/// used by the Universal Beacon Library.
/// </summary>
/// <param name="convertBleAdvertisment">Windows Bluetooth LE advertisment to convert to cross-platform format.</param>
/// <returns>Packet converted to cross-platform format.</returns>
public static BLEAdvertisement ToUniversalAdvertisement(this BluetoothLEAdvertisement convertBleAdvertisment)
{
if (convertBleAdvertisment == null) return null;
var result = new BLEAdvertisement
{
LocalName = convertBleAdvertisment.LocalName
};
result.ServiceUuids.AddRange(convertBleAdvertisment.ServiceUuids);
if (convertBleAdvertisment.DataSections != null)
{
foreach (var curDataSection in convertBleAdvertisment.DataSections)
{
var data = new BLEAdvertisementDataSection
{
DataType = curDataSection.DataType,
Data = curDataSection.Data.ToArray()
};
result.DataSections.Add(data);
}
}
if (convertBleAdvertisment.ManufacturerData != null)
{
foreach (var curManufacturerData in convertBleAdvertisment.ManufacturerData)
{
var data = new BLEManufacturerData
{
CompanyId = curManufacturerData.CompanyId,
Data = curManufacturerData.Data.ToArray()
};
result.ManufacturerData.Add(data);
}
}
return result;
}
}
}
================================================
FILE: Library/UniversalBeacon.Library.UWP/Properties/AssemblyInfo.cs
================================================
using System.Reflection;
using System.Runtime.CompilerServices;
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("UniversalBeacon.Library.UWP")]
[assembly: AssemblyDescription("Universal Bluetooth Beacon Library - Extension to interface Winows UWP APIs to the Cross Platform Implementation")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Andreas Jakl, Chris Tacke")]
[assembly: AssemblyProduct("UniversalBeacon.Library.UWP")]
[assembly: AssemblyCopyright("Copyright © 2017 Andreas Jakl, Chris Tacke")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.2.0.0")]
[assembly: AssemblyFileVersion("3.2.0.0")]
[assembly: ComVisible(false)]
================================================
FILE: Library/UniversalBeacon.Library.UWP/Properties/UniversalBeacon.Library.UWP.rd.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<!--
This file contains Runtime Directives, specifications about types your application accesses
through reflection and other dynamic code patterns. Runtime Directives are used to control the
.NET Native optimizer and ensure that it does not remove code accessed by your library. If your
library does not do any reflection, then you generally do not need to edit this file. However,
if your library reflects over types, especially types passed to it or derived from its types,
then you should write Runtime Directives.
The most common use of reflection in libraries is to discover information about types passed
to the library. Runtime Directives have three ways to express requirements on types passed to
your library.
1. Parameter, GenericParameter, TypeParameter, TypeEnumerableParameter
Use these directives to reflect over types passed as a parameter.
2. SubTypes
Use a SubTypes directive to reflect over types derived from another type.
3. AttributeImplies
Use an AttributeImplies directive to indicate that your library needs to reflect over
types or methods decorated with an attribute.
For more information on writing Runtime Directives for libraries, please visit
https://go.microsoft.com/fwlink/?LinkID=391919
-->
<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
<Library Name="UniversalBeacon.Library.UWP">
<!-- add directives for your library here -->
</Library>
</Directives>
================================================
FILE: Library/UniversalBeacon.Library.UWP/UniversalBeacon.Library.UWP.csproj
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{806D344B-4FFA-47BC-9417-2F7B26F20821}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>UniversalBeacon.Library.UWP</RootNamespace>
<AssemblyName>UniversalBeacon.Library.UWP</AssemblyName>
<DefaultLanguage>en-US</DefaultLanguage>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.16299.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.10586.0</TargetPlatformMinVersion>
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<PlatformTarget>x86</PlatformTarget>
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
<PlatformTarget>ARM</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\ARM\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>ARM</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
<PlatformTarget>ARM</PlatformTarget>
<OutputPath>bin\ARM\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>ARM</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<PlatformTarget>x64</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<PlatformTarget>x64</PlatformTarget>
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup>
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
</PropertyGroup>
<ItemGroup>
<Compile Include="PacketExtensions.cs" />
<Compile Include="WindowsBluetoothPacketProvider.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Properties\UniversalBeacon.Library.UWP.rd.xml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
<Version>6.0.8</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\UniversalBeacon.Library.Core\UniversalBeacon.Library.Core.csproj">
<Project>{83be2e56-2400-40a2-8d88-b5dae98213e1}</Project>
<Name>UniversalBeacon.Library.Core</Name>
</ProjectReference>
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '14.0' ">
<VisualStudioVersion>14.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
================================================
FILE: Library/UniversalBeacon.Library.UWP/WindowsBluetoothPacketProvider.cs
================================================
using System;
using Windows.Devices.Bluetooth.Advertisement;
using UniversalBeacon.Library.Core.Interfaces;
using UniversalBeacon.Library.Core.Interop;
namespace UniversalBeacon.Library.UWP
{
public class WindowsBluetoothPacketProvider : IBluetoothPacketProvider
{
public event EventHandler<BLEAdvertisementPacketArgs> AdvertisementPacketReceived;
public event EventHandler<BTError> WatcherStopped;
private readonly BluetoothLEAdvertisementWatcher _watcher;
private bool _running;
public WindowsBluetoothPacketProvider()
{
_watcher = new BluetoothLEAdvertisementWatcher
{
ScanningMode = BluetoothLEScanningMode.Active
};
}
/// <summary>
/// Gets the BluetoothLEAdvertisementWatcher used by the provider instance
/// </summary>
public BluetoothLEAdvertisementWatcher AdvertisementWatcher
gitextract_ntbw8kz2/ ├── .gitignore ├── LICENSE ├── LICENSE.GPL ├── Library/ │ ├── NuGetPackage.bat │ ├── NuGetPush.bat │ ├── UniversalBeacon.Library.Android/ │ │ ├── AndroidBluetoothPacketProvider.cs │ │ ├── BLEScanCallback.cs │ │ ├── PacketExtensions.cs │ │ ├── Properties/ │ │ │ └── AssemblyInfo.cs │ │ ├── RecordParser.cs │ │ ├── Resources/ │ │ │ ├── AboutResources.txt │ │ │ ├── Resource.Designer.cs │ │ │ └── Values/ │ │ │ └── Strings.xml │ │ └── UniversalBeacon.Library.Android.csproj │ ├── UniversalBeacon.Library.Cocoa/ │ │ ├── CocoaBluetoothCentralDelegate.cs │ │ ├── CocoaBluetoothPacketProvider.cs │ │ ├── UniversalBeacon.Library.Cocoa.projitems │ │ └── UniversalBeacon.Library.Cocoa.shproj │ ├── UniversalBeacon.Library.Core/ │ │ ├── Entities/ │ │ │ ├── Beacon.cs │ │ │ ├── BeaconException.cs │ │ │ ├── BeaconFrameBase.cs │ │ │ ├── BeaconFrameHelper.cs │ │ │ ├── BeaconManager.cs │ │ │ ├── EidEddystoneFrame.cs │ │ │ ├── ProximityBeaconFrame.cs │ │ │ ├── TlmEddystoneFrame.cs │ │ │ ├── UidEddystoneFrame.cs │ │ │ ├── UnknownBeaconFrame.cs │ │ │ └── UrlEddystoneFrame.cs │ │ ├── Interfaces/ │ │ │ └── IBluetoothPacketProvider.cs │ │ ├── Interop/ │ │ │ ├── BLEAdvertisement.cs │ │ │ ├── BLEAdvertisementDataSection.cs │ │ │ ├── BLEAdvertisementPacket.cs │ │ │ ├── BLEAdvertisementPacketArgs.cs │ │ │ ├── BLEAdvertisementType.cs │ │ │ ├── BLEAdvertisementWatcherStatusCodes.cs │ │ │ ├── BLEFlagRecord.cs │ │ │ ├── BLEGenericRecord.cs │ │ │ ├── BLEManufacturerData.cs │ │ │ ├── BLENameRecord.cs │ │ │ ├── BLEPacketType.cs │ │ │ ├── BLERecord.cs │ │ │ ├── BTError.cs │ │ │ └── BTMember.cs │ │ └── UniversalBeacon.Library.Core.csproj │ ├── UniversalBeacon.Library.UWP/ │ │ ├── PacketExtensions.cs │ │ ├── Properties/ │ │ │ ├── AssemblyInfo.cs │ │ │ └── UniversalBeacon.Library.UWP.rd.xml │ │ ├── UniversalBeacon.Library.UWP.csproj │ │ └── WindowsBluetoothPacketProvider.cs │ ├── UniversalBeacon.Library.iOS/ │ │ ├── Properties/ │ │ │ └── AssemblyInfo.cs │ │ ├── UniversalBeacon.Library.iOS.csproj │ │ └── iOSBluetoothPacketProvider.cs │ └── UniversalBeaconLibrary.nuspec ├── README.md ├── Samples/ │ ├── UniversalBeacon.Sample/ │ │ ├── UniversalBeacon.Sample/ │ │ │ ├── App.xaml │ │ │ ├── App.xaml.cs │ │ │ ├── FrameTemplateSelector.cs │ │ │ ├── Models/ │ │ │ │ └── BeaconService.cs │ │ │ ├── UniversalBeacon.Sample.csproj │ │ │ ├── ViewCells/ │ │ │ │ ├── EddystoneTLMViewCell.xaml │ │ │ │ ├── EddystoneTLMViewCell.xaml.cs │ │ │ │ ├── GenericViewCell.xaml │ │ │ │ └── GenericViewCell.xaml.cs │ │ │ ├── ViewModels/ │ │ │ │ └── HomeViewModel.cs │ │ │ └── Views/ │ │ │ ├── HomeView.xaml │ │ │ └── HomeView.xaml.cs │ │ ├── UniversalBeacon.Sample.Android/ │ │ │ ├── Assets/ │ │ │ │ └── AboutAssets.txt │ │ │ ├── Main.storyboard │ │ │ ├── MainActivity.cs │ │ │ ├── MainApplication.cs │ │ │ ├── Properties/ │ │ │ │ ├── AndroidManifest.xml │ │ │ │ └── AssemblyInfo.cs │ │ │ ├── Resources/ │ │ │ │ ├── AboutResources.txt │ │ │ │ ├── Resource.Designer.cs │ │ │ │ ├── layout/ │ │ │ │ │ ├── Tabbar.axml │ │ │ │ │ └── Toolbar.axml │ │ │ │ └── values/ │ │ │ │ └── styles.xml │ │ │ └── UniversalBeacon.Sample.Android.csproj │ │ ├── UniversalBeacon.Sample.UWP/ │ │ │ ├── App.xaml │ │ │ ├── App.xaml.cs │ │ │ ├── MainPage.xaml │ │ │ ├── MainPage.xaml.cs │ │ │ ├── Package.appxmanifest │ │ │ ├── Properties/ │ │ │ │ ├── AssemblyInfo.cs │ │ │ │ └── Default.rd.xml │ │ │ ├── UniversalBeacon.Sample.UWP.csproj │ │ │ ├── UniversalBeacon.Sample.UWP.nuget.targets │ │ │ └── project.lock.json │ │ └── UniversalBeacon.Sample.iOS/ │ │ ├── AppDelegate.cs │ │ ├── Entitlements.plist │ │ ├── Info.plist │ │ ├── Main.cs │ │ ├── Properties/ │ │ │ └── AssemblyInfo.cs │ │ ├── Resources/ │ │ │ └── LaunchScreen.storyboard │ │ ├── UniversalBeacon.Sample.iOS.csproj │ │ ├── iTunesArtwork │ │ ├── iTunesArtwork@2x │ │ └── packages.config │ └── WindowsBeacons/ │ ├── App.xaml │ ├── App.xaml.cs │ ├── ApplicationInsights.config │ ├── Converter/ │ │ ├── BeaconFrameTypeToTextConverter.cs │ │ ├── BeaconTypeToTextConverter.cs │ │ ├── IdToHexTextConverter.cs │ │ └── IntToGridLengthConverter.cs │ ├── FrameTemplateSelector.cs │ ├── MainPage.xaml │ ├── MainPage.xaml.cs │ ├── Package.appxmanifest │ ├── Properties/ │ │ ├── Annotations.cs │ │ ├── AssemblyInfo.cs │ │ └── Default.rd.xml │ ├── Service References/ │ │ └── Application Insights/ │ │ └── ConnectedService.json │ ├── Strings/ │ │ ├── de-DE/ │ │ │ └── Resources.resw │ │ ├── en-US/ │ │ │ └── Resources.resw │ │ ├── fr-FR/ │ │ │ └── Resources.resw │ │ ├── pt-BR/ │ │ │ └── Resources.resw │ │ ├── ru-RU/ │ │ │ └── Resources.resw │ │ └── zh-CN/ │ │ └── Resources.resw │ ├── WindowsBeacons.csproj │ ├── WindowsBeacons.nuget.targets │ └── _pkginfo.txt ├── UniversalBeacon.Library.sln ├── UniversalBeaconLibrary.sln.DotSettings └── WindowsBeacons.sln
SYMBOL INDEX (371 symbols across 58 files)
FILE: Library/UniversalBeacon.Library.Android/AndroidBluetoothPacketProvider.cs
class AndroidBluetoothPacketProvider (line 9) | public class AndroidBluetoothPacketProvider : Java.Lang.Object, IBluetoo...
method AndroidBluetoothPacketProvider (line 17) | public AndroidBluetoothPacketProvider(Context context)
method ScanCallback_OnAdvertisementPacketReceived (line 24) | private void ScanCallback_OnAdvertisementPacketReceived(object sender,...
method Start (line 29) | public void Start()
method Stop (line 35) | public void Stop()
FILE: Library/UniversalBeacon.Library.Android/BLEScanCallback.cs
class BLEScanCallback (line 9) | internal class BLEScanCallback : ScanCallback
method OnScanFailed (line 13) | public override void OnScanFailed([GeneratedEnum] ScanFailure errorCode)
method OnScanResult (line 18) | public override void OnScanResult([GeneratedEnum] ScanCallbackType cal...
FILE: Library/UniversalBeacon.Library.Android/PacketExtensions.cs
class PacketExtensions (line 5) | internal static class PacketExtensions
method ToNumericAddress (line 7) | public static ulong ToNumericAddress(this string addressString)
FILE: Library/UniversalBeacon.Library.Android/RecordParser.cs
class RecordParser (line 8) | internal class RecordParser
method Parse (line 10) | public static BLERecord[] Parse(byte[] recordData)
FILE: Library/UniversalBeacon.Library.Android/Resources/Resource.Designer.cs
class Resource (line 18) | [System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.T...
method Resource (line 22) | static Resource()
class Attribute (line 27) | public partial class Attribute
method Attribute (line 30) | static Attribute()
method Attribute (line 35) | private Attribute()
class String (line 40) | public partial class String
method String (line 49) | static String()
method String (line 54) | private String()
FILE: Library/UniversalBeacon.Library.Cocoa/CocoaBluetoothCentralDelegate.cs
class CocoaBluetoothCentralDelegate (line 10) | internal class CocoaBluetoothCentralDelegate : CBCentralManagerDelegate
method ConnectedPeripheral (line 16) | public override void ConnectedPeripheral(CBCentralManager central, CBP...
method DisconnectedPeripheral (line 21) | public override void DisconnectedPeripheral(CBCentralManager central, ...
method DiscoveredPeripheral (line 26) | public override void DiscoveredPeripheral(CBCentralManager central, CB...
method FailedToConnectPeripheral (line 78) | public override void FailedToConnectPeripheral(CBCentralManager centra...
method UpdatedState (line 83) | public override void UpdatedState(CBCentralManager central)
method WillRestoreState (line 112) | public override void WillRestoreState(CBCentralManager central, NSDict...
FILE: Library/UniversalBeacon.Library.Cocoa/CocoaBluetoothPacketProvider.cs
class CocoaBluetoothPacketProvider (line 10) | public class CocoaBluetoothPacketProvider : NSObject, IBluetoothPacketPr...
method CocoaBluetoothPacketProvider (line 18) | public CocoaBluetoothPacketProvider()
method ScanCallback_OnAdvertisementPacketReceived (line 26) | private void ScanCallback_OnAdvertisementPacketReceived(object sender,...
method Start (line 31) | public void Start()
method Stop (line 44) | public void Stop()
FILE: Library/UniversalBeacon.Library.Core/Entities/Beacon.cs
class Beacon (line 37) | public class Beacon : INotifyPropertyChanged
type BeaconTypeEnum (line 44) | public enum BeaconTypeEnum
method Beacon (line 143) | public Beacon(BLEAdvertisementPacket btAdv)
method Beacon (line 153) | public Beacon(BeaconTypeEnum beaconType)
method UpdateBeacon (line 165) | public void UpdateBeacon(BLEAdvertisementPacket btAdv)
method ParseEddystoneData (line 254) | private void ParseEddystoneData(BLEAdvertisementPacket btAdv)
method OnPropertyChanged (line 316) | protected virtual void OnPropertyChanged([CallerMemberName] string pro...
FILE: Library/UniversalBeacon.Library.Core/Entities/BeaconException.cs
class BeaconException (line 27) | public class BeaconException : Exception
method BeaconException (line 29) | public BeaconException() { }
method BeaconException (line 30) | public BeaconException(string message) : base(message) { }
method BeaconException (line 31) | public BeaconException(string message, Exception inner) : base(message...
FILE: Library/UniversalBeacon.Library.Core/Entities/BeaconFrameBase.cs
class BeaconFrameBase (line 33) | public abstract class BeaconFrameBase : INotifyPropertyChanged
method BeaconFrameBase (line 62) | protected BeaconFrameBase()
method BeaconFrameBase (line 67) | protected BeaconFrameBase(byte[] payload)
method BeaconFrameBase (line 72) | protected BeaconFrameBase(BeaconFrameBase other)
method Update (line 81) | public virtual void Update(BeaconFrameBase otherFrame)
method IsValid (line 91) | public virtual bool IsValid()
method OnPropertyChanged (line 98) | protected virtual void OnPropertyChanged([CallerMemberName] string pro...
FILE: Library/UniversalBeacon.Library.Core/Entities/BeaconFrameHelper.cs
class BeaconFrameHelper (line 24) | public static class BeaconFrameHelper
type EddystoneFrameType (line 36) | public enum EddystoneFrameType : byte
method CreateEddystoneBeaconFrame (line 52) | public static BeaconFrameBase CreateEddystoneBeaconFrame(this byte[] p...
method IsEddystoneFrameType (line 84) | public static bool IsEddystoneFrameType(this byte[] payload)
method GetEddystoneFrameType (line 100) | public static EddystoneFrameType? GetEddystoneFrameType(this byte[] pa...
method CreateEddystoneHeader (line 112) | public static byte[] CreateEddystoneHeader(EddystoneFrameType eddyston...
method IsProximityBeaconPayload (line 123) | public static bool IsProximityBeaconPayload(ushort companyId, byte[] m...
FILE: Library/UniversalBeacon.Library.Core/Entities/BeaconManager.cs
class BeaconManager (line 37) | public class BeaconManager
method BeaconManager (line 72) | public BeaconManager(IBluetoothPacketProvider provider, Action<Action>...
method Start (line 82) | public void Start()
method Stop (line 90) | public void Stop()
method OnAdvertisementPacketReceived (line 95) | private void OnAdvertisementPacketReceived(object sender, BLEAdvertise...
method ReceivedAdvertisement (line 114) | private void ReceivedAdvertisement(BLEAdvertisementPacket btAdv)
FILE: Library/UniversalBeacon.Library.Core/Entities/EidEddystoneFrame.cs
class EidEddystoneFrame (line 18) | public class EidEddystoneFrame : BeaconFrameBase
method EidEddystoneFrame (line 77) | public EidEddystoneFrame(byte[] payload) : base(payload)
method EidEddystoneFrame (line 87) | public EidEddystoneFrame(sbyte rangingData, byte[] ephemeralIdentifier)
method ParsePayload (line 102) | public void ParsePayload()
method UpdatePayload (line 133) | private void UpdatePayload()
method Update (line 152) | public override void Update(BeaconFrameBase otherFrame)
method IsValid (line 164) | public override bool IsValid()
FILE: Library/UniversalBeacon.Library.Core/Entities/ProximityBeaconFrame.cs
class ProximityBeaconFrame (line 20) | public class ProximityBeaconFrame : BeaconFrameBase
method ProximityBeaconFrame (line 31) | public ProximityBeaconFrame(byte[] payload)
method ParsePayload (line 90) | private void ParsePayload()
method Update (line 124) | public override void Update(BeaconFrameBase otherFrame)
FILE: Library/UniversalBeacon.Library.Core/Entities/TlmEddystoneFrame.cs
class TlmEddystoneFrame (line 29) | public class TlmEddystoneFrame : BeaconFrameBase
method TlmEddystoneFrame (line 117) | public TlmEddystoneFrame(byte version, ushort batteryInMv, float tempe...
method TlmEddystoneFrame (line 133) | public TlmEddystoneFrame(byte[] payload) : base(payload)
method ParsePayload (line 142) | public void ParsePayload()
method UpdatePayload (line 231) | private void UpdatePayload()
method Update (line 275) | public override void Update(BeaconFrameBase otherFrame)
method IsValid (line 287) | public override bool IsValid()
FILE: Library/UniversalBeacon.Library.Core/Entities/UidEddystoneFrame.cs
class UidEddystoneFrame (line 31) | public class UidEddystoneFrame : BeaconFrameBase
method UidEddystoneFrame (line 138) | public UidEddystoneFrame(sbyte rangingData, byte[] namespaceId, byte[]...
method UidEddystoneFrame (line 159) | public UidEddystoneFrame(byte[] payload) : base(payload)
method ParsePayload (line 168) | public void ParsePayload()
method UpdatePayload (line 211) | private void UpdatePayload()
method Update (line 247) | public override void Update(BeaconFrameBase otherFrame)
method IsValid (line 259) | public override bool IsValid()
FILE: Library/UniversalBeacon.Library.Core/Entities/UnknownBeaconFrame.cs
class UnknownBeaconFrame (line 26) | public class UnknownBeaconFrame : BeaconFrameBase
method UnknownBeaconFrame (line 33) | public UnknownBeaconFrame(byte[] payload) : base(payload)
FILE: Library/UniversalBeacon.Library.Core/Entities/UrlEddystoneFrame.cs
class UrlEddystoneFrame (line 31) | public class UrlEddystoneFrame : BeaconFrameBase
method UrlEddystoneFrame (line 110) | public UrlEddystoneFrame(sbyte rangingData, string completeUrl)
method UrlEddystoneFrame (line 122) | public UrlEddystoneFrame(byte[] payload) : base(payload)
method ParsePayload (line 131) | public void ParsePayload()
method UpdatePayload (line 160) | private void UpdatePayload()
method EncodeUrlScheme (line 198) | private static byte? EncodeUrlScheme(string url)
method EncodeUrlToStream (line 217) | private void EncodeUrlToStream(string url, int pos, Stream ms)
method FindUrlCode (line 246) | private byte? FindUrlCode(string url)
method DecodeUrl (line 276) | private static string DecodeUrl(byte[] rawUrl, int startAtArrayPos)
method UrlSchemePrefixAsString (line 294) | public string UrlSchemePrefixAsString(byte urlSchemePrefix)
method Update (line 307) | public override void Update(BeaconFrameBase otherFrame)
method IsValid (line 319) | public override bool IsValid()
FILE: Library/UniversalBeacon.Library.Core/Interfaces/IBluetoothPacketProvider.cs
type IBluetoothPacketProvider (line 6) | public interface IBluetoothPacketProvider
method Start (line 24) | void Start();
method Stop (line 28) | void Stop();
FILE: Library/UniversalBeacon.Library.Core/Interop/BLEAdvertisement.cs
class BLEAdvertisement (line 25) | public sealed class BLEAdvertisement
method BLEAdvertisement (line 32) | public BLEAdvertisement()
FILE: Library/UniversalBeacon.Library.Core/Interop/BLEAdvertisementDataSection.cs
class BLEAdvertisementDataSection (line 24) | public sealed class BLEAdvertisementDataSection : BLERecord
method BLEAdvertisementDataSection (line 31) | public BLEAdvertisementDataSection()
method BLEAdvertisementDataSection (line 36) | public BLEAdvertisementDataSection(BLEPacketType packetType, byte[] data)
FILE: Library/UniversalBeacon.Library.Core/Interop/BLEAdvertisementPacket.cs
class BLEAdvertisementPacket (line 24) | public class BLEAdvertisementPacket
FILE: Library/UniversalBeacon.Library.Core/Interop/BLEAdvertisementPacketArgs.cs
class BLEAdvertisementPacketArgs (line 25) | public class BLEAdvertisementPacketArgs : EventArgs
method BLEAdvertisementPacketArgs (line 29) | public BLEAdvertisementPacketArgs(BLEAdvertisementPacket data)
FILE: Library/UniversalBeacon.Library.Core/Interop/BLEAdvertisementType.cs
type BLEAdvertisementType (line 22) | public enum BLEAdvertisementType
FILE: Library/UniversalBeacon.Library.Core/Interop/BLEAdvertisementWatcherStatusCodes.cs
type BLEAdvertisementWatcherStatusCodes (line 11) | public enum BLEAdvertisementWatcherStatusCodes
FILE: Library/UniversalBeacon.Library.Core/Interop/BLEFlagRecord.cs
class BLEFlagRecord (line 22) | public class BLEFlagRecord : BLERecord
method BLEFlagRecord (line 26) | public BLEFlagRecord(BLEPacketType packetType, byte flags)
FILE: Library/UniversalBeacon.Library.Core/Interop/BLEGenericRecord.cs
class BLEGenericRecord (line 22) | public sealed class BLEGenericRecord : BLERecord
method BLEGenericRecord (line 26) | public BLEGenericRecord(BLEPacketType packetType, byte[] data)
FILE: Library/UniversalBeacon.Library.Core/Interop/BLEManufacturerData.cs
class BLEManufacturerData (line 24) | public sealed class BLEManufacturerData : BLERecord
method BLEManufacturerData (line 29) | public BLEManufacturerData(BLEPacketType packetType, byte[] data)
method BLEManufacturerData (line 37) | public BLEManufacturerData()
FILE: Library/UniversalBeacon.Library.Core/Interop/BLENameRecord.cs
class BLENameRecord (line 24) | public class BLENameRecord : BLERecord
method BLENameRecord (line 26) | public BLENameRecord(BLEPacketType packetType, byte[] data)
FILE: Library/UniversalBeacon.Library.Core/Interop/BLEPacketType.cs
type BLEPacketType (line 23) | public enum BLEPacketType
FILE: Library/UniversalBeacon.Library.Core/Interop/BLERecord.cs
class BLERecord (line 22) | public abstract class BLERecord
method BLERecord (line 26) | protected BLERecord(BLEPacketType packetType)
FILE: Library/UniversalBeacon.Library.Core/Interop/BTError.cs
class BTError (line 3) | public class BTError
type BluetoothError (line 9) | public enum BluetoothError
method BTError (line 56) | public BTError(BluetoothError btErrorCode)
FILE: Library/UniversalBeacon.Library.Core/Interop/BTMember.cs
type BTMember (line 23) | public enum BTMember
FILE: Library/UniversalBeacon.Library.UWP/PacketExtensions.cs
class PacketExtensions (line 7) | internal static class PacketExtensions
method ToUniversalBLEPacket (line 15) | public static BLEAdvertisementPacket ToUniversalBLEPacket(this Bluetoo...
method ToUniversalAdvertisement (line 35) | public static BLEAdvertisement ToUniversalAdvertisement(this Bluetooth...
FILE: Library/UniversalBeacon.Library.UWP/WindowsBluetoothPacketProvider.cs
class WindowsBluetoothPacketProvider (line 8) | public class WindowsBluetoothPacketProvider : IBluetoothPacketProvider
method WindowsBluetoothPacketProvider (line 16) | public WindowsBluetoothPacketProvider()
method WatcherOnReceived (line 45) | private void WatcherOnReceived(BluetoothLEAdvertisementWatcher sender,...
method Start (line 50) | public void Start()
method WatcherOnStopped (line 64) | private void WatcherOnStopped(BluetoothLEAdvertisementWatcher sender, ...
method Stop (line 69) | public void Stop()
FILE: Library/UniversalBeacon.Library.iOS/iOSBluetoothPacketProvider.cs
class iOSBluetoothPacketProvider (line 3) | public class iOSBluetoothPacketProvider : CocoaBluetoothPacketProvider { }
FILE: Samples/UniversalBeacon.Sample/UniversalBeacon.Sample.Android/MainActivity.cs
class MainActivity (line 13) | [Activity(Label = "Universal Beacon", Icon = "@drawable/icon", Theme = "...
method OnCreate (line 16) | protected override void OnCreate(Bundle bundle)
method OnRequestPermissionsResult (line 39) | public override void OnRequestPermissionsResult(int requestCode, strin...
FILE: Samples/UniversalBeacon.Sample/UniversalBeacon.Sample.Android/MainApplication.cs
class MainApplication (line 16) | #if DEBUG
method MainApplication (line 23) | public MainApplication(IntPtr handle, JniHandleOwnership transer)
method OnCreate (line 28) | public override void OnCreate()
FILE: Samples/UniversalBeacon.Sample/UniversalBeacon.Sample.Android/Resources/Resource.Designer.cs
class Resource (line 18) | [System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.T...
method Resource (line 22) | static Resource()
method UpdateIdValues (line 27) | public static void UpdateIdValues()
class Animation (line 34) | public partial class Animation
method Animation (line 85) | static Animation()
method Animation (line 90) | private Animation()
class Animator (line 95) | public partial class Animator
method Animator (line 101) | static Animator()
method Animator (line 106) | private Animator()
class Attribute (line 111) | public partial class Attribute
method Attribute (line 1137) | static Attribute()
method Attribute (line 1142) | private Attribute()
class Boolean (line 1147) | public partial class Boolean
method Boolean (line 1165) | static Boolean()
method Boolean (line 1170) | private Boolean()
class Color (line 1175) | public partial class Color
method Color (line 1475) | static Color()
method Color (line 1480) | private Color()
class Dimension (line 1485) | public partial class Dimension
method Dimension (line 1932) | static Dimension()
method Dimension (line 1937) | private Dimension()
class Drawable (line 1942) | public partial class Drawable
method Drawable (line 2773) | static Drawable()
method Drawable (line 2778) | private Drawable()
class Id (line 2783) | public partial class Id
method Id (line 3332) | static Id()
method Id (line 3337) | private Id()
class Integer (line 3342) | public partial class Integer
method Integer (line 3381) | static Integer()
method Integer (line 3386) | private Integer()
class Interpolator (line 3391) | public partial class Interpolator
method Interpolator (line 3400) | static Interpolator()
method Interpolator (line 3405) | private Interpolator()
class Layout (line 3410) | public partial class Layout
method Layout (line 3617) | static Layout()
method Layout (line 3622) | private Layout()
class String (line 3627) | public partial class String
method String (line 3822) | static String()
method String (line 3827) | private String()
class Style (line 3832) | public partial class Style
method Style (line 5023) | static Style()
method Style (line 5028) | private Style()
class Styleable (line 5033) | public partial class Styleable
method Styleable (line 7000) | static Styleable()
method Styleable (line 7005) | private Styleable()
FILE: Samples/UniversalBeacon.Sample/UniversalBeacon.Sample.UWP/App.xaml.cs
class App (line 26) | sealed partial class App : Application
method App (line 32) | public App()
method OnLaunched (line 43) | protected override void OnLaunched(LaunchActivatedEventArgs e)
method OnNavigationFailed (line 91) | void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
method OnSuspending (line 103) | private void OnSuspending(object sender, SuspendingEventArgs e)
FILE: Samples/UniversalBeacon.Sample/UniversalBeacon.Sample.UWP/MainPage.xaml.cs
class MainPage (line 18) | public sealed partial class MainPage
method MainPage (line 20) | public MainPage()
FILE: Samples/UniversalBeacon.Sample/UniversalBeacon.Sample.iOS/AppDelegate.cs
class AppDelegate (line 9) | [Register("AppDelegate")]
method FinishedLaunching (line 13) | public override bool FinishedLaunching(UIApplication app, NSDictionary...
FILE: Samples/UniversalBeacon.Sample/UniversalBeacon.Sample.iOS/Main.cs
class Application (line 5) | public class Application
method Main (line 8) | static void Main(string[] args)
FILE: Samples/UniversalBeacon.Sample/UniversalBeacon.Sample/App.xaml.cs
class App (line 6) | public partial class App : Application
method App (line 10) | public App()
method OnStart (line 19) | protected override async void OnStart()
method OnSleep (line 25) | protected override void OnSleep()
method OnResume (line 30) | protected override void OnResume()
FILE: Samples/UniversalBeacon.Sample/UniversalBeacon.Sample/FrameTemplateSelector.cs
class FrameTemplateSelector (line 7) | internal class FrameTemplateSelector : DataTemplateSelector
method FrameTemplateSelector (line 12) | public FrameTemplateSelector()
method OnSelectTemplate (line 18) | protected override DataTemplate OnSelectTemplate(object item, Bindable...
FILE: Samples/UniversalBeacon.Sample/UniversalBeacon.Sample/Models/BeaconService.cs
class BeaconService (line 11) | internal class BeaconService : IDisposable
method BeaconService (line 15) | public BeaconService()
method Dispose (line 31) | public void Dispose()
method _manager_BeaconAdded (line 39) | void _manager_BeaconAdded(object sender, Beacon e)
method Provider_AdvertisementPacketReceived (line 44) | void Provider_AdvertisementPacketReceived(object sender, UniversalBeac...
FILE: Samples/UniversalBeacon.Sample/UniversalBeacon.Sample/ViewCells/EddystoneTLMViewCell.xaml.cs
class EddystoneTLMViewCell (line 12) | [XamlCompilation(XamlCompilationOptions.Compile)]
method EddystoneTLMViewCell (line 15) | public EddystoneTLMViewCell ()
FILE: Samples/UniversalBeacon.Sample/UniversalBeacon.Sample/ViewCells/GenericViewCell.xaml.cs
class GenericViewCell (line 6) | [XamlCompilation(XamlCompilationOptions.Compile)]
method GenericViewCell (line 9) | public GenericViewCell ()
FILE: Samples/UniversalBeacon.Sample/UniversalBeacon.Sample/ViewModels/HomeViewModel.cs
class HomeViewModel (line 14) | public class HomeViewModel : INotifyPropertyChanged
method RequestPermissions (line 22) | public async Task RequestPermissions()
method RequestLocationPermission (line 27) | private async Task RequestLocationPermission()
method StartBeaconService (line 40) | private void StartBeaconService()
method Beacons_CollectionChanged (line 50) | private void Beacons_CollectionChanged(object sender, System.Collectio...
FILE: Samples/UniversalBeacon.Sample/UniversalBeacon.Sample/Views/HomeView.xaml.cs
class HomeView (line 8) | [XamlCompilation(XamlCompilationOptions.Compile)]
method HomeView (line 13) | public HomeView()
method Init (line 21) | public async Task Init()
FILE: Samples/WindowsBeacons/App.xaml.cs
class App (line 32) | sealed partial class App : Application
method App (line 38) | public App()
method OnLaunched (line 50) | protected override void OnLaunched(LaunchActivatedEventArgs e)
method OnNavigationFailed (line 97) | void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
method OnSuspending (line 109) | private void OnSuspending(object sender, SuspendingEventArgs e)
FILE: Samples/WindowsBeacons/Converter/BeaconFrameTypeToTextConverter.cs
class BeaconFrameTypeToTextConverter (line 24) | public class BeaconFrameTypeToTextConverter : IValueConverter
method Convert (line 26) | public object Convert(object value, Type targetType, object parameter,...
method ConvertBack (line 45) | public object ConvertBack(object value, Type targetType, object parame...
FILE: Samples/WindowsBeacons/Converter/BeaconTypeToTextConverter.cs
class BeaconTypeToTextConverter (line 23) | public class BeaconTypeToTextConverter : IValueConverter
method Convert (line 25) | public object Convert(object value, Type targetType, object parameter,...
method ConvertBack (line 45) | public object ConvertBack(object value, Type targetType, object parame...
FILE: Samples/WindowsBeacons/Converter/IdToHexTextConverter.cs
class IdToHexTextConverter (line 23) | public class IdToHexTextConverter : IValueConverter
method Convert (line 25) | public object Convert(object value, Type targetType, object parameter,...
method ConvertBack (line 42) | public object ConvertBack(object value, Type targetType, object parame...
FILE: Samples/WindowsBeacons/Converter/IntToGridLengthConverter.cs
class IntToGridLengthConverter (line 23) | public class IntToGridLengthConverter : IValueConverter
method Convert (line 25) | public object Convert(object value, Type targetType, object parameter,...
method ConvertBack (line 34) | public object ConvertBack(object value, Type targetType, object parame...
FILE: Samples/WindowsBeacons/FrameTemplateSelector.cs
class FrameTemplateSelector (line 23) | public class FrameTemplateSelector : DataTemplateSelector
method SelectTemplateCore (line 37) | protected override DataTemplate SelectTemplateCore(object item)
FILE: Samples/WindowsBeacons/MainPage.xaml.cs
class MainPage (line 39) | public sealed partial class MainPage : Page, INotifyPropertyChanged
method MainPage (line 73) | public MainPage()
method OnNavigatedTo (line 118) | protected override void OnNavigatedTo(NavigationEventArgs e)
method OnNavigatedFrom (line 132) | protected override void OnNavigatedFrom(NavigationEventArgs e)
method BeaconManagerOnBeaconAdded (line 153) | private void BeaconManagerOnBeaconAdded(object sender, Beacon beacon)
method WatcherOnStopped (line 200) | private void WatcherOnStopped(object sender, BTError btError)
method PrintBeaconInfoExample (line 252) | private void PrintBeaconInfoExample()
method SetStatusOutput (line 308) | private async void SetStatusOutput(string newStatus)
method AboutButton_Tapped (line 320) | private void AboutButton_Tapped(object sender, TappedRoutedEventArgs e)
method ClearButton_Tapped (line 325) | private void ClearButton_Tapped(object sender, RoutedEventArgs e)
method StatusMsgArea_Tapped (line 331) | private void StatusMsgArea_Tapped(object sender, TappedRoutedEventArgs e)
method OnPropertyChanged (line 339) | [NotifyPropertyChangedInvocator]
method HexStringToByteArray (line 352) | public static byte[] HexStringToByteArray(string hex)
FILE: Samples/WindowsBeacons/Properties/Annotations.cs
class CanBeNullAttribute (line 25) | [AttributeUsage(
class NotNullAttribute (line 38) | [AttributeUsage(
class ItemNotNullAttribute (line 46) | [AttributeUsage(
class ItemCanBeNullAttribute (line 54) | [AttributeUsage(
class StringFormatMethodAttribute (line 71) | [AttributeUsage(
method StringFormatMethodAttribute (line 79) | public StringFormatMethodAttribute(string formatParameterName)
class ValueProviderAttribute (line 91) | [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property |...
method ValueProviderAttribute (line 94) | public ValueProviderAttribute(string name)
class InvokerParameterNameAttribute (line 113) | [AttributeUsage(AttributeTargets.Parameter)]
class NotifyPropertyChangedInvocatorAttribute (line 152) | [AttributeUsage(AttributeTargets.Method)]
method NotifyPropertyChangedInvocatorAttribute (line 155) | public NotifyPropertyChangedInvocatorAttribute() { }
method NotifyPropertyChangedInvocatorAttribute (line 156) | public NotifyPropertyChangedInvocatorAttribute(string parameterName)
class ContractAnnotationAttribute (line 207) | [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
method ContractAnnotationAttribute (line 210) | public ContractAnnotationAttribute([NotNull] string contract)
method ContractAnnotationAttribute (line 213) | public ContractAnnotationAttribute([NotNull] string contract, bool for...
class LocalizationRequiredAttribute (line 232) | [AttributeUsage(AttributeTargets.All)]
method LocalizationRequiredAttribute (line 235) | public LocalizationRequiredAttribute() : this(true) { }
method LocalizationRequiredAttribute (line 236) | public LocalizationRequiredAttribute(bool required)
class CannotApplyEqualityOperatorAttribute (line 263) | [AttributeUsage(AttributeTargets.Interface | AttributeTargets.Class | At...
class BaseTypeRequiredAttribute (line 276) | [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
method BaseTypeRequiredAttribute (line 280) | public BaseTypeRequiredAttribute([NotNull] Type baseType)
class UsedImplicitlyAttribute (line 292) | [AttributeUsage(AttributeTargets.All)]
method UsedImplicitlyAttribute (line 295) | public UsedImplicitlyAttribute()
method UsedImplicitlyAttribute (line 298) | public UsedImplicitlyAttribute(ImplicitUseKindFlags useKindFlags)
method UsedImplicitlyAttribute (line 301) | public UsedImplicitlyAttribute(ImplicitUseTargetFlags targetFlags)
method UsedImplicitlyAttribute (line 304) | public UsedImplicitlyAttribute(ImplicitUseKindFlags useKindFlags, Impl...
class MeansImplicitUseAttribute (line 318) | [AttributeUsage(AttributeTargets.Class | AttributeTargets.GenericParamet...
method MeansImplicitUseAttribute (line 321) | public MeansImplicitUseAttribute()
method MeansImplicitUseAttribute (line 324) | public MeansImplicitUseAttribute(ImplicitUseKindFlags useKindFlags)
method MeansImplicitUseAttribute (line 327) | public MeansImplicitUseAttribute(ImplicitUseTargetFlags targetFlags)
method MeansImplicitUseAttribute (line 330) | public MeansImplicitUseAttribute(ImplicitUseKindFlags useKindFlags, Im...
type ImplicitUseKindFlags (line 340) | [Flags]
type ImplicitUseTargetFlags (line 361) | [Flags]
class PublicAPIAttribute (line 376) | [MeansImplicitUse(ImplicitUseTargetFlags.WithMembers)]
method PublicAPIAttribute (line 379) | public PublicAPIAttribute() { }
method PublicAPIAttribute (line 380) | public PublicAPIAttribute([NotNull] string comment)
class InstantHandleAttribute (line 393) | [AttributeUsage(AttributeTargets.Parameter)]
class PureAttribute (line 407) | [AttributeUsage(AttributeTargets.Method)]
class PathReferenceAttribute (line 414) | [AttributeUsage(AttributeTargets.Parameter)]
method PathReferenceAttribute (line 417) | public PathReferenceAttribute() { }
method PathReferenceAttribute (line 418) | public PathReferenceAttribute([PathReference] string basePath)
class SourceTemplateAttribute (line 449) | [AttributeUsage(AttributeTargets.Method)]
class MacroAttribute (line 480) | [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method, Al...
class AspMvcAreaMasterLocationFormatAttribute (line 506) | [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
method AspMvcAreaMasterLocationFormatAttribute (line 509) | public AspMvcAreaMasterLocationFormatAttribute(string format)
class AspMvcAreaPartialViewLocationFormatAttribute (line 517) | [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
method AspMvcAreaPartialViewLocationFormatAttribute (line 520) | public AspMvcAreaPartialViewLocationFormatAttribute(string format)
class AspMvcAreaViewLocationFormatAttribute (line 528) | [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
method AspMvcAreaViewLocationFormatAttribute (line 531) | public AspMvcAreaViewLocationFormatAttribute(string format)
class AspMvcMasterLocationFormatAttribute (line 539) | [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
method AspMvcMasterLocationFormatAttribute (line 542) | public AspMvcMasterLocationFormatAttribute(string format)
class AspMvcPartialViewLocationFormatAttribute (line 550) | [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
method AspMvcPartialViewLocationFormatAttribute (line 553) | public AspMvcPartialViewLocationFormatAttribute(string format)
class AspMvcViewLocationFormatAttribute (line 561) | [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
method AspMvcViewLocationFormatAttribute (line 564) | public AspMvcViewLocationFormatAttribute(string format)
class AspMvcActionAttribute (line 578) | [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)]
method AspMvcActionAttribute (line 581) | public AspMvcActionAttribute() { }
method AspMvcActionAttribute (line 582) | public AspMvcActionAttribute(string anonymousProperty)
class AspMvcAreaAttribute (line 595) | [AttributeUsage(AttributeTargets.Parameter)]
method AspMvcAreaAttribute (line 598) | public AspMvcAreaAttribute() { }
method AspMvcAreaAttribute (line 599) | public AspMvcAreaAttribute(string anonymousProperty)
class AspMvcControllerAttribute (line 613) | [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)]
method AspMvcControllerAttribute (line 616) | public AspMvcControllerAttribute() { }
method AspMvcControllerAttribute (line 617) | public AspMvcControllerAttribute(string anonymousProperty)
class AspMvcMasterAttribute (line 629) | [AttributeUsage(AttributeTargets.Parameter)]
class AspMvcModelTypeAttribute (line 636) | [AttributeUsage(AttributeTargets.Parameter)]
class AspMvcPartialViewAttribute (line 645) | [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)]
class AspMvcSupressViewErrorAttribute (line 651) | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]
class AspMvcDisplayTemplateAttribute (line 659) | [AttributeUsage(AttributeTargets.Parameter)]
class AspMvcEditorTemplateAttribute (line 667) | [AttributeUsage(AttributeTargets.Parameter)]
class AspMvcTemplateAttribute (line 675) | [AttributeUsage(AttributeTargets.Parameter)]
class AspMvcViewAttribute (line 684) | [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)]
class AspMvcActionSelectorAttribute (line 698) | [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property)]
class HtmlElementAttributesAttribute (line 701) | [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property |...
method HtmlElementAttributesAttribute (line 704) | public HtmlElementAttributesAttribute() { }
method HtmlElementAttributesAttribute (line 705) | public HtmlElementAttributesAttribute(string name)
class HtmlAttributeValueAttribute (line 713) | [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Field | At...
method HtmlAttributeValueAttribute (line 716) | public HtmlAttributeValueAttribute([NotNull] string name)
class RazorSectionAttribute (line 729) | [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)]
class CollectionAccessAttribute (line 735) | [AttributeUsage(AttributeTargets.Method)]
method CollectionAccessAttribute (line 738) | public CollectionAccessAttribute(CollectionAccessType collectionAccess...
type CollectionAccessType (line 746) | [Flags]
class AssertionMethodAttribute (line 764) | [AttributeUsage(AttributeTargets.Method)]
class AssertionConditionAttribute (line 772) | [AttributeUsage(AttributeTargets.Parameter)]
method AssertionConditionAttribute (line 775) | public AssertionConditionAttribute(AssertionConditionType conditionType)
type AssertionConditionType (line 787) | public enum AssertionConditionType
class TerminatesProgramAttribute (line 803) | [Obsolete("Use [ContractAnnotation('=> halt')] instead")]
class LinqTunnelAttribute (line 812) | [AttributeUsage(AttributeTargets.Method)]
class NoEnumerationAttribute (line 818) | [AttributeUsage(AttributeTargets.Parameter)]
class RegexPatternAttribute (line 824) | [AttributeUsage(AttributeTargets.Parameter)]
class XamlItemsControlAttribute (line 831) | [AttributeUsage(AttributeTargets.Class)]
class XamlItemBindingOfItemsControlAttribute (line 843) | [AttributeUsage(AttributeTargets.Property)]
class AspChildControlTypeAttribute (line 846) | [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
method AspChildControlTypeAttribute (line 849) | public AspChildControlTypeAttribute(string tagName, Type controlType)
class AspDataFieldAttribute (line 859) | [AttributeUsage(AttributeTargets.Property | AttributeTargets.Method)]
class AspDataFieldsAttribute (line 862) | [AttributeUsage(AttributeTargets.Property | AttributeTargets.Method)]
class AspMethodPropertyAttribute (line 865) | [AttributeUsage(AttributeTargets.Property)]
class AspRequiredAttributeAttribute (line 868) | [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
method AspRequiredAttributeAttribute (line 871) | public AspRequiredAttributeAttribute([NotNull] string attribute)
class AspTypePropertyAttribute (line 879) | [AttributeUsage(AttributeTargets.Property)]
method AspTypePropertyAttribute (line 884) | public AspTypePropertyAttribute(bool createConstructorReferences)
class RazorImportNamespaceAttribute (line 890) | [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
method RazorImportNamespaceAttribute (line 893) | public RazorImportNamespaceAttribute(string name)
class RazorInjectionAttribute (line 901) | [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
method RazorInjectionAttribute (line 904) | public RazorInjectionAttribute(string type, string fieldName)
class RazorHelperCommonAttribute (line 914) | [AttributeUsage(AttributeTargets.Method)]
class RazorLayoutAttribute (line 917) | [AttributeUsage(AttributeTargets.Property)]
class RazorWriteLiteralMethodAttribute (line 920) | [AttributeUsage(AttributeTargets.Method)]
class RazorWriteMethodAttribute (line 923) | [AttributeUsage(AttributeTargets.Method)]
class RazorWriteMethodParameterAttribute (line 926) | [AttributeUsage(AttributeTargets.Parameter)]
class NoReorder (line 935) | [AttributeUsage(AttributeTargets.All)]
Condensed preview — 126 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,881K chars).
[
{
"path": ".gitignore",
"chars": 3212,
"preview": "## Ignore Visual Studio temporary files, build results, and\n## files generated by popular Visual Studio add-ons.\n\n# User"
},
{
"path": "LICENSE",
"chars": 11358,
"preview": " Apache License\n Version 2.0, January 2004\n "
},
{
"path": "LICENSE.GPL",
"chars": 35147,
"preview": " GNU GENERAL PUBLIC LICENSE\n Version 3, 29 June 2007\n\n Copyright (C) 2007 Free "
},
{
"path": "Library/NuGetPackage.bat",
"chars": 354,
"preview": "@echo --------------------------------------------------------------------------\n@echo Remember to update the release no"
},
{
"path": "Library/NuGetPush.bat",
"chars": 99,
"preview": "nuget push .\\nupkg\\UniversalBeaconLibrary.3.2.0.nupkg -source https://www.nuget.org/api/v2/package\n"
},
{
"path": "Library/UniversalBeacon.Library.Android/AndroidBluetoothPacketProvider.cs",
"chars": 1420,
"preview": "using System;\nusing Android.Bluetooth;\nusing Android.Content;\nusing UniversalBeacon.Library.Core.Interfaces;\nusing Univ"
},
{
"path": "Library/UniversalBeacon.Library.Android/BLEScanCallback.cs",
"chars": 3238,
"preview": "using System;\nusing Android.Bluetooth;\nusing Android.Bluetooth.LE;\nusing Android.Runtime;\nusing UniversalBeacon.Library"
},
{
"path": "Library/UniversalBeacon.Library.Android/PacketExtensions.cs",
"chars": 663,
"preview": "using System;\n\nnamespace UniversalBeacon.Library\n{\n internal static class PacketExtensions\n {\n public stat"
},
{
"path": "Library/UniversalBeacon.Library.Android/Properties/AssemblyInfo.cs",
"chars": 1275,
"preview": "using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\nusing Android.App"
},
{
"path": "Library/UniversalBeacon.Library.Android/RecordParser.cs",
"chars": 4485,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing UniversalBeacon.Library.Core.Interop;\n\nnamespa"
},
{
"path": "Library/UniversalBeacon.Library.Android/Resources/AboutResources.txt",
"chars": 1693,
"preview": "Images, layout descriptions, binary blobs and string dictionaries can be included \nin your application as resource files"
},
{
"path": "Library/UniversalBeacon.Library.Android/Resources/Resource.Designer.cs",
"chars": 1369,
"preview": "#pragma warning disable 1591\n//------------------------------------------------------------------------------\n// <auto-g"
},
{
"path": "Library/UniversalBeacon.Library.Android/Resources/Values/Strings.xml",
"chars": 179,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <string name=\"Hello\">Hello World, Click Me!</string>\n <string "
},
{
"path": "Library/UniversalBeacon.Library.Android/UniversalBeacon.Library.Android.csproj",
"chars": 3215,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microso"
},
{
"path": "Library/UniversalBeacon.Library.Cocoa/CocoaBluetoothCentralDelegate.cs",
"chars": 5720,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing CoreBluetooth;\nusing Foundation;\nusing "
},
{
"path": "Library/UniversalBeacon.Library.Cocoa/CocoaBluetoothPacketProvider.cs",
"chars": 1936,
"preview": "using System;\nusing System.Diagnostics;\nusing CoreBluetooth;\nusing Foundation;\nusing UniversalBeacon.Library.Core.Inter"
},
{
"path": "Library/UniversalBeacon.Library.Cocoa/UniversalBeacon.Library.Cocoa.projitems",
"chars": 706,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n <Proper"
},
{
"path": "Library/UniversalBeacon.Library.Cocoa/UniversalBeacon.Library.Cocoa.shproj",
"chars": 962,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuil"
},
{
"path": "Library/UniversalBeacon.Library.Core/Entities/Beacon.cs",
"chars": 13576,
"preview": "// Copyright 2015 - 2017 Andreas Jakl. All rights reserved. \n// https://github.com/andijakl/universal-beacon \n// \n// Ba"
},
{
"path": "Library/UniversalBeacon.Library.Core/Entities/BeaconException.cs",
"chars": 1256,
"preview": "// Copyright 2015 - 2017 Andreas Jakl. All rights reserved. \n// https://github.com/andijakl/universal-beacon \n// \n// Ba"
},
{
"path": "Library/UniversalBeacon.Library.Core/Entities/BeaconFrameBase.cs",
"chars": 3489,
"preview": "// Copyright 2015 - 2017 Andreas Jakl. All rights reserved. \n// https://github.com/andijakl/universal-beacon \n// \n// Ba"
},
{
"path": "Library/UniversalBeacon.Library.Core/Entities/BeaconFrameHelper.cs",
"chars": 5764,
"preview": "// Copyright 2015 - 2017 Andreas Jakl. All rights reserved. \n// https://github.com/andijakl/universal-beacon \n// \n// Ba"
},
{
"path": "Library/UniversalBeacon.Library.Core/Entities/BeaconManager.cs",
"chars": 5603,
"preview": "// Copyright 2015 - 2017 Andreas Jakl. All rights reserved. \n// https://github.com/andijakl/universal-beacon \n// \n// Ba"
},
{
"path": "Library/UniversalBeacon.Library.Core/Entities/EidEddystoneFrame.cs",
"chars": 7975,
"preview": "using System;\nusing System.IO;\nusing System.Linq;\n\nnamespace UniversalBeacon.Library.Core.Entities\n{\n /// <summary>\n"
},
{
"path": "Library/UniversalBeacon.Library.Core/Entities/ProximityBeaconFrame.cs",
"chars": 3866,
"preview": "// Licensed under the Apache License, Version 2.0 (the \"License\"); \n// you may not use this file except in compliance w"
},
{
"path": "Library/UniversalBeacon.Library.Core/Entities/TlmEddystoneFrame.cs",
"chars": 12997,
"preview": "// Copyright 2015 - 2017 Andreas Jakl. All rights reserved. \n// https://github.com/andijakl/universal-beacon \n// \n// Ba"
},
{
"path": "Library/UniversalBeacon.Library.Core/Entities/UidEddystoneFrame.cs",
"chars": 11461,
"preview": "// Copyright 2015 - 2017 Andreas Jakl. All rights reserved. \n// https://github.com/andijakl/universal-beacon \n// \n// Ba"
},
{
"path": "Library/UniversalBeacon.Library.Core/Entities/UnknownBeaconFrame.cs",
"chars": 1481,
"preview": "// Copyright 2015 - 2017 Andreas Jakl. All rights reserved. \n// https://github.com/andijakl/universal-beacon \n// \n// Ba"
},
{
"path": "Library/UniversalBeacon.Library.Core/Entities/UrlEddystoneFrame.cs",
"chars": 13172,
"preview": "// Copyright 2015 - 2017 Andreas Jakl. All rights reserved. \n// https://github.com/andijakl/universal-beacon \n// \n// Ba"
},
{
"path": "Library/UniversalBeacon.Library.Core/Interfaces/IBluetoothPacketProvider.cs",
"chars": 1229,
"preview": "using System;\nusing UniversalBeacon.Library.Core.Interop;\n\nnamespace UniversalBeacon.Library.Core.Interfaces\n{ \n "
},
{
"path": "Library/UniversalBeacon.Library.Core/Interop/BLEAdvertisement.cs",
"chars": 1476,
"preview": "// Copyright 2015 - 2017 Chris Tacke. All rights reserved. \n// https://github.com/andijakl/universal-beacon \n// \n// Bas"
},
{
"path": "Library/UniversalBeacon.Library.Core/Interop/BLEAdvertisementDataSection.cs",
"chars": 1753,
"preview": "// Copyright 2015 - 2017 Chris Tacke. All rights reserved. \n// https://github.com/andijakl/universal-beacon \n// \n// Bas"
},
{
"path": "Library/UniversalBeacon.Library.Core/Interop/BLEAdvertisementPacket.cs",
"chars": 1255,
"preview": "// Copyright 2015 - 2017 Chris Tacke. All rights reserved. \n// https://github.com/andijakl/universal-beacon \n// \n// Bas"
},
{
"path": "Library/UniversalBeacon.Library.Core/Interop/BLEAdvertisementPacketArgs.cs",
"chars": 1161,
"preview": "// Copyright 2015 - 2017 Chris Tacke. All rights reserved. \n// https://github.com/andijakl/universal-beacon \n// \n// Bas"
},
{
"path": "Library/UniversalBeacon.Library.Core/Interop/BLEAdvertisementType.cs",
"chars": 1108,
"preview": "// Copyright 2015 - 2017 Chris Tacke. All rights reserved. \n// https://github.com/andijakl/universal-beacon \n// \n// Bas"
},
{
"path": "Library/UniversalBeacon.Library.Core/Interop/BLEAdvertisementWatcherStatusCodes.cs",
"chars": 905,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace UniversalBeacon.Library.Core.Interop\n{\n "
},
{
"path": "Library/UniversalBeacon.Library.Core/Interop/BLEFlagRecord.cs",
"chars": 1140,
"preview": "// Copyright 2015 - 2017 Chris Tacke. All rights reserved. \n// https://github.com/andijakl/universal-beacon \n// \n// Bas"
},
{
"path": "Library/UniversalBeacon.Library.Core/Interop/BLEGenericRecord.cs",
"chars": 1159,
"preview": "// Copyright 2015 - 2017 Chris Tacke. All rights reserved. \n// https://github.com/andijakl/universal-beacon \n// \n// Bas"
},
{
"path": "Library/UniversalBeacon.Library.Core/Interop/BLEManufacturerData.cs",
"chars": 1460,
"preview": "// Copyright 2015 - 2017 Chris Tacke. All rights reserved. \n// https://github.com/andijakl/universal-beacon \n// \n// Bas"
},
{
"path": "Library/UniversalBeacon.Library.Core/Interop/BLENameRecord.cs",
"chars": 1173,
"preview": "// Copyright 2015 - 2017 Chris Tacke. All rights reserved. \n// https://github.com/andijakl/universal-beacon \n// \n// Bas"
},
{
"path": "Library/UniversalBeacon.Library.Core/Interop/BLEPacketType.cs",
"chars": 1180,
"preview": "// Copyright 2015 - 2017 Chris Tacke. All rights reserved. \n// https://github.com/andijakl/universal-beacon \n// \n// Bas"
},
{
"path": "Library/UniversalBeacon.Library.Core/Interop/BLERecord.cs",
"chars": 1105,
"preview": "// Copyright 2015 - 2017 Chris Tacke. All rights reserved. \n// https://github.com/andijakl/universal-beacon \n// \n// Bas"
},
{
"path": "Library/UniversalBeacon.Library.Core/Interop/BTError.cs",
"chars": 1919,
"preview": "namespace UniversalBeacon.Library.Core.Interop\n{\n public class BTError\n {\n /// <summary>\n /// Possi"
},
{
"path": "Library/UniversalBeacon.Library.Core/Interop/BTMember.cs",
"chars": 1078,
"preview": "// Copyright 2015 - 2017 Chris Tacke. All rights reserved. \n// https://github.com/andijakl/universal-beacon \n// \n// Bas"
},
{
"path": "Library/UniversalBeacon.Library.Core/UniversalBeacon.Library.Core.csproj",
"chars": 1599,
"preview": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n <PropertyGroup>\n <TargetFramework>netstandard1.3</TargetFramework>\n <Neutral"
},
{
"path": "Library/UniversalBeacon.Library.UWP/PacketExtensions.cs",
"chars": 3081,
"preview": "using System.Runtime.InteropServices.WindowsRuntime;\nusing Windows.Devices.Bluetooth.Advertisement;\nusing UniversalBeac"
},
{
"path": "Library/UniversalBeacon.Library.UWP/Properties/AssemblyInfo.cs",
"chars": 1233,
"preview": "using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Infor"
},
{
"path": "Library/UniversalBeacon.Library.UWP/Properties/UniversalBeacon.Library.UWP.rd.xml",
"chars": 1558,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n This file contains Runtime Directives, specifications about types your a"
},
{
"path": "Library/UniversalBeacon.Library.UWP/UniversalBeacon.Library.UWP.csproj",
"chars": 6400,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microso"
},
{
"path": "Library/UniversalBeacon.Library.UWP/WindowsBluetoothPacketProvider.cs",
"chars": 2449,
"preview": "using System;\nusing Windows.Devices.Bluetooth.Advertisement;\nusing UniversalBeacon.Library.Core.Interfaces;\nusing Unive"
},
{
"path": "Library/UniversalBeacon.Library.iOS/Properties/AssemblyInfo.cs",
"chars": 1191,
"preview": "using System.Reflection;\nusing System.Runtime.CompilerServices;\n\n// Information about this assembly is defined by the f"
},
{
"path": "Library/UniversalBeacon.Library.iOS/UniversalBeacon.Library.iOS.csproj",
"chars": 3071,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microso"
},
{
"path": "Library/UniversalBeacon.Library.iOS/iOSBluetoothPacketProvider.cs",
"chars": 118,
"preview": "namespace UniversalBeacon.Library\n{\n public class iOSBluetoothPacketProvider : CocoaBluetoothPacketProvider { }\n}\n"
},
{
"path": "Library/UniversalBeaconLibrary.nuspec",
"chars": 3916,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<package xmlns=\"http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd\">\n <m"
},
{
"path": "README.md",
"chars": 13869,
"preview": "# Universal Bluetooth Beacon Library\n\nManage Bluetooth® Beacons through a cross-platform .NET Standard library. Get deta"
},
{
"path": "Samples/UniversalBeacon.Sample/UniversalBeacon.Sample/App.xaml",
"chars": 329,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<Application xmlns=\"http://xamarin.com/schemas/2014/forms\"\n xmlns:x"
},
{
"path": "Samples/UniversalBeacon.Sample/UniversalBeacon.Sample/App.xaml.cs",
"chars": 745,
"preview": "using UniversalBeacon.Sample.Views;\nusing Xamarin.Forms;\n\nnamespace UniversalBeacon.Sample\n{\n public partial class A"
},
{
"path": "Samples/UniversalBeacon.Sample/UniversalBeacon.Sample/FrameTemplateSelector.cs",
"chars": 873,
"preview": "using UniversalBeacon.Library.Core.Entities;\nusing UniversalBeacon.Sample.ViewCells;\nusing Xamarin.Forms;\n\nnamespace Un"
},
{
"path": "Samples/UniversalBeacon.Sample/UniversalBeacon.Sample/Models/BeaconService.cs",
"chars": 1636,
"preview": "using System;\nusing System.Collections.ObjectModel;\nusing System.Diagnostics;\nusing OpenNETCF.IoC;\nusing UniversalBeaco"
},
{
"path": "Samples/UniversalBeacon.Sample/UniversalBeacon.Sample/UniversalBeacon.Sample.csproj",
"chars": 2794,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project Sdk=\"Microsoft.NET.Sdk\">\n\n <PropertyGroup>\n <TargetFramework>"
},
{
"path": "Samples/UniversalBeacon.Sample/UniversalBeacon.Sample/ViewCells/EddystoneTLMViewCell.xaml",
"chars": 1435,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ViewCell xmlns=\"http://xamarin.com/schemas/2014/forms\" \n xmlns:x=\"h"
},
{
"path": "Samples/UniversalBeacon.Sample/UniversalBeacon.Sample/ViewCells/EddystoneTLMViewCell.xaml.cs",
"chars": 391,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nus"
},
{
"path": "Samples/UniversalBeacon.Sample/UniversalBeacon.Sample/ViewCells/GenericViewCell.xaml",
"chars": 651,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ViewCell xmlns=\"http://xamarin.com/schemas/2014/forms\" \n xmlns:x=\"h"
},
{
"path": "Samples/UniversalBeacon.Sample/UniversalBeacon.Sample/ViewCells/GenericViewCell.xaml.cs",
"chars": 264,
"preview": "using Xamarin.Forms;\nusing Xamarin.Forms.Xaml;\n\nnamespace UniversalBeacon.Sample.ViewCells\n{\n\t[XamlCompilation(XamlComp"
},
{
"path": "Samples/UniversalBeacon.Sample/UniversalBeacon.Sample/ViewModels/HomeViewModel.cs",
"chars": 2358,
"preview": "using OpenNETCF.IoC;\nusing System;\nusing System.Collections.ObjectModel;\nusing System.ComponentModel;\nusing System.Diag"
},
{
"path": "Samples/UniversalBeacon.Sample/UniversalBeacon.Sample/Views/HomeView.xaml",
"chars": 1453,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<ContentPage xmlns=\"http://xamarin.com/schemas/2014/forms\"\n xmlns:x="
},
{
"path": "Samples/UniversalBeacon.Sample/UniversalBeacon.Sample/Views/HomeView.xaml.cs",
"chars": 602,
"preview": "using System.Threading.Tasks;\nusing UniversalBeacon.Sample.ViewModels;\nusing Xamarin.Forms;\nusing Xamarin.Forms.Xaml;\n\n"
},
{
"path": "Samples/UniversalBeacon.Sample/UniversalBeacon.Sample.Android/Assets/AboutAssets.txt",
"chars": 603,
"preview": "Any raw assets you want to be deployed with your application can be placed in\nthis directory (and child directories) and"
},
{
"path": "Samples/UniversalBeacon.Sample/UniversalBeacon.Sample.Android/Main.storyboard",
"chars": 57961,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB"
},
{
"path": "Samples/UniversalBeacon.Sample/UniversalBeacon.Sample.Android/MainActivity.cs",
"chars": 1677,
"preview": "using Android.App;\nusing Android.Content.PM;\nusing Android.OS;\nusing Android.Support.V4.App;\nusing OpenNETCF.IoC;\nusing"
},
{
"path": "Samples/UniversalBeacon.Sample/UniversalBeacon.Sample.Android/MainApplication.cs",
"chars": 713,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nusing Android.App;\nusing Android"
},
{
"path": "Samples/UniversalBeacon.Sample/UniversalBeacon.Sample.Android/Properties/AndroidManifest.xml",
"chars": 758,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\" android:ins"
},
{
"path": "Samples/UniversalBeacon.Sample/UniversalBeacon.Sample.Android/Properties/AssemblyInfo.cs",
"chars": 1475,
"preview": "using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\nusing Android.App"
},
{
"path": "Samples/UniversalBeacon.Sample/UniversalBeacon.Sample.Android/Resources/AboutResources.txt",
"chars": 1772,
"preview": "Images, layout descriptions, binary blobs and string dictionaries can be included \nin your application as resource files"
},
{
"path": "Samples/UniversalBeacon.Sample/UniversalBeacon.Sample.Android/Resources/Resource.Designer.cs",
"chars": 223713,
"preview": "#pragma warning disable 1591\n//------------------------------------------------------------------------------\n// <auto-g"
},
{
"path": "Samples/UniversalBeacon.Sample/UniversalBeacon.Sample.Android/Resources/layout/Tabbar.axml",
"chars": 522,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<android.support.design.widget.TabLayout xmlns:android=\"http://schemas.android.co"
},
{
"path": "Samples/UniversalBeacon.Sample/UniversalBeacon.Sample.Android/Resources/layout/Toolbar.axml",
"chars": 383,
"preview": "<android.support.v7.widget.Toolbar\n xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:id=\"@+id/t"
},
{
"path": "Samples/UniversalBeacon.Sample/UniversalBeacon.Sample.Android/Resources/values/styles.xml",
"chars": 1404,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<resources>\n\n <style name=\"MainTheme\" parent=\"MainTheme.Base\">\n </style>\n <!-"
},
{
"path": "Samples/UniversalBeacon.Sample/UniversalBeacon.Sample.Android/UniversalBeacon.Sample.Android.csproj",
"chars": 5541,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microso"
},
{
"path": "Samples/UniversalBeacon.Sample/UniversalBeacon.Sample.UWP/App.xaml",
"chars": 283,
"preview": "<Application\n x:Class=\"UniversalBeacon.Sample.UWP.App\"\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/prese"
},
{
"path": "Samples/UniversalBeacon.Sample/UniversalBeacon.Sample.UWP/App.xaml.cs",
"chars": 4309,
"preview": "using OpenNETCF.IoC;\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.R"
},
{
"path": "Samples/UniversalBeacon.Sample/UniversalBeacon.Sample.UWP/MainPage.xaml",
"chars": 642,
"preview": "<forms:WindowsPage\n x:Class=\"UniversalBeacon.Sample.UWP.MainPage\"\n xmlns=\"http://schemas.microsoft.com/winfx/2006"
},
{
"path": "Samples/UniversalBeacon.Sample/UniversalBeacon.Sample.UWP/MainPage.xaml.cs",
"chars": 665,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Runtime.InteropService"
},
{
"path": "Samples/UniversalBeacon.Sample/UniversalBeacon.Sample.UWP/Package.appxmanifest",
"chars": 2090,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Package xmlns=\"http://schemas.microsoft.com/appx/manifest/foundation/windows10\""
},
{
"path": "Samples/UniversalBeacon.Sample/UniversalBeacon.Sample.UWP/Properties/AssemblyInfo.cs",
"chars": 1237,
"preview": "using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Infor"
},
{
"path": "Samples/UniversalBeacon.Sample/UniversalBeacon.Sample.UWP/Properties/Default.rd.xml",
"chars": 1241,
"preview": "<!--\n This file contains Runtime Directives used by .NET Native. The defaults here are suitable for most\n develope"
},
{
"path": "Samples/UniversalBeacon.Sample/UniversalBeacon.Sample.UWP/UniversalBeacon.Sample.UWP.csproj",
"chars": 10083,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"14.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.micros"
},
{
"path": "Samples/UniversalBeacon.Sample/UniversalBeacon.Sample.UWP/UniversalBeacon.Sample.UWP.nuget.targets",
"chars": 1598,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<Project ToolsVersion=\"14.0\" xmlns=\"http://schemas.microsoft.com"
},
{
"path": "Samples/UniversalBeacon.Sample/UniversalBeacon.Sample.UWP/project.lock.json",
"chars": 922661,
"preview": "{\n \"version\": 2,\n \"targets\": {\n \"UAP,Version=v10.0\": {\n \"Microsoft.CSharp/4.0.1\": {\n \"type\": \"package\","
},
{
"path": "Samples/UniversalBeacon.Sample/UniversalBeacon.Sample.iOS/AppDelegate.cs",
"chars": 854,
"preview": "using Foundation;\nusing OpenNETCF.IoC;\nusing UIKit;\nusing UniversalBeacon.Library;\nusing UniversalBeacon.Library.Core.I"
},
{
"path": "Samples/UniversalBeacon.Sample/UniversalBeacon.Sample.iOS/Entitlements.plist",
"chars": 191,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs"
},
{
"path": "Samples/UniversalBeacon.Sample/UniversalBeacon.Sample.iOS/Info.plist",
"chars": 1783,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
},
{
"path": "Samples/UniversalBeacon.Sample/UniversalBeacon.Sample.iOS/Main.cs",
"chars": 408,
"preview": "using UIKit;\n\nnamespace UniversalBeacon.Sample.iOS\n{\n public class Application\n {\n // This is the main ent"
},
{
"path": "Samples/UniversalBeacon.Sample/UniversalBeacon.Sample.iOS/Properties/AssemblyInfo.cs",
"chars": 1425,
"preview": "using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Infor"
},
{
"path": "Samples/UniversalBeacon.Sample/UniversalBeacon.Sample.iOS/Resources/LaunchScreen.storyboard",
"chars": 2767,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB\" version=\"3"
},
{
"path": "Samples/UniversalBeacon.Sample/UniversalBeacon.Sample.iOS/UniversalBeacon.Sample.iOS.csproj",
"chars": 8322,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microso"
},
{
"path": "Samples/UniversalBeacon.Sample/UniversalBeacon.Sample.iOS/packages.config",
"chars": 4461,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n <package id=\"Microsoft.NETCore.Platforms\" version=\"2.1.0\" targetFra"
},
{
"path": "Samples/WindowsBeacons/App.xaml",
"chars": 9879,
"preview": "<Application\n x:Class=\"WindowsBeacons.App\"\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n "
},
{
"path": "Samples/WindowsBeacons/App.xaml.cs",
"chars": 4647,
"preview": "// Copyright 2015 - 2017 Andreas Jakl. All rights reserved. \n// https://github.com/andijakl/universal-beacon \n// \n// Th"
},
{
"path": "Samples/WindowsBeacons/ApplicationInsights.config",
"chars": 131,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<ApplicationInsights>\n <InstrumentationKey></InstrumentationKey>\n</Applicati"
},
{
"path": "Samples/WindowsBeacons/Converter/BeaconFrameTypeToTextConverter.cs",
"chars": 2081,
"preview": "// Copyright 2015 - 2017 Andreas Jakl. All rights reserved. \n// https://github.com/andijakl/universal-beacon \n// \n// Th"
},
{
"path": "Samples/WindowsBeacons/Converter/BeaconTypeToTextConverter.cs",
"chars": 1875,
"preview": "// Copyright 2015 - 2017 Andreas Jakl. All rights reserved. \n// https://github.com/andijakl/universal-beacon \n// \n// Th"
},
{
"path": "Samples/WindowsBeacons/Converter/IdToHexTextConverter.cs",
"chars": 1605,
"preview": "// Copyright 2015 - 2017 Andreas Jakl. All rights reserved. \n// https://github.com/andijakl/universal-beacon \n// \n// Th"
},
{
"path": "Samples/WindowsBeacons/Converter/IntToGridLengthConverter.cs",
"chars": 1396,
"preview": "// Copyright 2015 - 2017 Andreas Jakl. All rights reserved. \n// https://github.com/andijakl/universal-beacon \n// \n// Th"
},
{
"path": "Samples/WindowsBeacons/FrameTemplateSelector.cs",
"chars": 2210,
"preview": "// Copyright 2015 - 2017 Andreas Jakl. All rights reserved. \n// https://github.com/andijakl/universal-beacon \n// \n// Th"
},
{
"path": "Samples/WindowsBeacons/MainPage.xaml",
"chars": 27293,
"preview": "<Page\n x:Class=\"WindowsBeacons.MainPage\"\n x:Name=\"MainPageItem\"\n xmlns=\"http://schemas.microsoft.com/winfx/200"
},
{
"path": "Samples/WindowsBeacons/MainPage.xaml.cs",
"chars": 17344,
"preview": "// Copyright 2015 - 2017 Andreas Jakl. All rights reserved.\n// https://github.com/andijakl/universal-beacon \n// \n// Thi"
},
{
"path": "Samples/WindowsBeacons/Package.appxmanifest",
"chars": 2086,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Package xmlns=\"http://schemas.microsoft.com/appx/manifest/foundation/windows10\""
},
{
"path": "Samples/WindowsBeacons/Properties/Annotations.cs",
"chars": 36115,
"preview": "using System;\n\n#pragma warning disable 1591\n// ReSharper disable UnusedMember.Global\n// ReSharper disable MemberCanBePr"
},
{
"path": "Samples/WindowsBeacons/Properties/AssemblyInfo.cs",
"chars": 1179,
"preview": "using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Infor"
},
{
"path": "Samples/WindowsBeacons/Properties/Default.rd.xml",
"chars": 1241,
"preview": "<!--\n This file contains Runtime Directives used by .NET Native. The defaults here are suitable for most\n develope"
},
{
"path": "Samples/WindowsBeacons/Service References/Application Insights/ConnectedService.json",
"chars": 212,
"preview": "{\n \"ProviderId\": \"Microsoft.ApplicationInsights.ConnectedService.ConnectedServiceProvider\",\n \"Version\": \"3.3.1.0\",\n "
},
{
"path": "Samples/WindowsBeacons/Strings/de-DE/Resources.resw",
"chars": 13450,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n <!-- \n Microsoft ResX Schema \n \n Version 2.0\n \n The prim"
},
{
"path": "Samples/WindowsBeacons/Strings/en-US/Resources.resw",
"chars": 13761,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n <!-- \n Microsoft ResX Schema \n \n Version 2.0\n \n The prim"
},
{
"path": "Samples/WindowsBeacons/Strings/fr-FR/Resources.resw",
"chars": 12231,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n <!-- \n Microsoft ResX Schema \n \n Version 2.0\n \n The prim"
},
{
"path": "Samples/WindowsBeacons/Strings/pt-BR/Resources.resw",
"chars": 12221,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n <!-- \n Microsoft ResX Schema \n \n Version 2.0\n \n The prim"
},
{
"path": "Samples/WindowsBeacons/Strings/ru-RU/Resources.resw",
"chars": 12342,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n <!-- \n Microsoft ResX Schema \n \n Version 2.0\n \n The prim"
},
{
"path": "Samples/WindowsBeacons/Strings/zh-CN/Resources.resw",
"chars": 10524,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n <!-- \n Microsoft ResX Schema \n \n Version 2.0\n \n The prim"
},
{
"path": "Samples/WindowsBeacons/WindowsBeacons.csproj",
"chars": 9508,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"14.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.micros"
},
{
"path": "Samples/WindowsBeacons/WindowsBeacons.nuget.targets",
"chars": 1466,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<Project ToolsVersion=\"14.0\" xmlns=\"http://schemas.microsoft.com"
},
{
"path": "Samples/WindowsBeacons/_pkginfo.txt",
"chars": 149,
"preview": "D:\\Source\\GitHub\\universal-beacon\\Samples\\WindowsBeacons\\bin\\ARM\\Release\\Upload\\WindowsBeacons_3.2.0.0\\WindowsBeacons_3."
},
{
"path": "UniversalBeacon.Library.sln",
"chars": 44564,
"preview": "\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 15\nVisualStudioVersion = 15.0.26730.10\nMin"
},
{
"path": "UniversalBeaconLibrary.sln.DotSettings",
"chars": 465,
"preview": "<wpf:ResourceDictionary xml:space=\"preserve\" xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" xmlns:s=\"clr-namesp"
},
{
"path": "WindowsBeacons.sln",
"chars": 5523,
"preview": "\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 15\nVisualStudioVersion = 15.0.26430.13\nMin"
}
]
// ... and 2 more files (download for full content)
About this extraction
This page contains the full source code of the andijakl/universal-beacon GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 126 files (1.7 MB), approximately 472.1k tokens, and a symbol index with 371 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.