RVS_BTDriver_iOS_Test_Harness_MainTableViewController

class RVS_BTDriver_iOS_Test_Harness_MainTableViewController : RVS_BTDriver_iOS_Test_Harness_Base_ViewController
extension RVS_BTDriver_iOS_Test_Harness_MainTableViewController: RVS_BTDriverDelegate
extension RVS_BTDriver_iOS_Test_Harness_MainTableViewController: RVS_BTDriver_DeviceSubscriberProtocol
extension RVS_BTDriver_iOS_Test_Harness_MainTableViewController: UITableViewDataSource
extension RVS_BTDriver_iOS_Test_Harness_MainTableViewController: UITableViewDelegate
  • The table cell prototype reuse ID

    Declaration

    Swift

    let cellReuseIDentifier: String
  • The segue that will bring in a device details page.

    Declaration

    Swift

    let displaySegueID: String
  • This is the index that indicates the segmented Switch is in “not scanning” mode.

    Declaration

    Swift

    static let segmentedSwitchIsOffIndex: Int
  • This is the index that indicates the segmented Switch is in “scanning” mode.

    Declaration

    Swift

    static let segmentedSwitchIsOnIndex: Int
  • The color to use for the segmented switch when not scanning.

    Declaration

    Swift

    static let redSelectedColor: UIColor
  • The color to use for the segmented switch when scanning.

    Declaration

    Swift

    static let greenSelectedColor: UIColor
  • This is set to true, if the app was scanning before it segued.

    Declaration

    Swift

    internal var internal_wasScanning: Bool
  • The image that we display if there is no Bluetooth available.

    Declaration

    Swift

    @IBOutlet
    weak var noBTImageView: UIImageView!
  • The container view for the controls and table, available if there is an active Bluetooth connection.

    Declaration

    Swift

    @IBOutlet
    weak var activeBTItemContainerView: UIView!
  • The table that displays discovered devices.

    Declaration

    Swift

    @IBOutlet
    weak var devicesTableView: UITableView!
  • The scanning/not scanning switch.

    Declaration

    Swift

    @IBOutlet
    weak var scanModeSegmentedSwitch: UISegmentedControl!
  • This is required for the subscriber support.

    Declaration

    Swift

    var _uuid: UUID!

IBAction Internal Instance Methods

  • The scanning/not scanning switch changed.

    Declaration

    Swift

    @IBAction
    func scanModeSwitchChanged(_ inSwitch: UISegmentedControl)

    Parameters

    inSwitch

    The switch instance.

RVS_BTDriverDelegate Support

  • Called when the driver encounters an error.

    Declaration

    Swift

    public func btDriver(_ inDriver: RVS_BTDriver, encounteredThisError inError: RVS_BTDriver.Errors)

    Parameters

    inDriver

    The driver instance making the callback.

    encounteredThisError

    The error that was encountered.

RVS_BTDriver_DeviceSubscriberProtocol Support

  • Called when the device encounters an error.

    Declaration

    Swift

    func subscribedDevice(_ inDevice: RVS_BTDriver_DeviceProtocol, encounteredThisError inError: RVS_BTDriver.Errors)

    Parameters

    inDevice

    The device instance making the callback.

    encounteredThisError

    The error that was encountered.

  • Called when a new service is added to the device instance.

    Declaration

    Swift

    public func device(_ inDevice: RVS_BTDriver_DeviceProtocol, serviceAdded inService: RVS_BTDriver_ServiceProtocol)

    Parameters

    inDevice

    The device instance making the callback.

    serviceAdded

    The new service that was added to the device.

  • Called when the device wants us to update our status.

    Declaration

    Swift

    public func deviceStatusUpdate(_ inDevice: RVS_BTDriver_DeviceProtocol)

    Parameters

    inDevice

    The device instance making the callback.

  • Called when the device encounters an error.

    Declaration

    Swift

    public func device(_ inDevice: RVS_BTDriver_DeviceProtocol, encounteredThisError inError: RVS_BTDriver.Errors)

    Parameters

    inDevice

    The device instance making the callback.

    encounteredThisError

    The error that was encountered.

UITableViewDataSource Support

  • Declaration

    Swift

    func tableView(_ inTableView: UITableView, numberOfRowsInSection inSection: Int) -> Int

    Parameters

    inTableView

    The table view that called this.

    numberOfRowsInSection

    An integer, with the 0-based section (always 0).

    Return Value

    The number of rows (number of devices).

  • Called to create a cell instance to populate a table cell.

    Declaration

    Swift

    func tableView(_ inTableView: UITableView, cellForRowAt inIndexPath: IndexPath) -> UITableViewCell

    Parameters

    inTableView

    The table view that called this.

    cellForRowAt

    An IndexPath to the selected cell that needs populating.

    Return Value

    A newly-created cell instance.

UITableViewDelegate Support

  • This is called when someone taps on a row.

    We bring in the inspector for that device, and deselect the row.

    Declaration

    Swift

    func tableView(_ inTableView: UITableView, willSelectRowAt inIndexPath: IndexPath) -> IndexPath?

    Parameters

    inTableView

    The table view that called this.

    willSelectRowAt

    An IndexPath to the selected row.

    Return Value

    An IndexPath, if the row is to remain selected and highlighted. It is always false, and we immediately deselect the row, anyway.

  • Indicate that a row can be edited (for left-swipe delete).

    Declaration

    Swift

    func tableView(_ inTableView: UITableView, canEditRowAt inIndexPath: IndexPath) -> Bool

    Parameters

    inTableView

    The table view being checked

    canEditRowAt

    The indexpath of the row to be checked.

    Return Value

    true, always.

  • Called to do a delete action.

    Declaration

    Swift

    func tableView(_ inTableView: UITableView, commit inEditingStyle: UITableViewCell.EditingStyle, forRowAt inIndexPath: IndexPath)

    Parameters

    inTableView

    The table view being checked

    commit

    The action to perform.

    forRowAt

    The indexpath of the row to be deleted.

Internal Base Class Override Instance Methods

  • Called after the view has completely loaded.

    Declaration

    Swift

    override func viewDidLoad()
  • Called just before the view is to lay out its various subviews.

    Declaration

    Swift

    override func viewWillLayoutSubviews()
  • This is called when the screen is about to appear.

    Declaration

    Swift

    override func viewWillAppear(_ inAnimated: Bool)
  • This is called as we prepare to open the device inspector screen. We use it to associate the device instance with the screen.

    Declaration

    Swift

    override func prepare(for inSegue: UIStoryboardSegue, sender inSender: Any?)

    Parameters

    for

    The segue object.

    sender

    The context we attached to the segue (the device object).

Internal Instance Methods

  • Sets up the UI Items.

    Declaration

    Swift

    func setup()