idevicesinc / sweetblue Goto Github PK
View Code? Open in Web Editor NEWBLE on Android, the easy way. THIS IS NOW DEPRECATED. Please visit website for info on new versions.
Home Page: https://sweetblue.io
License: GNU General Public License v3.0
BLE on Android, the easy way. THIS IS NOW DEPRECATED. Please visit website for info on new versions.
Home Page: https://sweetblue.io
License: GNU General Public License v3.0
Obviously opt-in...for UhOhs, asserts, maybe logging, etc., send a json packet to our server, perhaps then forwarded to flurry or whatever...direct flurry integration would be an annoying dependency but maybe there's some lightweight way to do it...hit their REST API directly or something.
Can be passed as an additional array field in the connection fail info struct.
Including latest API-level 21 features.
Should take pull requests, do some static analysis, code linting, etc., run against unit tests. Also have that fancy build:passing image (travis ci?) at the top of our README.
Pretty big task so it may get broken up more in the future.
This means that user can invoke a disconnect and then try to connect right after that. For now, if it's done fast enough, the disconnect task is cancelled out by the subsequent connect task and natively speaking the device never actually disconnects.
Don't remember bonding requests ever spinning indefinitely...default is 10 second timeout for now though, so maybe make this configurable.
Might have some other uses too...not sure.
Anecdotal evidence suggests that BLE can work better with WiFi disabled. If it's the case, and managing WiFi state is more than a simple method or two, then we can add explicit methods to the API so that user can disable WiFi before connecting, before OTAs, etc.
In addition, we can have config options (off by default of course) that gate whether WiFi is turned off automatically for such operations.
This supposedly clears the discovered services cache, which is necessary for any devices that can change their services on the fly.
This can help aid the user in making a decision on whether to continue retrying the connection.
This was in the old TODO file...will have to dig into code to see what this actually means.
Probably only possible for explicit turn-offs.
Obviously gated behind a config option.
It's theoretically possible that a scan task is indefinitely subject to line-cutting in the task queue. Perhaps have some time limit (configurable) past which (if we're autoscanning or infinitely scanning) the scan task is given the same priority as reads/writes. Also argument to be made that an explicit startScan() call should have a higher priority as well.
Right now this is handled by a static method and hardcoded in library guts.
This will let the connection fail callback provide more information as to why a txn failed.
Might gate this behind a BleManagerConfig option. Currently app logic has to take care of reconnect after an off/on cycle.
One can potentially flood the queue, putting tasks onto it faster than the queue can process them. Perhaps have enumerations for read/write/connect-fail callbacks indicating such a scenario, like if the queue has more than 100 tasks backed up. Actually maybe just for the read/write callback.
Currently user has to hook things up themselves...not a big lift for them but might be nice to have this done for them.
Need to have the back-end work with dependency injection, and not interface with Android Gatt layer directly. After that library logic will be unit-testable using a simulated gatt layer.
A read or write can fail do to exceeding timeout of 10 seconds or whatever it is. Is it useful for users to be able to set a backstop listener that catches operations that do end up succeeding after this time limit. This case hasn't been observed but is technically possible.
Before connecting, after connecting, after discovering services, etc.
User might want bonding to be a prerequisite to connecting, in which case we should fail connection with the appropriate reason.
This is what Android does with its View stack. Maybe helpful for us too?
Most of the wiring's in place in the back end...just a question of it being useful to expose this in the public API.
Some devices return true for this method even though BLE doesn't actually work. Perhaps there's a way to perform a fast side-effect-free operation to see if ble truly is supported.
That is, how many connection fail attempts it takes to say OK, let's use autoConnect.
That is, don't interleave such tasks across devices. See if this clears up the 129 error on experia when connecting to multiple devices, like at start up.
This means flushing out and standardizing logs meant for user of library, and then also gating public/private behind two config options, or perhaps a bitwise option for finer-grained control.
Not really sure of the use case or what the API would look like yet, but we are tracking this already so maybe some interface to it would be helpful. For example an app that is meant to work with one device (e.g. fitness tracker) may want to forgo scanning on app start up if the mac address is known...i.e. they create a new device explicitly and just try to connect.
Both of these classes are around 2000 lines of code...a lot of this is API docs but still a little bloated. Lots of their implementation is already pushed out into sub components, but should see if more can be done here.
This will involve splitting out a super class of BleManagerConfig and putting all the device-specific options in there, then having a method on BleDevice called setConfig. This is actually not a breaking change so can be implemented post v1.
data_int(), data_long(), data_string(), etc.
Never seen this take very long or spin indefinitely, but maybe should have a configurable limit.
This will allow state trackers to assert if/where they want to.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.