mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Additional file cleanup
This commit is contained in:
parent
f4e52d3799
commit
6559b2a9fd
10 changed files with 14 additions and 200 deletions
|
|
@ -31,7 +31,6 @@
|
|||
DDAF8C6926ED0D070058C060 /* deviceonly.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDAF8C6826ED0D070058C060 /* deviceonly.pb.swift */; };
|
||||
DDAF8C6B26ED0DD80058C060 /* environmental_measurement.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDAF8C6A26ED0DD80058C060 /* environmental_measurement.pb.swift */; };
|
||||
DDAF8C6E26ED19040058C060 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDAF8C6D26ED19040058C060 /* Extensions.swift */; };
|
||||
DDAF8C7026ED1DD20058C060 /* Device2.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDAF8C6F26ED1DD20058C060 /* Device2.swift */; };
|
||||
DDC2E15826CE248E0042C5E4 /* MeshtasticClientApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDC2E15726CE248E0042C5E4 /* MeshtasticClientApp.swift */; };
|
||||
DDC2E15C26CE248F0042C5E4 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DDC2E15B26CE248F0042C5E4 /* Assets.xcassets */; };
|
||||
DDC2E15F26CE248F0042C5E4 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DDC2E15E26CE248F0042C5E4 /* Preview Assets.xcassets */; };
|
||||
|
|
@ -41,8 +40,6 @@
|
|||
DDC2E19126CE26290042C5E4 /* Messages.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDC2E19026CE26290042C5E4 /* Messages.swift */; };
|
||||
DDC2E19B26CE27150042C5E4 /* CircleImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDC2E19A26CE27150042C5E4 /* CircleImage.swift */; };
|
||||
DDC2E19D26CE27580042C5E4 /* ModelData.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDC2E19C26CE27580042C5E4 /* ModelData.swift */; };
|
||||
DDC2E19F26CE27630042C5E4 /* Device.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDC2E19E26CE27630042C5E4 /* Device.swift */; };
|
||||
DDC2E1A226CE29AC0042C5E4 /* deviceData.json in Resources */ = {isa = PBXBuildFile; fileRef = DDC2E18A26CE25690042C5E4 /* deviceData.json */; };
|
||||
DDC2E1A426CE2F940042C5E4 /* DeviceBLE.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDC2E1A326CE2F940042C5E4 /* DeviceBLE.swift */; };
|
||||
DDC2E1A726CEB3400042C5E4 /* LocationHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDC2E1A626CEB3400042C5E4 /* LocationHelper.swift */; };
|
||||
DDC2E1AB26DD89EC0042C5E4 /* packets.json in Resources */ = {isa = PBXBuildFile; fileRef = DDC2E1AA26DD89EC0042C5E4 /* packets.json */; };
|
||||
|
|
@ -91,7 +88,6 @@
|
|||
DDAF8C6826ED0D070058C060 /* deviceonly.pb.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = deviceonly.pb.swift; sourceTree = "<group>"; };
|
||||
DDAF8C6A26ED0DD80058C060 /* environmental_measurement.pb.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = environmental_measurement.pb.swift; sourceTree = "<group>"; };
|
||||
DDAF8C6D26ED19040058C060 /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = "<group>"; };
|
||||
DDAF8C6F26ED1DD20058C060 /* Device2.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Device2.swift; sourceTree = "<group>"; };
|
||||
DDAF8C7126ED2AD80058C060 /* nodeInfo.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = nodeInfo.json; sourceTree = "<group>"; };
|
||||
DDC2E15426CE248E0042C5E4 /* MeshtasticClient.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MeshtasticClient.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
DDC2E15726CE248E0042C5E4 /* MeshtasticClientApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MeshtasticClientApp.swift; sourceTree = "<group>"; };
|
||||
|
|
@ -104,12 +100,10 @@
|
|||
DDC2E17526CE248F0042C5E4 /* MeshtasticClientUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MeshtasticClientUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
DDC2E17926CE248F0042C5E4 /* MeshtasticClientUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MeshtasticClientUITests.swift; sourceTree = "<group>"; };
|
||||
DDC2E17B26CE248F0042C5E4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
DDC2E18A26CE25690042C5E4 /* deviceData.json */ = {isa = PBXFileReference; explicitFileType = text.json; fileEncoding = 4; path = deviceData.json; sourceTree = "<group>"; };
|
||||
DDC2E18E26CE25FE0042C5E4 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
|
||||
DDC2E19026CE26290042C5E4 /* Messages.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Messages.swift; sourceTree = "<group>"; };
|
||||
DDC2E19A26CE27150042C5E4 /* CircleImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CircleImage.swift; sourceTree = "<group>"; };
|
||||
DDC2E19C26CE27580042C5E4 /* ModelData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelData.swift; sourceTree = "<group>"; };
|
||||
DDC2E19E26CE27630042C5E4 /* Device.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Device.swift; sourceTree = "<group>"; };
|
||||
DDC2E1A326CE2F940042C5E4 /* DeviceBLE.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeviceBLE.swift; sourceTree = "<group>"; };
|
||||
DDC2E1A626CEB3400042C5E4 /* LocationHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocationHelper.swift; sourceTree = "<group>"; };
|
||||
DDC2E1AA26DD89EC0042C5E4 /* packets.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = packets.json; sourceTree = "<group>"; };
|
||||
|
|
@ -255,8 +249,6 @@
|
|||
isa = PBXGroup;
|
||||
children = (
|
||||
DDC2E19C26CE27580042C5E4 /* ModelData.swift */,
|
||||
DDC2E19E26CE27630042C5E4 /* Device.swift */,
|
||||
DDAF8C6F26ED1DD20058C060 /* Device2.swift */,
|
||||
DD7AA3F226F05C120077AF76 /* NodeInfoModel.swift */,
|
||||
DD47E3DE26F39D9F00029299 /* MyInfoModel.swift */,
|
||||
);
|
||||
|
|
@ -266,7 +258,6 @@
|
|||
DDC2E18926CE24F70042C5E4 /* Resources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
DDC2E18A26CE25690042C5E4 /* deviceData.json */,
|
||||
DDC2E1AA26DD89EC0042C5E4 /* packets.json */,
|
||||
DDAF8C7126ED2AD80058C060 /* nodeInfo.json */,
|
||||
DD7AA3F426F05D660077AF76 /* nodeInfoModel.json */,
|
||||
|
|
@ -425,7 +416,6 @@
|
|||
files = (
|
||||
DDC2E15F26CE248F0042C5E4 /* Preview Assets.xcassets in Resources */,
|
||||
DDC2E15C26CE248F0042C5E4 /* Assets.xcassets in Resources */,
|
||||
DDC2E1A226CE29AC0042C5E4 /* deviceData.json in Resources */,
|
||||
DDC2E1AB26DD89EC0042C5E4 /* packets.json in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
|
|
@ -454,9 +444,7 @@
|
|||
DDAF8C6E26ED19040058C060 /* Extensions.swift in Sources */,
|
||||
DD47E3CC26F0E51D00029299 /* NodeDetail.swift in Sources */,
|
||||
DDC2E1A726CEB3400042C5E4 /* LocationHelper.swift in Sources */,
|
||||
DDAF8C7026ED1DD20058C060 /* Device2.swift in Sources */,
|
||||
DD7AA3F326F05C120077AF76 /* NodeInfoModel.swift in Sources */,
|
||||
DDC2E19F26CE27630042C5E4 /* Device.swift in Sources */,
|
||||
DD47E3D226F1210600029299 /* HelperFunctions.swift in Sources */,
|
||||
DDAF8C5F26ED09B50058C060 /* radioconfig.pb.swift in Sources */,
|
||||
DDAF8C5326EB1DF10058C060 /* BLEManager.swift in Sources */,
|
||||
|
|
@ -650,7 +638,7 @@
|
|||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.04;
|
||||
MARKETING_VERSION = 1.05;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = gvh.MeshtasticClient;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
|
|
@ -675,7 +663,7 @@
|
|||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.04;
|
||||
MARKETING_VERSION = 1.05;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = gvh.MeshtasticClient;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
|
|
|
|||
|
|
@ -96,11 +96,11 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph
|
|||
//---------------------------------------------------------------------------------------
|
||||
func centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral, advertisementData: [String : Any], rssi RSSI: NSNumber) {
|
||||
|
||||
//print(peripheral)
|
||||
print(peripheral)
|
||||
if peripheralArray.contains(peripheral) {
|
||||
print("Duplicate Found.")
|
||||
} else {
|
||||
print("Adding peripheral: " + peripheral.name!);
|
||||
print("Adding peripheral: " + ((peripheral.name != nil) ? peripheral.name! : "(null)"));
|
||||
peripheralArray.append(peripheral)
|
||||
rssiArray.append(RSSI)
|
||||
}
|
||||
|
|
@ -117,7 +117,7 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph
|
|||
}
|
||||
|
||||
let newPeripheral = Peripheral(id: peripheral.identifier.uuidString, index: peripherals.count, name: peripheralName, rssi: RSSI.intValue)
|
||||
//print(newPeripheral)
|
||||
print(newPeripheral)
|
||||
peripherals.append(newPeripheral)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@
|
|||
<string>$(MARKETING_VERSION)</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>ITSAppUsesNonExemptEncryption</key>
|
||||
<false/>
|
||||
<key>LSApplicationCategoryType</key>
|
||||
<string>public.app-category.utilities</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
|
|
@ -27,7 +29,7 @@
|
|||
<key>NSBluetoothAlwaysUsageDescription</key>
|
||||
<string>We use bluetooth to connect to nearby Meshtastic Devices</string>
|
||||
<key>NSBluetoothPeripheralUsageDescription</key>
|
||||
<string>Bluetooth is used to connect an iPhone to a user's meshtastic device to allow text messaging and location data for the mesh network.</string>
|
||||
<string>Bluetooth is used to connect an iPhone to a user's meshtastic device to allow text messaging and location data for the mesh network.</string>
|
||||
<key>NSLocationWhenInUseUsageDescription</key>
|
||||
<string>We use your location to center maps of the mesh</string>
|
||||
<key>Privacy – Bluetooth Always Usage Description</key>
|
||||
|
|
@ -51,8 +53,6 @@
|
|||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>ITSAppUsesNonExemptEncryption</key>
|
||||
<false/>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
|
|
|
|||
|
|
@ -1,37 +0,0 @@
|
|||
/*
|
||||
See LICENSE folder for this app’s licensing information.
|
||||
|
||||
Abstract:
|
||||
A representation of a single device.
|
||||
*/
|
||||
|
||||
import Foundation
|
||||
import SwiftUI
|
||||
import CoreLocation
|
||||
|
||||
struct Device: Hashable, Codable, Identifiable {
|
||||
|
||||
var longName: String
|
||||
var shortName: String
|
||||
var id: String
|
||||
var region: String
|
||||
var hasGPS: Bool
|
||||
var isRouter: Bool
|
||||
var firmwareVersion: String
|
||||
var hardwareModel: String
|
||||
var lastHeard: Double
|
||||
var snr: Double
|
||||
|
||||
private var imageName: String
|
||||
var image: Image {
|
||||
Image(imageName)
|
||||
}
|
||||
|
||||
var position: Position
|
||||
|
||||
struct Position: Hashable, Codable {
|
||||
var latitude: Double
|
||||
var longitude: Double
|
||||
var altitude: Int
|
||||
var batteryLevel: Int }
|
||||
}
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
/*
|
||||
See LICENSE folder for this app’s licensing information.
|
||||
|
||||
Abstract:
|
||||
A representation of a single device.
|
||||
*/
|
||||
|
||||
import Foundation
|
||||
import SwiftUI
|
||||
import CoreLocation
|
||||
|
||||
struct Device2: Hashable, Codable, Identifiable {
|
||||
|
||||
var id: String
|
||||
var num: Int32
|
||||
|
||||
struct MyInfo: Hashable, Codable {
|
||||
|
||||
var hasGps: Bool
|
||||
var numBands: Int32
|
||||
var maxChannels: Int32
|
||||
var firmwareVersion: String
|
||||
var rebootCount: Int32
|
||||
var messageTimeoutMsec: Int32
|
||||
var minAppVersion: Int32
|
||||
}
|
||||
|
||||
|
||||
struct User: Hashable, Codable {
|
||||
var id: String
|
||||
var longName: String
|
||||
var shortName: String
|
||||
var macaddr: String
|
||||
var hwModel: String
|
||||
}
|
||||
|
||||
struct Position: Hashable, Codable {
|
||||
var latitude: Int32
|
||||
var longitude: Int32
|
||||
var altitude: Int32
|
||||
var batteryLevel: Int
|
||||
}
|
||||
var lastHeard: Int32
|
||||
|
||||
}
|
||||
|
|
@ -7,13 +7,9 @@ import Foundation
|
|||
import Combine
|
||||
|
||||
final class ModelData: ObservableObject {
|
||||
@Published var devices: [Device] = load("deviceData.json")
|
||||
// @Published var devices: [Device] = load("deviceData.json")
|
||||
|
||||
@Published var nodes: [NodeInfoModel] = load("packets.json")
|
||||
|
||||
var nearby: [Device] {
|
||||
devices
|
||||
}
|
||||
}
|
||||
|
||||
func load<T: Decodable>(_ filename: String) -> T {
|
||||
|
|
|
|||
|
|
@ -1,81 +0,0 @@
|
|||
[
|
||||
{
|
||||
"longName": "RAK GPS Node",
|
||||
"shortName": "RGN",
|
||||
"region": "US",
|
||||
"id": "!438f02b0",
|
||||
"firmwareVersion": "1.2.43",
|
||||
"lastHeard": 1628145597,
|
||||
"isRouter": true,
|
||||
"hasGPS": true,
|
||||
"hardwareModel": "RAK4631",
|
||||
"macAddress": "MAC STRING",
|
||||
"snr": 4.75,
|
||||
"imageName": "rak4631",
|
||||
"position": {
|
||||
"longitude": -122.151405,
|
||||
"latitude": 47.608330,
|
||||
"batteryLevel": 55,
|
||||
"altitude": 150
|
||||
}
|
||||
},
|
||||
{
|
||||
"longName": "RAK Solar 1",
|
||||
"shortName": "RS1",
|
||||
"region": "US",
|
||||
"id": "!3ba37b3e",
|
||||
"firmwareVersion": "1.2.43",
|
||||
"lastHeard": 1628091161,
|
||||
"isRouter": false,
|
||||
"hasGPS": false,
|
||||
"hardwareModel": "RAK4631",
|
||||
"macAddress": "MAC STRING",
|
||||
"snr": 4.75,
|
||||
"imageName": "rak4631",
|
||||
"position": {
|
||||
"longitude": -122.145316,
|
||||
"latitude": 47.601440,
|
||||
"batteryLevel": 55,
|
||||
"altitude": 150
|
||||
}
|
||||
},
|
||||
{
|
||||
"longName": "RAK Solar 2",
|
||||
"shortName": "RS2",
|
||||
"region": "US",
|
||||
"id": "!a66c166f",
|
||||
"firmwareVersion": "1.2.43",
|
||||
"lastHeard": 1628094190,
|
||||
"isRouter": false,
|
||||
"hasGPS": false,
|
||||
"hardwareModel": "RAK4631",
|
||||
"macAddress": "MAC STRING",
|
||||
"snr": 4.75,
|
||||
"imageName": "rak4631",
|
||||
"position": {
|
||||
"longitude": -122.148599,
|
||||
"latitude": 47.602106,
|
||||
"batteryLevel": 77,
|
||||
"altitude": 150
|
||||
}
|
||||
},
|
||||
{
|
||||
"longName": "Yellow Beam",
|
||||
"shortName": "YB",
|
||||
"region": "US",
|
||||
"id": "!050c2538",
|
||||
"firmwareVersion": "1.2.43",
|
||||
"lastHeard": 1628091161,
|
||||
"isRouter": false,
|
||||
"hasGPS": true,
|
||||
"hardwareModel": "TBEAM",
|
||||
"macAddress": "MAC STRING",
|
||||
"snr": 4.75,
|
||||
"imageName": "tbeam",
|
||||
"position": {
|
||||
"longitude": -122.154392,
|
||||
"latitude": 47.598788,
|
||||
"batteryLevel": 55,
|
||||
"altitude": 150
|
||||
}
|
||||
}]
|
||||
|
|
@ -17,11 +17,7 @@ struct DeviceBLE: View {
|
|||
@EnvironmentObject var modelData: ModelData
|
||||
|
||||
@ObservedObject var bleManager = BLEManager()
|
||||
|
||||
var devices: [Device] {
|
||||
modelData.devices
|
||||
}
|
||||
|
||||
|
||||
var body: some View {
|
||||
NavigationView {
|
||||
|
||||
|
|
@ -33,7 +29,7 @@ struct DeviceBLE: View {
|
|||
if(bleManager.connectedPeripheral != nil){
|
||||
HStack{
|
||||
Image(systemName: "dot.radiowaves.left.and.right").imageScale(.large).foregroundColor(.green)
|
||||
Text(bleManager.connectedPeripheral.name!).font(.title)
|
||||
Text((bleManager.connectedPeripheral.name != nil) ? bleManager.connectedPeripheral.name! : "Unknown").font(.title)
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ struct CircleText: View {
|
|||
Text(text).font(.caption2).foregroundColor(.white)
|
||||
.background(Circle()
|
||||
.fill(color)
|
||||
.frame(width: 36, height: 36, alignment: /*@START_MENU_TOKEN@*/.center/*@END_MENU_TOKEN@*/))
|
||||
.frame(width: 32, height: 32, alignment: /*@START_MENU_TOKEN@*/.center/*@END_MENU_TOKEN@*/))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ struct NodeDetail: View {
|
|||
|
||||
let regionBinding = Binding<MKCoordinateRegion>(
|
||||
get: {
|
||||
MKCoordinateRegion(center: nodeCoordinatePosition, span: MKCoordinateSpan(latitudeDelta: 0.002, longitudeDelta: 0.002))
|
||||
MKCoordinateRegion(center: nodeCoordinatePosition, span: MKCoordinateSpan(latitudeDelta: 0.005, longitudeDelta: 0.005))
|
||||
},
|
||||
set: { _ in }
|
||||
)
|
||||
|
|
@ -45,10 +45,7 @@ struct NodeDetail: View {
|
|||
MapAnnotation(
|
||||
coordinate: location.coordinate,
|
||||
content: {
|
||||
Text(node.user.shortName).font(.subheadline).foregroundColor(.white)
|
||||
.background(Circle()
|
||||
.fill(Color.blue)
|
||||
.frame(width: 36, height: 36))
|
||||
CircleText(text: node.user.shortName, color: Color.blue)
|
||||
}
|
||||
)
|
||||
}.frame(idealWidth: bounds.size.width, minHeight: bounds.size.height / 2)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue