Git Product home page Git Product logo

controller-sdk-ios's People

Contributors

ajemoskowitz avatar quangctkm9207 avatar tdle94 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

tdle94

controller-sdk-ios's Issues

Target Integrity issue when building in new XCode (12.3)

In the recent XCode version(12.3),
when you added the framework, and click Build or Run, the following issue might appear.
"Target Integrity: Building for iOS Simulator but the linked and embedded framework .... was built for iOS + iOS Simulator".

Screen Shot 2020-12-30 at 9 52 13

How to connect Aroma Shooter automatically using serial

Hi everyone,

Because there are many cases that we connect an Aroma Shooter automatically to reduce one step for users.
I would like to propose a solution like the following in which the app will automatically scan the devices nearby and connect to your intended Aroma Shooter using its serial number.

import Foundation
import UIKit
import AromaShooterControllerSwift

class ViewController: UIViewController {
   let asController = AromaShooterController.sharedInstance
   public var connectedDevices: [AromaShooter] = []// Just to comfort iOS Bluetooth auto-disconnection if there is no reference

   
   override func viewWillAppear(_ animated: Bool) {
     super.viewWillAppear(animated)

     scanAndAutoConnect()
   }

    private func scanAndAutoConnect() {
      asController.startScanning()
      asController.delegate = self
  }
}

extension ViewController: AromaShooterDelegate {
  func aromaShooter(didDiscoverDevice device: AromaShooter) {
    // Check if this discovered device has the same serial that you want to connect
    // For example: the serial number is ASN2A00001
    if device.peripheral.name == "ASN2A00001" {
      asController.connect(aromaShooters: [device])
      connectedDevices.append(device)
      asController.stopScanning()
    }
  }
  
  func aromaShooter(didConnectDevice device: AromaShooter) {
    
  }
  
  func aromaShooter(didDisconnectDevice device: AromaShooter) {
    
  }
}

if you get any issue with this or have a better solution, please give a comment in this thread.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.