Protocols
The following protocols are available globally.
-
This was taken straight from the objc.io book “Advanced Swift.” It’s so damn useful, that I have it made into a standard tool.
The original design was done by Ole Begemann and Chris Eidhof. I have modified it slightly; but not much.
It is fast all git-go.
A type that can efficiently “enqueue” and “dequeue” elements. It works on one element at a time. You cannot dequeue groups of elements.
See moreDeclaration
Swift
public protocol OLEB_Queue
-
If you conform to this protocol, you get a few basic Sequence attributes for free.
You’ll need to set up a sequence_contents Array (read/write), and set the Element type, and that’s about all.
This also gives you a read-only subscript.
This cannot be applied to enums, as it requires a stored property.
See moreDeclaration
Swift
public protocol RVS_SequenceProtocol : Sequence
-
This is a protocol that describes the basic transport abstraction for our bluetooth device connection. It will be specialized for Classic or BLE.
See moreDeclaration
Swift
internal protocol RVS_BTDriver_InterfaceProtocol : AnyObject
-
This protocol is an optional protocol that implements a “state machine,” where an instance can go from “unitialized,” to “initialized.”
See moreDeclaration
Swift
internal protocol RVS_BTDriver_State_Machine
-
This an internal extension to the public protocol
See moreDeclaration
Swift
internal protocol RVS_BTDriver_OBD_Command_Service_Command_Interpreter_Internal : RVS_BTDriver_OBD_Command_Service_Command_Interpreter
-
A base protocol for vendors.
See moreDeclaration
Swift
internal protocol RVS_BTDriver_VendorProtocol
-
This is the base protocol for command interpreters. It defines an Array of String, which is used to match the interpreter with the PID it is applied to.
See moreDeclaration
Swift
public protocol RVS_BTDriver_OBD_Command_Service_Command_Interpreter
-
This is the base protocol for command interpreters. It defines an Array of String, which is used to match the interpreter with the PID it is applied to.
The sequence conformance allows us to act as a sequence of String
See moreDeclaration
Swift
public protocol RVS_BTDriver_OBD_DTC_Container : Sequence where Self.Element == String
-
This protocol is for delegates for OBD devices.
See moreDeclaration
Swift
public protocol RVS_BTDriver_OBD_DeviceDelegate : AnyObject
-
Declaration
Swift
public protocol RVS_BTDriver_OBD_DeviceProtocol : RVS_BTDriver_DeviceProtocol
-
This is a specialization for the common ELM327 chipset.
See moreDeclaration
Swift
public protocol RVS_BTDriver_OBD_ELM327_DeviceProtocol : RVS_BTDriver_OBD_DeviceProtocol
-
This is a protocol for classes, structs or enums that want to “subscribe” to a device.
See moreDeclaration
Swift
public protocol RVS_BTDriver_DeviceSubscriberProtocol : RVS_BTDriver_SubscriberProtocol
-
Declaration
Swift
public protocol RVS_BTDriver_DeviceProtocol : AnyObject
-
This is a “base” subscriber protocol for accessing driver elements.
We require that subscribers be classes, so they will be referenced.
See moreDeclaration
Swift
public protocol RVS_BTDriver_SubscriberProtocol : AnyObject
-
This is the delegate for the driver instance. You should definitely do this.
See moreDeclaration
Swift
public protocol RVS_BTDriverDelegate : AnyObject
-
This represents the public face of a “property,” which maps to a bluetooth “characteristic.”
See moreDeclaration
Swift
public protocol RVS_BTDriver_PropertyProtocol : AnyObject
-
Declaration
Swift
public protocol RVS_BTDriver_ServiceSubscriberProtocol : RVS_BTDriver_SubscriberProtocol
-
Declaration
Swift
public protocol RVS_BTDriver_ServiceProtocol : AnyObject
-
This protocol allows aggregated instances to report stuff through the main driver, without breaking the fourth wall.
See moreDeclaration
Swift
internal protocol RVS_BTDriverCommunicatorTools