Skip to content

Commit

Permalink
Merge pull request #92 from openxc/next
Browse files Browse the repository at this point in the history
Version number update
  • Loading branch information
RanjaniOS authored Sep 14, 2022
2 parents a3d870e + 13f1425 commit 5ecabd6
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 28 deletions.
8 changes: 4 additions & 4 deletions Example/openxcframework.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@
INFOPLIST_FILE = openxcframework/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 6.0.1;
MARKETING_VERSION = 7.0.0;
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = com.ford.openxcranjan;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -720,7 +720,7 @@
INFOPLIST_FILE = openxcframework/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 6.0.1;
MARKETING_VERSION = 7.0.0;
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = com.ford.openxcranjan;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -741,7 +741,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = G9RCZGP4B3;
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
Expand Down Expand Up @@ -772,7 +772,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = G9RCZGP4B3;
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
Expand Down
56 changes: 32 additions & 24 deletions openxcframework/VehicleManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -864,16 +864,20 @@ open class VehicleManager: NSObject {
}

fileprivate func protobufDignosticMessage(msg : Openxc_VehicleMessage){
print("DiagnosticResponse>>>>\(msg)")
// print("DiagnosticResponse>>>>\(msg)")
// build diag response message

// if let frame = (msg.diagnosticStitchResponse.frame){
// print(frame)
// self.protobufMultiFrameDignosticMessage(msg: msg)
// self.protobufMultiFrameDignosticMessage(msg: msg)
//
//
// }else{
//
if msg.diagnosticResponse.totalSize != 0 {
self.protobufMultiFrameDignosticMessage(msg: msg)
// return
}else{
let rsp : VehicleDiagnosticResponse = VehicleDiagnosticResponse()
//if let timestamp = msg.timestamp{
rsp.timeStamp = Int(truncatingIfNeeded:msg.timestamp)
Expand All @@ -891,7 +895,8 @@ open class VehicleManager: NSObject {
rsp.value = Int(truncating: msg.diagnosticResponse.value.numericValue as NSNumber)
print(msg.diagnosticResponse.value as Any)
}



if rsp.value != 0 {
rsp.success = true//msg.diagnosticResponse.success
}
Expand Down Expand Up @@ -929,41 +934,44 @@ open class VehicleManager: NSObject {

act.performAction(["vehiclemessage":rsp] as NSDictionary)
}
//}
}
}

/* fileprivate func protobufMultiFrameDignosticMessage(msg : Openxc.VehicleMessage){
fileprivate func protobufMultiFrameDignosticMessage(msg : Openxc_VehicleMessage){
print("DiagnosticResponse>>>>\(msg)")
// build diag response message
let rsp : VehicleDiagnosticResponse = VehicleDiagnosticResponse()
if let timestamp = msg.timestamp{
rsp.timeStamp = Int(truncatingIfNeeded:timestamp)
}
let frame = Int(msg.diagnosticStitchResponse.frame)
let rsp : VehicleDiagnosticResponse = VehicleDiagnosticResponse()
//if let timestamp = msg.timestamp{
rsp.timeStamp = Int(truncatingIfNeeded:msg.timestamp)
// let rsp : VehicleDiagnosticResponse = VehicleDiagnosticResponse()
//if let timestamp = msg.timestamp{
rsp.timeStamp = Int(truncatingIfNeeded:msg.timestamp)
// }
let frame = Int(msg.diagnosticResponse.frame)
if (frame != -1) {
if let payloadX = String(data: msg.diagnosticStitchResponse.payload, encoding: .utf8) {
if let payloadX = String(data: msg.diagnosticResponse.payload, encoding: .utf8) {
multiFramePayload = payloadX
return
}
}

//var payload : String = ""
if let payloadX = String(data: msg.diagnosticStitchResponse.payload, encoding: .utf8) {
if let payloadX = String(data: msg.diagnosticResponse.payload, encoding: .utf8) {
rsp.payload = multiFramePayload + payloadX
print("payload : \(rsp.payload)")

}
rsp.bus = Int(msg.diagnosticStitchResponse.bus)
rsp.message_id = Int(msg.diagnosticStitchResponse.messageId)
rsp.mode = Int(msg.diagnosticStitchResponse.mode)
if msg.diagnosticStitchResponse.hasPid {
rsp.pid = Int(msg.diagnosticStitchResponse.pid)
}
if let successValue = msg.diagnosticStitchResponse.success {
rsp.success = successValue //msg.diagnosticResponse.success
}
if msg.diagnosticStitchResponse.hasValue {
rsp.value = Int(truncating: msg.diagnosticStitchResponse.value as! NSNumber)
rsp.bus = Int(msg.diagnosticResponse.bus)
rsp.message_id = Int(msg.diagnosticResponse.messageID)
rsp.mode = Int(msg.diagnosticResponse.mode)
// if msg.diagnosticResponse.pid {
rsp.pid = Int(msg.diagnosticResponse.pid)
// }
//if let successValue = msg.diagnosticResponse.success {
rsp.success = msg.diagnosticResponse.success //msg.diagnosticResponse.success
// }
if msg.diagnosticResponse.hasValue {
rsp.value = Int(truncating: msg.diagnosticResponse.value as! NSNumber)
print(msg.diagnosticResponse.value as Any)

}
Expand Down Expand Up @@ -1005,7 +1013,7 @@ open class VehicleManager: NSObject {

act.performAction(["vehiclemessage":rsp] as NSDictionary)
}
}*/
}

/*fileprivate func protobufCanMessage(msg : Openxc_VehicleMessage){
// build CAN response message
Expand Down

0 comments on commit 5ecabd6

Please sign in to comment.