davidhubbard / gobbed Goto Github PK
View Code? Open in Web Editor NEWFree Software for connecting to your vehicle's data buses
License: Other
Free Software for connecting to your vehicle's data buses
License: Other
Gobbed already runs on many of the platforms Apache Cordova supports. (Note: gobbed does not use Apache Cordova.)
The same flexibility which allows Cordova to target iOS should make it easy to port the gobbed bluetooth layer to iOS.
The chrome.serial API is queried in the code, and probably works. But it just says (unsupported) for now.
Currently the js code to communicate with an ELM327 chip is too tightly coupled into the bluetooth code.
The only cheapest test platform for this (that I know of) is a full-blown laptop (Linux, OS X, Windows) attached to a USB ELM327 device. (USB ELM327 devices present as USB serial ports and would use the chrome.serial API.)
Other possibilities of which I have no direct knowledge:
The app currently blindly does this:
It would be nice to give the user control:
gobbed is compiled with MIN_SDK_TARGET of API 9 (Android 2.3 Gingerbread). There are still a lot of Gingerbread devices in the wild.
But WebViewFragment ended up being the cleanest way to get around Android's "feature" that it will tear down and re-create your MainActivity every time the screen is rotated...and for some other changes which I can't remember at the moment.
This bug is to fix the tricky balancing act of creating a WebView and attaching all the notifications to it but only if the device is below API 11.
Here is some code I wrote attempting to do SDP on devices that have not been paired with (result is that getUuids() returns null because the device's UUIDs are not in the Android Bluetooth cache)
filter = new IntentFilter(BluetoothDevice.ACTION_UUID);
gobbedWebView.parentActivity.registerReceiver(mReceiver, filter);
// Must wait for the discovery method to finish before calling another method.
// (Methods cannot be run in parallel.)
// http://stackoverflow.com/questions/14812326/android-bluetooth-get-uuids-of-discovered-devices
} else if (BluetoothDevice.ACTION_UUID.equals(action)) {
/*if (Build.VERSION.SDK_INT >= 15 && dev.getUuids() == null) { // API 15: Icecream MR1
// If you have never attempted to pair or connect with the device, UUIDs will
// not be cached.
if (!dev.fetchUuidsWithSdp()) {
Log.w(TAG, "fetchUuidsWithSdp() returned false. Sanity check failed?");
}
}*/
Log.w(TAG, "ACTION_UUID:");
BluetoothDevice dev = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
Log.w(TAG, "ACTION_UUID: " + dev.getAddress());
boolean isNewDev = mDeviceList.put(dev.getAddress(), dev) == null;
gobbedWebView.runJsCallbacks("bluetooth", isNewDev ? "addCb" : "devCb",
findDevIndex(dev));
Tasker integration to allow setting up profiles based on states and events from OBD. The possibilities are limitless:
and so much more..
Since this app can run on many platforms, it would be nice to have an account (or may be using Google Play Games?) to keep things in sync. This can be to view all error codes and/or bookmarked reports from any device.
The current js code always reloads the entire device list, so an ACTION_STATE_CHANGED that fires onAdapterStateChanged will see a new device even though onDeviceAdded is not called.
See the TODO in GobbedBluetooth.onActionStateChanged().
The app has only been tested using Android Studio. Make an Eclipse project and test it.
WebView has support for some useful items. Should add them to the nav bar context menu (next to the soft buttons at the bottom of some android devices):
The current js code does not pass around a dictionary with device name + MAC address, it just passes around a single string (MAC address).
It shouldn't be too difficult to fix this to also pass the device name.
Then the interface can be changed to show the device name.
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.