Update Models

This commit is contained in:
Garth Vander Houwen 2021-09-12 17:51:10 -07:00
parent da9e01b4e7
commit a27e8b29fa
5 changed files with 49 additions and 12 deletions

View file

@ -7,6 +7,7 @@
objects = {
/* Begin PBXBuildFile section */
DD8E565A26EE85E3002CD952 /* MeshtasticClient.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = DD8E565826EE85E3002CD952 /* MeshtasticClient.xcdatamodeld */; };
DDAF8C5326EB1DF10058C060 /* BLEManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDAF8C5226EB1DF10058C060 /* BLEManager.swift */; };
DDAF8C5826ED07FD0058C060 /* mesh.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDAF8C5726ED07FD0058C060 /* mesh.pb.swift */; };
DDAF8C5B26ED08D30058C060 /* SwiftProtobuf in Frameworks */ = {isa = PBXBuildFile; productRef = DDAF8C5A26ED08D30058C060 /* SwiftProtobuf */; };
@ -58,6 +59,7 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
DD8E565926EE85E3002CD952 /* MeshtasticClient.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = MeshtasticClient.xcdatamodel; sourceTree = "<group>"; };
DDAF8C5226EB1DF10058C060 /* BLEManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BLEManager.swift; sourceTree = "<group>"; };
DDAF8C5726ED07FD0058C060 /* mesh.pb.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = mesh.pb.swift; sourceTree = "<group>"; };
DDAF8C5C26ED09490058C060 /* portnums.pb.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = portnums.pb.swift; sourceTree = "<group>"; };
@ -215,6 +217,7 @@
DDC2E18826CE24EE0042C5E4 /* Model */ = {
isa = PBXGroup;
children = (
DD8E565826EE85E3002CD952 /* MeshtasticClient.xcdatamodeld */,
DDC2E19C26CE27580042C5E4 /* ModelData.swift */,
DDC2E19E26CE27630042C5E4 /* Device.swift */,
DDAF8C6F26ED1DD20058C060 /* Device2.swift */,
@ -424,6 +427,7 @@
DDAF8C5D26ED09490058C060 /* portnums.pb.swift in Sources */,
DDC2E18F26CE25FE0042C5E4 /* ContentView.swift in Sources */,
DDAF8C6326ED0A230058C060 /* admin.pb.swift in Sources */,
DD8E565A26EE85E3002CD952 /* MeshtasticClient.xcdatamodeld in Sources */,
DDAF8C5826ED07FD0058C060 /* mesh.pb.swift in Sources */,
DDC2E19326CE266B0042C5E4 /* DeviceHome.swift in Sources */,
DDC2E19B26CE27150042C5E4 /* CircleImage.swift in Sources */,
@ -769,6 +773,19 @@
productName = SwiftProtobuf;
};
/* End XCSwiftPackageProductDependency section */
/* Begin XCVersionGroup section */
DD8E565826EE85E3002CD952 /* MeshtasticClient.xcdatamodeld */ = {
isa = XCVersionGroup;
children = (
DD8E565926EE85E3002CD952 /* MeshtasticClient.xcdatamodel */,
);
currentVersion = DD8E565926EE85E3002CD952 /* MeshtasticClient.xcdatamodel */;
path = MeshtasticClient.xcdatamodeld;
sourceTree = "<group>";
versionGroupType = wrapper.xcdatamodel;
};
/* End XCVersionGroup section */
};
rootObject = DDC2E14C26CE248E0042C5E4 /* Project object */;
}

View file

@ -1,4 +1,5 @@
import Foundation
import CoreData
import CoreBluetooth
struct Peripheral: Identifiable {
@ -222,7 +223,7 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph
var decodedInfo = FromRadio()
decodedInfo = try! FromRadio(serializedData: characteristic.value!)
//print(decodedInfo.myInfo.myNodeNum)
//print(decodedInfo)
if decodedInfo.myInfo.myNodeNum != 0
{
@ -238,13 +239,14 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph
{
print("Save a nodeInfo")
do {
let node =
print(try decodedInfo.nodeInfo.jsonString())
} catch {
fatalError("Failed to decode json")
}
}
if decodedInfo.packet.from != 0
if decodedInfo.packet.id != 0
{
print("Save a packet")
do {

View file

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="1" systemVersion="11A491" minimumToolsVersion="Automatic" sourceLanguage="Swift" usedWithCloudKit="true" userDefinedModelVersionIdentifier="">
<entity name="Item" representedClassName="Item" syncable="YES" codeGenerationType="class">
<attribute name="timestamp" optional="YES" attributeType="Date" usesScalarValueType="NO"/>
</entity>
<elements>
<element name="Item" positionX="-63" positionY="-18" width="128" height="44"/>
</elements>
</model>

View file

@ -1,5 +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/>
<dict>
<key>_XCCurrentVersionName</key>
<string>MeshtasticClient.xcdatamodel</string>
</dict>
</plist>

View file

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="18154" systemVersion="20G95" minimumToolsVersion="Automatic" sourceLanguage="Swift" usedWithCloudKit="YES" userDefinedModelVersionIdentifier="">
<entity name="NodeInfoEntity" representedClassName="NodeInfoEntity" syncable="YES" codeGenerationType="class">
<attribute name="lastHeard" optional="YES" attributeType="Date" usesScalarValueType="NO"/>
<attribute name="num" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES"/>
<attribute name="snr" optional="YES" attributeType="Decimal" defaultValueString="0.0"/>
<relationship name="user" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="UserEntity" inverseName="relationship" inverseEntity="UserEntity"/>
<fetchedProperty name="fetchedProperty" optional="YES">
<fetchRequest name="fetchedPropertyFetchRequest" entity="NodeInfoEntity"/>
</fetchedProperty>
</entity>
<entity name="UserEntity" representedClassName="UserEntity" syncable="YES" codeGenerationType="class">
<attribute name="hwModel" optional="YES" attributeType="String"/>
<attribute name="id" optional="YES" attributeType="String"/>
<attribute name="longName" optional="YES" attributeType="String"/>
<attribute name="macaddr" optional="YES" attributeType="String"/>
<attribute name="shortName" optional="YES" attributeType="String"/>
<relationship name="relationship" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="NodeInfoEntity" inverseName="user" inverseEntity="NodeInfoEntity"/>
</entity>
<elements>
<element name="UserEntity" positionX="-63" positionY="-18" width="128" height="133"/>
<element name="NodeInfoEntity" positionX="-63" positionY="-9" width="128" height="131"/>
</elements>
</model>