Skip to content

Commit

Permalink
Add demo app
Browse files Browse the repository at this point in the history
  • Loading branch information
ljdk committed Jan 18, 2024
1 parent c70d612 commit a990c28
Show file tree
Hide file tree
Showing 39 changed files with 14,613 additions and 0 deletions.
Binary file added EstimoteUWB.xcframework.zip
Binary file not shown.
396 changes: 396 additions & 0 deletions uwbtestapp/uwbtestapp.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:">
</FileRef>
</Workspace>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"colors" : [
{
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
{
"images" : [
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "20x20"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "20x20"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "29x29"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "29x29"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "40x40"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "40x40"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "60x60"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "60x60"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "20x20"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "20x20"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "29x29"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "29x29"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "40x40"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "40x40"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "76x76"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "76x76"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "83.5x83.5"
},
{
"idiom" : "ios-marketing",
"scale" : "1x",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
6 changes: 6 additions & 0 deletions uwbtestapp/uwbtestapp/Assets.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
76 changes: 76 additions & 0 deletions uwbtestapp/uwbtestapp/ContentView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
//
// ContentView.swift
// uwbtestapp
//
// Created by DJ HAYDEN on 1/14/22.
//

import SwiftUI
import EstimoteUWB

struct ContentView: View {
let uwb = EstimoteUWBManagerExample()

var body: some View {
Text("Estimote UWB")
.padding()
}
}

struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}

class EstimoteUWBManagerExample: NSObject, ObservableObject {
private var uwbManager: EstimoteUWBManager?

override init() {
super.init()
setupUWB()
}

private func setupUWB() {
uwbManager = EstimoteUWBManager(delegate: self,
options: EstimoteUWBOptions(shouldHandleConnectivity: true,
isCameraAssisted: true))
uwbManager?.startScanning()
}
}

// REQUIRED PROTOCOL
extension EstimoteUWBManagerExample: EstimoteUWBManagerDelegate {
func didUpdatePosition(for device: EstimoteUWBDevice) {
print("Position updated for device: \(device)")
}

// OPTIONAL
func didDiscover(device: UWBIdentifiable, with rssi: NSNumber, from manager: EstimoteUWBManager) {
print("Discovered device: \(device.publicIdentifier) rssi: \(rssi)")
// if shouldHandleConnectivity is set to true - then you could call manager.connect(to: device)
// additionally you can globally call discoonect from the scope where you have inititated EstimoteUWBManager -> disconnect(from: device) or disconnect(from: publicId)
}

// OPTIONAL
func didConnect(to device: UWBIdentifiable) {
print("Successfully connected to: \(device.publicIdentifier)")
}

// OPTIONAL
func didDisconnect(from device: UWBIdentifiable, error: Error?) {
print("Disconnected from device: \(device.publicIdentifier)- error: \(String(describing: error))")
}

// OPTIONAL
func didFailToConnect(to device: UWBIdentifiable, error: Error?) {
print("Failed to conenct to: \(device.publicIdentifier) - error: \(String(describing: error))")
}

// OPTIONAL PROTOCOL FOR BEACON BLE RANGING
// func didRange(for beacon: EstimoteBLEDevice) {
// print("Beacon did range: \(beacon)")
// }
}


40 changes: 40 additions & 0 deletions uwbtestapp/uwbtestapp/EstimoteUWB.xcframework/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AvailableLibraries</key>
<array>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>EstimoteUWB.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>EstimoteUWB.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
</dict>
</array>
<key>CFBundlePackageType</key>
<string>XFWK</string>
<key>XCFrameworkFormatVersion</key>
<string>1.0</string>
</dict>
</plist>
Binary file not shown.
Loading

0 comments on commit a990c28

Please sign in to comment.