Giter VIP home page Giter VIP logo

Comments (13)

AppWerft avatar AppWerft commented on June 10, 2024

Awesome work, currently it is "only" the discoverer of services. I hope it will be more. Maybe the other BT-module (https://github.com/eyesore/appc-android-bluetooth/tree/master/android) is an inspiration.

from titanium-bluetooth.

hansemannn avatar hansemannn commented on June 10, 2024

@AppWerft feel free to also contribute!

from titanium-bluetooth.

hansemannn avatar hansemannn commented on June 10, 2024

@m1ga Exposed startScan on iOS so we have good parity there. Also renamed scanForPeripheralsWithServices to startScanWithServices which takes an array of UUID's.

from titanium-bluetooth.

m1ga avatar m1ga commented on June 10, 2024

👍 got it. I've changed my list

from titanium-bluetooth.

AppWerft avatar AppWerft commented on June 10, 2024

@m1ga Do you see a sense to start scan with different modes (BALANCED, LOW_LATENCY, LOW_POWER,OPPORTUNISTIC) ?

from titanium-bluetooth.

m1ga avatar m1ga commented on June 10, 2024

@AppWerft I didn't use BLE in any real-world project yet so I can't tell which scan mode is better but I think it's good to have a choice to set it. I've added getScanMode() and setScanMode() so you can set it yourself

from titanium-bluetooth.

AppWerft avatar AppWerft commented on June 10, 2024

OK, my thought was to use a method parameter … I think serious about BT apps.

from titanium-bluetooth.

hansemannn avatar hansemannn commented on June 10, 2024

Having those in modes is better for scalable API's. Messing up the parameters should be avoided.

from titanium-bluetooth.

AppWerft avatar AppWerft commented on June 10, 2024

OK I have added setter and getter for it. Do you mean it is better to use parameters in methods to keep clean the class from new properties. What kind of pattern do you prefere?

from titanium-bluetooth.

m1ga avatar m1ga commented on June 10, 2024

Like I've said in the previous comment: getter and setter is already implemented. I'll check your PR later and see what I can use

from titanium-bluetooth.

AppWerft avatar AppWerft commented on June 10, 2024

Ok, thsi was a parallel dev. anyway.

@Kroll.constant 
public static final int SCAN_MODE_BALANCED = ScanSettings.SCAN_MODE_BALANCED;
@Kroll.constant
public static final int SCAN_MODE_LOW_LATENCY = ScanSettings.SCAN_MODE_LOW_LATENCY;
@Kroll.constant
public static final int SCAN_MODE_LOW_POWER = ScanSettings.SCAN_MODE_LOW_POWER;
@Kroll.constant
public static final int CAN_MODE_OPPORTUNISTIC = ScanSettings.SCAN_MODE_OPPORTUNISTIC;

public final int DEFAULT_SCAN_MODE = SCAN_MODE_BALANCED;
private int scanmode = DEFAULT_SCAN_MODE;

……

@Kroll.method
public void setScanMode(int sm) {
	scanmode = sm;
}

@Kroll.method
public int getScanMode() {
	return scanmode;
}

from titanium-bluetooth.

m1ga avatar m1ga commented on June 10, 2024

Started to work on didDiscoverServices and didDiscoverCharacteristicsForService. Commited the code already but still have to test it tomorrow.

from titanium-bluetooth.

hansemannn avatar hansemannn commented on June 10, 2024

Closing this ticket for now, since detaching both modules will speed-up each module's process. Still planning to normalize it as soon as we know what API's can be exposed cross-platform.

from titanium-bluetooth.

Related Issues (20)

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.