RVS_BTDriver_OBD_Device_TransactionStruct
public struct RVS_BTDriver_OBD_Device_TransactionStruct
This struct will contain a transaction for an OBD device. OBD transactions are atomic and single-threaded. There can only be one going to a device at a time.
-
This is the OBD device instance, running the transaction.
Declaration
Swift
public let device: RVS_BTDriver_OBD_DeviceProtocol!
-
This is the raw String value of the command being sent (it may be a format string).
Declaration
Swift
public let rawCommand: String!
-
This is any interpreter, containing parsed data.
Declaration
Swift
public let interpreter: RVS_BTDriver_OBD_Command_Service_Command_Interpreter!
-
This is the command, filled out (it may be the same as the rawCommand, but a format will have values substituted).
Declaration
Swift
public var completeCommand: String!
-
This is any data that was returned from the OBD adapter.
Declaration
Swift
public var responseData: Data!
-
This is the response, “cleaned,” and converted to a String (if possible).
Upon being set, we execute the parser.
Declaration
Swift
public var responseDataAsString: String!
-
Any error that may have occurred.
Declaration
Swift
public var error: RVS_BTDriver.Errors!
-
Initializer, with most fields optional.
Declaration
Swift
public init(device inDevice: RVS_BTDriver_OBD_DeviceProtocol!, rawCommand inRawCommand: String, completeCommand inCompleteCommand: String, responseData inResponseData: Data! = nil, responseDataAsString inResponseDataAsString: String! = nil, error inError: RVS_BTDriver.Errors! = nil, interpreter inInterpreter: RVS_BTDriver_OBD_Command_Service_Command_Interpreter! = nil)
Parameters
device
Required. The device that is running the transaction. It can be nil for testing purposes, but should not be nil, otherwise.
rawCommand
Required. This is the raw String value of the command being sent (it may be a format string).
completeCommand
Required. This is the command, filled out (it may be the same as the rawCommand, but a format will have values substituted).
responseData
Optional. This is any data that was returned from the OBD adapter.
responseDataAsString
Optional. If the command can be represented as a String, that is set here.
interpreter
This is an interpreter that was created to parse and report the data.
error
Optional. Any error that may have occurred.
-
Readable text description.
Declaration
Swift
public var description: String { get }