mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Mockup of connected device navigationBarItems
This commit is contained in:
parent
7bb4eb94ab
commit
71b9aa5f2e
7 changed files with 266 additions and 79 deletions
|
|
@ -18,6 +18,7 @@
|
|||
DD47E3DF26F39D9F00029299 /* MyInfoModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD47E3DE26F39D9F00029299 /* MyInfoModel.swift */; };
|
||||
DD7AA3F326F05C120077AF76 /* NodeInfoModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD7AA3F226F05C120077AF76 /* NodeInfoModel.swift */; };
|
||||
DD836AE726F6B38600ABCC23 /* Connect.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD836AE626F6B38600ABCC23 /* Connect.swift */; };
|
||||
DD836AEB26F7AF9000ABCC23 /* nodeinfomodel2.json in Resources */ = {isa = PBXBuildFile; fileRef = DD836AEA26F7AF9000ABCC23 /* nodeinfomodel2.json */; };
|
||||
DD90860C26F684AF00DC5189 /* BatteryIcon.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD90860B26F684AF00DC5189 /* BatteryIcon.swift */; };
|
||||
DD90860E26F69BAE00DC5189 /* NodeMap.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD90860D26F69BAE00DC5189 /* NodeMap.swift */; };
|
||||
DDAF8C5326EB1DF10058C060 /* BLEManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDAF8C5226EB1DF10058C060 /* BLEManager.swift */; };
|
||||
|
|
@ -72,8 +73,9 @@
|
|||
DD47E3DC26F390A000029299 /* MessageDetail.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageDetail.swift; sourceTree = "<group>"; };
|
||||
DD47E3DE26F39D9F00029299 /* MyInfoModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyInfoModel.swift; sourceTree = "<group>"; };
|
||||
DD7AA3F226F05C120077AF76 /* NodeInfoModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NodeInfoModel.swift; sourceTree = "<group>"; };
|
||||
DD7AA3F426F05D660077AF76 /* nodeInfoModel.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = nodeInfoModel.json; sourceTree = "<group>"; };
|
||||
DD7AA3F426F05D660077AF76 /* nodeinfomodel.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = nodeinfomodel.json; sourceTree = "<group>"; };
|
||||
DD836AE626F6B38600ABCC23 /* Connect.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Connect.swift; sourceTree = "<group>"; };
|
||||
DD836AEA26F7AF9000ABCC23 /* nodeinfomodel2.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = nodeinfomodel2.json; sourceTree = "<group>"; };
|
||||
DD90860A26F645B700DC5189 /* MeshtasticClient.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = MeshtasticClient.entitlements; sourceTree = "<group>"; };
|
||||
DD90860B26F684AF00DC5189 /* BatteryIcon.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BatteryIcon.swift; sourceTree = "<group>"; };
|
||||
DD90860D26F69BAE00DC5189 /* NodeMap.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NodeMap.swift; sourceTree = "<group>"; };
|
||||
|
|
@ -88,7 +90,7 @@
|
|||
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>"; };
|
||||
DDAF8C7126ED2AD80058C060 /* nodeInfo.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = nodeInfo.json; 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>"; };
|
||||
DDC2E15B26CE248F0042C5E4 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
|
|
@ -256,9 +258,10 @@
|
|||
DDC2E18926CE24F70042C5E4 /* Resources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
DD836AEA26F7AF9000ABCC23 /* nodeinfomodel2.json */,
|
||||
DDC2E1AA26DD89EC0042C5E4 /* packets.json */,
|
||||
DDAF8C7126ED2AD80058C060 /* nodeInfo.json */,
|
||||
DD7AA3F426F05D660077AF76 /* nodeInfoModel.json */,
|
||||
DDAF8C7126ED2AD80058C060 /* nodeinfo.json */,
|
||||
DD7AA3F426F05D660077AF76 /* nodeinfomodel.json */,
|
||||
);
|
||||
path = Resources;
|
||||
sourceTree = "<group>";
|
||||
|
|
@ -403,6 +406,7 @@
|
|||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
DD836AEB26F7AF9000ABCC23 /* nodeinfomodel2.json in Resources */,
|
||||
DDC2E15F26CE248F0042C5E4 /* Preview Assets.xcassets in Resources */,
|
||||
DDC2E15C26CE248F0042C5E4 /* Assets.xcassets in Resources */,
|
||||
DDC2E1AB26DD89EC0042C5E4 /* packets.json in Resources */,
|
||||
|
|
|
|||
|
|
@ -3,11 +3,18 @@ import CoreData
|
|||
import CoreBluetooth
|
||||
import SwiftUI
|
||||
|
||||
struct Peripheral: Identifiable {
|
||||
let id: String
|
||||
let index: Int
|
||||
let name: String
|
||||
let rssi: Int
|
||||
final class Peripheral: Identifiable, ObservableObject {
|
||||
@Published var id: String
|
||||
@Published var index: Int
|
||||
@Published var name: String
|
||||
@Published var rssi: Int
|
||||
|
||||
init(id: String, index: Int, name: String, rssi: Int) {
|
||||
self.id = id
|
||||
self.index = index
|
||||
self.name = name
|
||||
self.rssi = rssi
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------
|
||||
|
|
@ -19,7 +26,7 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph
|
|||
private var centralManager: CBCentralManager!
|
||||
@Published var connectedPeripheral: CBPeripheral!
|
||||
@Published var peripheralArray = [CBPeripheral]()
|
||||
private var rssiArray = [NSNumber]()
|
||||
//private var rssiArray = [NSNumber]()
|
||||
private var timer = Timer()
|
||||
@Published var isSwitchedOn = false
|
||||
@Published var peripherals = [Peripheral]()
|
||||
|
|
@ -60,7 +67,7 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph
|
|||
// Remove Existing Data
|
||||
peripherals.removeAll()
|
||||
peripheralArray.removeAll()
|
||||
rssiArray.removeAll()
|
||||
//rssiArray.removeAll()
|
||||
// Start Scanning
|
||||
print("Start Scanning")
|
||||
centralManager.scanForPeripherals(withServices: [meshtasticServiceCBUUID])
|
||||
|
|
@ -102,7 +109,7 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph
|
|||
} else {
|
||||
print("Adding peripheral: " + ((peripheral.name != nil) ? peripheral.name! : "(null)"));
|
||||
peripheralArray.append(peripheral)
|
||||
rssiArray.append(RSSI)
|
||||
//rssiArray.append(RSSI)
|
||||
}
|
||||
|
||||
var peripheralName: String!
|
||||
|
|
@ -269,7 +276,7 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph
|
|||
if decodedInfo.configCompleteID != 0 {
|
||||
print(decodedInfo)
|
||||
}
|
||||
|
||||
|
||||
default:
|
||||
print("Unhandled Characteristic UUID: \(characteristic.uuid)")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,43 +1,152 @@
|
|||
[
|
||||
{
|
||||
"num":2792101487,
|
||||
"user":{
|
||||
"id":"!a66c166f",
|
||||
"longName":"RAK Solar 2",
|
||||
"shortName":"RS2",
|
||||
"macaddr":"8eambBZv",
|
||||
"hwModel":"RAK4631"
|
||||
},
|
||||
"position":{
|
||||
"batteryLevel":68},
|
||||
"lastHeard":1631593661
|
||||
}
|
||||
},
|
||||
{
|
||||
"num":1000569662,
|
||||
"user":{
|
||||
"id":"!3ba37b3e",
|
||||
"longName":"RAK Solar 1",
|
||||
"shortName":"RS1",
|
||||
"macaddr":"1Kc7o3s+",
|
||||
"hwModel":"RAK4631"
|
||||
},
|
||||
"position":{
|
||||
"latitudeI":476021390,
|
||||
"longitudeI":-1221532609,
|
||||
"altitude":71,
|
||||
"batteryLevel":70,
|
||||
"time":1629314497
|
||||
},
|
||||
"lastHeard":1629392801,
|
||||
"snr":5.25
|
||||
},
|
||||
{"num":1133445808,"user":{"id":"!438f02b0","longName":"RAK DEV NODE","shortName":"RDN","macaddr":"92VDjwKw","hwModel":"RAK4631"},"position":{"latitudeI":476022071,"longitudeI":-1221533607,"altitude":91,"batteryLevel":88,"time":1629391435},"lastHeard":1629393577,"snr":4.5},
|
||||
{"num":84682040,"user":{"id":"!050c2538","longName":"Yellow Beam","shortName":"YB","macaddr":"PGEFDCU4","hwModel":"TBEAM"},"position":{"latitudeI":476020703,"longitudeI":-1221531973,"altitude":79,"batteryLevel":1,"time":1631593233},"lastHeard":1631593034,"snr":5.0},
|
||||
{"num":2354994191,"user":{"id":"!8c5e5c0f","longName":"RAK Solar 3","shortName":"RS3","macaddr":"+GKMXlwP","hwModel":"RAK4631"},"position":{"batteryLevel":91,"time":1629263310},"lastHeard":1629393330,"snr":4.5},
|
||||
{"num":2718727166,"user":{"id":"!a20c7bfe","longName":"RAK Large Node","shortName":"RLN","macaddr":"zXSiDHv+","hwModel":"RAK4631"},"position":{"batteryLevel":32,"time":1629061939},"lastHeard":1629102457,"snr":-17.5},
|
||||
{"num":84681200,"user":{"id":"!050c21f0","longName":"Unknown 21f0","shortName":"?F0","macaddr":"PGEFDCHw","hwModel":"TBEAM"},"position":{"latitudeI":476022115,"longitudeI":-1221531952,"altitude":85,"batteryLevel":100,"time":1631593830},"lastHeard":1631593584,"snr":6.75},
|
||||
{"num":2930161432,"user":{"id":"!aea6b718","longName":"Unknown b718","shortName":"?18","macaddr":"TBGuprcY","hwModel":"TBEAM"},"position":{"latitudeI":476020757,"longitudeI":-1221533124,"altitude":56,"batteryLevel":100,"time":1631593558},"lastHeard":1631593554,"snr":6.75},
|
||||
{"num":4064637200,"user":{"id":"!f2457110","longName":"Unknown 7110","shortName":"?10","macaddr":"CDryRXEQ","hwModel":"TBEAM"},"position":{"latitudeI":476021534,"longitudeI":-1221533621,"altitude":49,"batteryLevel":100,"time":1631593778},"lastHeard":1631593533,"snr":7.0}
|
||||
|
||||
]
|
||||
[{
|
||||
"num": 2792101487,
|
||||
"user": {
|
||||
"id": "!a66c166f",
|
||||
"longName": "RAK Solar 2",
|
||||
"shortName": "RS2",
|
||||
"macaddr": "8eambBZv",
|
||||
"hwModel": "RAK4631"
|
||||
},
|
||||
"position": {
|
||||
"batteryLevel": 68
|
||||
},
|
||||
"lastHeard": 1631593661
|
||||
}, {
|
||||
"num": 1000569662,
|
||||
"user": {
|
||||
"id": "!3ba37b3e",
|
||||
"longName": "RAK Solar 1",
|
||||
"shortName": "RS1",
|
||||
"macaddr": "1Kc7o3s+",
|
||||
"hwModel": "RAK4631"
|
||||
},
|
||||
"position": {
|
||||
"latitudeI": 476021390,
|
||||
"longitudeI": -1221532609,
|
||||
"altitude": 71,
|
||||
"batteryLevel": 70,
|
||||
"time": 1629314497
|
||||
},
|
||||
"lastHeard": 1629392801,
|
||||
"snr": 5.25
|
||||
}, {
|
||||
"num": 1133445808,
|
||||
"user": {
|
||||
"id": "!438f02b0",
|
||||
"longName": "RAK DEV NODE",
|
||||
"shortName": "RDN",
|
||||
"macaddr": "92VDjwKw",
|
||||
"hwModel": "RAK4631"
|
||||
},
|
||||
"position": {
|
||||
"latitudeI": 476022071,
|
||||
"longitudeI": -1221533607,
|
||||
"altitude": 91,
|
||||
"batteryLevel": 88,
|
||||
"time": 1629391435
|
||||
},
|
||||
"lastHeard": 1629393577,
|
||||
"snr": 4.5
|
||||
}, {
|
||||
"num": 84682040,
|
||||
"user": {
|
||||
"id": "!050c2538",
|
||||
"longName": "Yellow Beam",
|
||||
"shortName": "YB",
|
||||
"macaddr": "PGEFDCU4",
|
||||
"hwModel": "TBEAM"
|
||||
},
|
||||
"position": {
|
||||
"latitudeI": 476020703,
|
||||
"longitudeI": -1221531973,
|
||||
"altitude": 79,
|
||||
"batteryLevel": 1,
|
||||
"time": 1631593233
|
||||
},
|
||||
"lastHeard": 1631593034,
|
||||
"snr": 5.0
|
||||
}, {
|
||||
"num": 2354994191,
|
||||
"user": {
|
||||
"id": "!8c5e5c0f",
|
||||
"longName": "RAK Solar 3",
|
||||
"shortName": "RS3",
|
||||
"macaddr": "+GKMXlwP",
|
||||
"hwModel": "RAK4631"
|
||||
},
|
||||
"position": {
|
||||
"batteryLevel": 91,
|
||||
"time": 1629263310
|
||||
},
|
||||
"lastHeard": 1629393330,
|
||||
"snr": 4.5
|
||||
}, {
|
||||
"num": 2718727166,
|
||||
"user": {
|
||||
"id": "!a20c7bfe",
|
||||
"longName": "RAK Large Node",
|
||||
"shortName": "RLN",
|
||||
"macaddr": "zXSiDHv+",
|
||||
"hwModel": "RAK4631"
|
||||
},
|
||||
"position": {
|
||||
"batteryLevel": 32,
|
||||
"time": 1629061939
|
||||
},
|
||||
"lastHeard": 1629102457,
|
||||
"snr": -17.5
|
||||
}, {
|
||||
"num": 84681200,
|
||||
"user": {
|
||||
"id": "!050c21f0",
|
||||
"longName": "Unknown 21f0",
|
||||
"shortName": "?F0",
|
||||
"macaddr": "PGEFDCHw",
|
||||
"hwModel": "TBEAM"
|
||||
},
|
||||
"position": {
|
||||
"latitudeI": 476022115,
|
||||
"longitudeI": -1221531952,
|
||||
"altitude": 85,
|
||||
"batteryLevel": 100,
|
||||
"time": 1631593830
|
||||
},
|
||||
"lastHeard": 1631593584,
|
||||
"snr": 6.75
|
||||
}, {
|
||||
"num": 2930161432,
|
||||
"user": {
|
||||
"id": "!aea6b718",
|
||||
"longName": "Unknown b718",
|
||||
"shortName": "?18",
|
||||
"macaddr": "TBGuprcY",
|
||||
"hwModel": "TBEAM"
|
||||
},
|
||||
"position": {
|
||||
"latitudeI": 476020757,
|
||||
"longitudeI": -1221533124,
|
||||
"altitude": 56,
|
||||
"batteryLevel": 100,
|
||||
"time": 1631593558
|
||||
},
|
||||
"lastHeard": 1631593554,
|
||||
"snr": 6.75
|
||||
}, {
|
||||
"num": 4064637200,
|
||||
"user": {
|
||||
"id": "!f2457110",
|
||||
"longName": "Unknown 7110",
|
||||
"shortName": "?10",
|
||||
"macaddr": "CDryRXEQ",
|
||||
"hwModel": "TBEAM"
|
||||
},
|
||||
"position": {
|
||||
"latitudeI": 476021534,
|
||||
"longitudeI": -1221533621,
|
||||
"altitude": 49,
|
||||
"batteryLevel": 100,
|
||||
"time": 1631593778
|
||||
},
|
||||
"lastHeard": 1631593533,
|
||||
"snr": 7.0
|
||||
}]
|
||||
|
|
|
|||
43
MeshtasticClient/Resources/nodeinfo.json
Normal file
43
MeshtasticClient/Resources/nodeinfo.json
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
[
|
||||
{
|
||||
"num":2792101487,
|
||||
"user":{
|
||||
"id":"!a66c166f",
|
||||
"longName":"RAK Solar 2",
|
||||
"shortName":"RS2",
|
||||
"macaddr":"8eambBZv",
|
||||
"hwModel":"RAK4631"
|
||||
},
|
||||
"position":{
|
||||
"batteryLevel":68},
|
||||
"lastHeard":1631593661
|
||||
}
|
||||
},
|
||||
{
|
||||
"num":1000569662,
|
||||
"user":{
|
||||
"id":"!3ba37b3e",
|
||||
"longName":"RAK Solar 1",
|
||||
"shortName":"RS1",
|
||||
"macaddr":"1Kc7o3s+",
|
||||
"hwModel":"RAK4631"
|
||||
},
|
||||
"position":{
|
||||
"latitudeI":476021390,
|
||||
"longitudeI":-1221532609,
|
||||
"altitude":71,
|
||||
"batteryLevel":70,
|
||||
"time":1629314497
|
||||
},
|
||||
"lastHeard":1629392801,
|
||||
"snr":5.25
|
||||
},
|
||||
{"num":1133445808,"user":{"id":"!438f02b0","longName":"RAK DEV NODE","shortName":"RDN","macaddr":"92VDjwKw","hwModel":"RAK4631"},"position":{"latitudeI":476022071,"longitudeI":-1221533607,"altitude":91,"batteryLevel":88,"time":1629391435},"lastHeard":1629393577,"snr":4.5},
|
||||
{"num":84682040,"user":{"id":"!050c2538","longName":"Yellow Beam","shortName":"YB","macaddr":"PGEFDCU4","hwModel":"TBEAM"},"position":{"latitudeI":476020703,"longitudeI":-1221531973,"altitude":79,"batteryLevel":1,"time":1631593233},"lastHeard":1631593034,"snr":5.0},
|
||||
{"num":2354994191,"user":{"id":"!8c5e5c0f","longName":"RAK Solar 3","shortName":"RS3","macaddr":"+GKMXlwP","hwModel":"RAK4631"},"position":{"batteryLevel":91,"time":1629263310},"lastHeard":1629393330,"snr":4.5},
|
||||
{"num":2718727166,"user":{"id":"!a20c7bfe","longName":"RAK Large Node","shortName":"RLN","macaddr":"zXSiDHv+","hwModel":"RAK4631"},"position":{"batteryLevel":32,"time":1629061939},"lastHeard":1629102457,"snr":-17.5},
|
||||
{"num":84681200,"user":{"id":"!050c21f0","longName":"Unknown 21f0","shortName":"?F0","macaddr":"PGEFDCHw","hwModel":"TBEAM"},"position":{"latitudeI":476022115,"longitudeI":-1221531952,"altitude":85,"batteryLevel":100,"time":1631593830},"lastHeard":1631593584,"snr":6.75},
|
||||
{"num":2930161432,"user":{"id":"!aea6b718","longName":"Unknown b718","shortName":"?18","macaddr":"TBGuprcY","hwModel":"TBEAM"},"position":{"latitudeI":476020757,"longitudeI":-1221533124,"altitude":56,"batteryLevel":100,"time":1631593558},"lastHeard":1631593554,"snr":6.75},
|
||||
{"num":4064637200,"user":{"id":"!f2457110","longName":"Unknown 7110","shortName":"?10","macaddr":"CDryRXEQ","hwModel":"TBEAM"},"position":{"latitudeI":476021534,"longitudeI":-1221533621,"altitude":49,"batteryLevel":100,"time":1631593778},"lastHeard":1631593533,"snr":7.0}
|
||||
|
||||
]
|
||||
43
MeshtasticClient/Resources/nodeinfomodel2.json
Normal file
43
MeshtasticClient/Resources/nodeinfomodel2.json
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
[
|
||||
{
|
||||
"num":2792101487,
|
||||
"user":{
|
||||
"id":"!a66c166f",
|
||||
"longName":"RAK Solar 2",
|
||||
"shortName":"RS2",
|
||||
"macaddr":"8eambBZv",
|
||||
"hwModel":"RAK4631"
|
||||
},
|
||||
"position":{
|
||||
"batteryLevel":68},
|
||||
"lastHeard":1631593661
|
||||
}
|
||||
},
|
||||
{
|
||||
"num":1000569662,
|
||||
"user":{
|
||||
"id":"!3ba37b3e",
|
||||
"longName":"RAK Solar 1",
|
||||
"shortName":"RS1",
|
||||
"macaddr":"1Kc7o3s+",
|
||||
"hwModel":"RAK4631"
|
||||
},
|
||||
"position":{
|
||||
"latitudeI":476021390,
|
||||
"longitudeI":-1221532609,
|
||||
"altitude":71,
|
||||
"batteryLevel":70,
|
||||
"time":1629314497
|
||||
},
|
||||
"lastHeard":1629392801,
|
||||
"snr":5.25
|
||||
},
|
||||
{"num":1133445808,"user":{"id":"!438f02b0","longName":"RAK DEV NODE","shortName":"RDN","macaddr":"92VDjwKw","hwModel":"RAK4631"},"position":{"latitudeI":476022071,"longitudeI":-1221533607,"altitude":91,"batteryLevel":88,"time":1629391435},"lastHeard":1629393577,"snr":4.5},
|
||||
{"num":84682040,"user":{"id":"!050c2538","longName":"Yellow Beam","shortName":"YB","macaddr":"PGEFDCU4","hwModel":"TBEAM"},"position":{"latitudeI":476020703,"longitudeI":-1221531973,"altitude":79,"batteryLevel":1,"time":1631593233},"lastHeard":1631593034,"snr":5.0},
|
||||
{"num":2354994191,"user":{"id":"!8c5e5c0f","longName":"RAK Solar 3","shortName":"RS3","macaddr":"+GKMXlwP","hwModel":"RAK4631"},"position":{"batteryLevel":91,"time":1629263310},"lastHeard":1629393330,"snr":4.5},
|
||||
{"num":2718727166,"user":{"id":"!a20c7bfe","longName":"RAK Large Node","shortName":"RLN","macaddr":"zXSiDHv+","hwModel":"RAK4631"},"position":{"batteryLevel":32,"time":1629061939},"lastHeard":1629102457,"snr":-17.5},
|
||||
{"num":84681200,"user":{"id":"!050c21f0","longName":"Unknown 21f0","shortName":"?F0","macaddr":"PGEFDCHw","hwModel":"TBEAM"},"position":{"latitudeI":476022115,"longitudeI":-1221531952,"altitude":85,"batteryLevel":100,"time":1631593830},"lastHeard":1631593584,"snr":6.75},
|
||||
{"num":2930161432,"user":{"id":"!aea6b718","longName":"Unknown b718","shortName":"?18","macaddr":"TBGuprcY","hwModel":"TBEAM"},"position":{"latitudeI":476020757,"longitudeI":-1221533124,"altitude":56,"batteryLevel":100,"time":1631593558},"lastHeard":1631593554,"snr":6.75},
|
||||
{"num":4064637200,"user":{"id":"!f2457110","longName":"Unknown 7110","shortName":"?10","macaddr":"CDryRXEQ","hwModel":"TBEAM"},"position":{"latitudeI":476021534,"longitudeI":-1221533621,"altitude":49,"batteryLevel":100,"time":1631593778},"lastHeard":1631593533,"snr":7.0}
|
||||
|
||||
]
|
||||
|
|
@ -99,14 +99,14 @@ struct Connect: View {
|
|||
Image(systemName: "antenna.radiowaves.left.and.right")
|
||||
.imageScale(.large)
|
||||
.foregroundColor(.green)
|
||||
Text("CONNECTED").font(.caption2).foregroundColor(.gray)
|
||||
Text("Connected").font(.caption2).foregroundColor(.gray)
|
||||
}
|
||||
else {
|
||||
|
||||
Image(systemName: "antenna.radiowaves.left.and.right")
|
||||
.imageScale(.large)
|
||||
.foregroundColor(.red)
|
||||
Text("DISCONNECTED").font(.caption).foregroundColor(.gray)
|
||||
Text("Disconnected").font(.caption2).foregroundColor(.gray)
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import Foundation
|
||||
import SwiftUI
|
||||
import CoreBluetooth
|
||||
|
||||
struct MessageList: View {
|
||||
|
||||
|
|
@ -7,7 +8,7 @@ struct MessageList: View {
|
|||
|
||||
@ObservedObject var bleManager = BLEManager()
|
||||
|
||||
@EnvironmentObject var modelData: ModelData
|
||||
@State var connectedPeripheral: CBPeripheral!
|
||||
|
||||
var body: some View {
|
||||
NavigationView {
|
||||
|
|
@ -21,26 +22,6 @@ struct MessageList: View {
|
|||
}
|
||||
.navigationTitle("Channels")
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.navigationBarItems(trailing:
|
||||
HStack {
|
||||
VStack {
|
||||
if bleManager.isSwitchedOn {
|
||||
Image(systemName: "antenna.radiowaves.left.and.right")
|
||||
.imageScale(.large)
|
||||
.foregroundColor(.green)
|
||||
Text("CONNECTED").font(.caption2).foregroundColor(.gray)
|
||||
}
|
||||
else {
|
||||
|
||||
Image(systemName: "antenna.radiowaves.left.and.right")
|
||||
.imageScale(.large)
|
||||
.foregroundColor(.red)
|
||||
Text("DISCONNECTED").font(.caption).foregroundColor(.gray)
|
||||
|
||||
}
|
||||
}
|
||||
}.offset(x: 10, y: -10)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue