Skip to content

Various OmniKitPacketParser fixes, improvements & cleanup #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 86 additions & 2 deletions OmniKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,47 @@
C12EDA1629C7DFF100435701 /* HKUnit.swift in Sources */ = {isa = PBXBuildFile; fileRef = C12EDA1529C7DFF100435701 /* HKUnit.swift */; };
C12EDA1829C7E01800435701 /* TimeZone.swift in Sources */ = {isa = PBXBuildFile; fileRef = C12EDA1729C7E01800435701 /* TimeZone.swift */; };
C12EDA1B29C7E06900435701 /* OSLog.swift in Sources */ = {isa = PBXBuildFile; fileRef = C12EDA1A29C7E06900435701 /* OSLog.swift */; };
D80339732A500489004FF953 /* PodInfoPulseLog.swift in Sources */ = {isa = PBXBuildFile; fileRef = C124017E29C7D8E900B32844 /* PodInfoPulseLog.swift */; };
D80339742A50049B004FF953 /* VersionResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = C124017F29C7D8E900B32844 /* VersionResponse.swift */; };
D80339752A5004AE004FF953 /* PodInfoActivationTime.swift in Sources */ = {isa = PBXBuildFile; fileRef = C124018029C7D8E900B32844 /* PodInfoActivationTime.swift */; };
D80339762A5004B7004FF953 /* TempBasalExtraCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = C124018129C7D8E900B32844 /* TempBasalExtraCommand.swift */; };
D80339772A5004C0004FF953 /* DeactivatePodCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = C124018229C7D8E900B32844 /* DeactivatePodCommand.swift */; };
D80339782A5004C8004FF953 /* AcknowledgeAlertCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = C124018329C7D8E900B32844 /* AcknowledgeAlertCommand.swift */; };
D80339792A5004D1004FF953 /* PodInfoConfiguredAlerts.swift in Sources */ = {isa = PBXBuildFile; fileRef = C124018429C7D8E900B32844 /* PodInfoConfiguredAlerts.swift */; };
D803397A2A5004D9004FF953 /* MessageBlock.swift in Sources */ = {isa = PBXBuildFile; fileRef = C124018529C7D8E900B32844 /* MessageBlock.swift */; };
D803397B2A5004E1004FF953 /* PlaceholderMessageBlock.swift in Sources */ = {isa = PBXBuildFile; fileRef = C124018629C7D8E900B32844 /* PlaceholderMessageBlock.swift */; };
D803397C2A5004EB004FF953 /* PodInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = C124018729C7D8E900B32844 /* PodInfo.swift */; };
D803397D2A5004F3004FF953 /* BolusExtraCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = C124018829C7D8E900B32844 /* BolusExtraCommand.swift */; };
D803397E2A5004FA004FF953 /* FaultConfigCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = C124018929C7D8E900B32844 /* FaultConfigCommand.swift */; };
D803397F2A500501004FF953 /* PodInfoPulseLogPlus.swift in Sources */ = {isa = PBXBuildFile; fileRef = C124018A29C7D8E900B32844 /* PodInfoPulseLogPlus.swift */; };
D80339802A500509004FF953 /* StatusResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = C124018B29C7D8E900B32844 /* StatusResponse.swift */; };
D80339812A500510004FF953 /* GetStatusCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = C124018C29C7D8E900B32844 /* GetStatusCommand.swift */; };
D80339822A500519004FF953 /* BasalScheduleExtraCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = C124018D29C7D8E900B32844 /* BasalScheduleExtraCommand.swift */; };
D80339832A500520004FF953 /* CancelDeliveryCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = C124018E29C7D8E900B32844 /* CancelDeliveryCommand.swift */; };
D80339842A500528004FF953 /* AssignAddressCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = C124018F29C7D8E900B32844 /* AssignAddressCommand.swift */; };
D80339852A50052F004FF953 /* BeepConfigCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = C124019029C7D8E900B32844 /* BeepConfigCommand.swift */; };
D80339862A500537004FF953 /* ErrorResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = C124019129C7D8E900B32844 /* ErrorResponse.swift */; };
D80339872A500540004FF953 /* SetupPodCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = C124019229C7D8E900B32844 /* SetupPodCommand.swift */; };
D80339882A500548004FF953 /* DetailedStatus.swift in Sources */ = {isa = PBXBuildFile; fileRef = C124019329C7D8E900B32844 /* DetailedStatus.swift */; };
D80339892A500553004FF953 /* PodInfoResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = C124019429C7D8E900B32844 /* PodInfoResponse.swift */; };
D803398A2A50055B004FF953 /* SetInsulinScheduleCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = C124019529C7D8E900B32844 /* SetInsulinScheduleCommand.swift */; };
D803398B2A500563004FF953 /* ConfigureAlertsCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = C124019629C7D8E900B32844 /* ConfigureAlertsCommand.swift */; };
D803398C2A500589004FF953 /* AlertSlot.swift in Sources */ = {isa = PBXBuildFile; fileRef = C12401A129C7D8E900B32844 /* AlertSlot.swift */; };
D803398D2A5005FE004FF953 /* Message.swift in Sources */ = {isa = PBXBuildFile; fileRef = C124019929C7D8E900B32844 /* Message.swift */; };
D803398E2A500613004FF953 /* CRC16.swift in Sources */ = {isa = PBXBuildFile; fileRef = C12401A429C7D8E900B32844 /* CRC16.swift */; };
D803398F2A500625004FF953 /* BeepType.swift in Sources */ = {isa = PBXBuildFile; fileRef = C124017B29C7D8E900B32844 /* BeepType.swift */; };
D80339902A500638004FF953 /* Pod.swift in Sources */ = {isa = PBXBuildFile; fileRef = C124019B29C7D8E900B32844 /* Pod.swift */; };
D80339912A500659004FF953 /* Data.swift in Sources */ = {isa = PBXBuildFile; fileRef = C12ED9FF29C7DD2300435701 /* Data.swift */; };
D80339922A500668004FF953 /* FaultEventCode.swift in Sources */ = {isa = PBXBuildFile; fileRef = C124019829C7D8E900B32844 /* FaultEventCode.swift */; };
D80339932A500685004FF953 /* InsulinTableEntry.swift in Sources */ = {isa = PBXBuildFile; fileRef = C12401A229C7D8E900B32844 /* InsulinTableEntry.swift */; };
D80339942A500694004FF953 /* BolusDeliveryTable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C12401A629C7D8E900B32844 /* BolusDeliveryTable.swift */; };
D80339952A5006A7004FF953 /* PodProgressStatus.swift in Sources */ = {isa = PBXBuildFile; fileRef = C12401A329C7D8E900B32844 /* PodProgressStatus.swift */; };
D80339962A5006ED004FF953 /* BasalSchedule.swift in Sources */ = {isa = PBXBuildFile; fileRef = C12401A529C7D8E900B32844 /* BasalSchedule.swift */; };
D80339972A500705004FF953 /* BasalDeliveryTable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C124019D29C7D8E900B32844 /* BasalDeliveryTable.swift */; };
D80339982A50085C004FF953 /* TimeInterval.swift in Sources */ = {isa = PBXBuildFile; fileRef = C12EDA0329C7DDC800435701 /* TimeInterval.swift */; };
D803399A2A500D3D004FF953 /* CRC8.swift in Sources */ = {isa = PBXBuildFile; fileRef = C12401B229C7D8E900B32844 /* CRC8.swift */; };
D803399B2A50122F004FF953 /* Packet.swift in Sources */ = {isa = PBXBuildFile; fileRef = C12401B329C7D8E900B32844 /* Packet.swift */; };
D803399C2A50128D004FF953 /* LocalizedString.swift in Sources */ = {isa = PBXBuildFile; fileRef = C12EDA0129C7DD4700435701 /* LocalizedString.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -1003,6 +1044,47 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D803399C2A50128D004FF953 /* LocalizedString.swift in Sources */,
D803399B2A50122F004FF953 /* Packet.swift in Sources */,
D803399A2A500D3D004FF953 /* CRC8.swift in Sources */,
D80339982A50085C004FF953 /* TimeInterval.swift in Sources */,
D80339972A500705004FF953 /* BasalDeliveryTable.swift in Sources */,
D80339962A5006ED004FF953 /* BasalSchedule.swift in Sources */,
D80339952A5006A7004FF953 /* PodProgressStatus.swift in Sources */,
D80339942A500694004FF953 /* BolusDeliveryTable.swift in Sources */,
D80339932A500685004FF953 /* InsulinTableEntry.swift in Sources */,
D80339922A500668004FF953 /* FaultEventCode.swift in Sources */,
D80339912A500659004FF953 /* Data.swift in Sources */,
D80339902A500638004FF953 /* Pod.swift in Sources */,
D803398F2A500625004FF953 /* BeepType.swift in Sources */,
D803398E2A500613004FF953 /* CRC16.swift in Sources */,
D803398D2A5005FE004FF953 /* Message.swift in Sources */,
D803398C2A500589004FF953 /* AlertSlot.swift in Sources */,
D803398B2A500563004FF953 /* ConfigureAlertsCommand.swift in Sources */,
D803398A2A50055B004FF953 /* SetInsulinScheduleCommand.swift in Sources */,
D80339892A500553004FF953 /* PodInfoResponse.swift in Sources */,
D80339882A500548004FF953 /* DetailedStatus.swift in Sources */,
D80339872A500540004FF953 /* SetupPodCommand.swift in Sources */,
D80339862A500537004FF953 /* ErrorResponse.swift in Sources */,
D80339852A50052F004FF953 /* BeepConfigCommand.swift in Sources */,
D80339842A500528004FF953 /* AssignAddressCommand.swift in Sources */,
D80339832A500520004FF953 /* CancelDeliveryCommand.swift in Sources */,
D80339822A500519004FF953 /* BasalScheduleExtraCommand.swift in Sources */,
D80339812A500510004FF953 /* GetStatusCommand.swift in Sources */,
D80339802A500509004FF953 /* StatusResponse.swift in Sources */,
D803397F2A500501004FF953 /* PodInfoPulseLogPlus.swift in Sources */,
D803397E2A5004FA004FF953 /* FaultConfigCommand.swift in Sources */,
D803397D2A5004F3004FF953 /* BolusExtraCommand.swift in Sources */,
D803397C2A5004EB004FF953 /* PodInfo.swift in Sources */,
D803397B2A5004E1004FF953 /* PlaceholderMessageBlock.swift in Sources */,
D803397A2A5004D9004FF953 /* MessageBlock.swift in Sources */,
D80339792A5004D1004FF953 /* PodInfoConfiguredAlerts.swift in Sources */,
D80339782A5004C8004FF953 /* AcknowledgeAlertCommand.swift in Sources */,
D80339772A5004C0004FF953 /* DeactivatePodCommand.swift in Sources */,
D80339762A5004B7004FF953 /* TempBasalExtraCommand.swift in Sources */,
D80339752A5004AE004FF953 /* PodInfoActivationTime.swift in Sources */,
D80339742A50049B004FF953 /* VersionResponse.swift in Sources */,
D80339732A500489004FF953 /* PodInfoPulseLog.swift in Sources */,
C1229C7229C7F0950066A89C /* main.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -1244,9 +1326,10 @@
C1229C7029C7F0840066A89C /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
CODE_SIGN_STYLE = Automatic;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = UY678SP37Q;
DEVELOPMENT_TEAM = "";
ENABLE_HARDENED_RUNTIME = YES;
MACOSX_DEPLOYMENT_TARGET = 13.1;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -1258,9 +1341,10 @@
C1229C7129C7F0840066A89C /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
CODE_SIGN_STYLE = Automatic;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = UY678SP37Q;
DEVELOPMENT_TEAM = "";
ENABLE_HARDENED_RUNTIME = YES;
MACOSX_DEPLOYMENT_TARGET = 13.1;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
15 changes: 9 additions & 6 deletions OmniKitPacketParser/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,12 @@ class XcodeLogParser {
}
}

if CommandLine.argc <= 1 {
print("No file names specified in command arguments to parse!")
print("Set the Xcode Arguments Passed on Launch using Product->Scheme->Edit Scheme...")
print("to specify the full path to rtl, Loop Report, or Xcode log file(s) to parse.\n")
exit(1)
}

for filename in CommandLine.arguments[1...] {
let rtlOmniParser = RTLOmniLineParser()
Expand All @@ -287,7 +293,7 @@ for filename in CommandLine.arguments[1...] {
do {
let data = try String(contentsOfFile: filename, encoding: .utf8)
let lines = data.components(separatedBy: .newlines)

for line in lines {
switch line {
case Regex("ID1:[0-9a-fA-F]+ PTYPE:"):
Expand All @@ -298,17 +304,14 @@ for filename in CommandLine.arguments[1...] {
// 2018-12-27 01:46:56 +0000 send 1f0e41a6101f1a0e81ed50b102010a0101a000340034170d000208000186a00000000000000111
loopIssueReportParser.parseLine(line)
case Regex("RL (Send|Recv) ?\\(single\\): [0-9a-fA-F]+"):
// 2019-02-09 08:23:27.605518-0800 Loop[2978:2294033] [PeripheralManager+RileyLink] RL Send (single): 17050005000000000002580000281f0c27a4591f0c27a447
// 2019-02-09 08:23:28.262888-0800 Loop[2978:2294816] [PeripheralManager+RileyLink] RL Recv(single): dd0c2f1f079e674b1f079e6769
// 2019-02-09 08:23:27.605518-0800 Loop[2978:2294033] [PeripheralManager+RileyLink] RL Send (single): 17050005000000000002580000281f0c27a4591f0c27a447
// 2019-02-09 08:23:28.262888-0800 Loop[2978:2294816] [PeripheralManager+RileyLink] RL Recv(single): dd0c2f1f079e674b1f079e6769
xcodeLogParser.parseLine(line)
default:
break
}


}
} catch let error {
print("Error: \(error)")
}
}