GithubHelp home page GithubHelp logo

steamclock / bluejay Goto Github PK

View Code? Open in Web Editor NEW
1.1K 31.0 96.0 17.63 MB

A simple Swift framework for building reliable Bluetooth LE apps.

License: MIT License

Objective-C 0.22% Swift 99.22% Ruby 0.56%
bluetooth swift ios

bluejay's People

Contributors

andeeliao avatar apike avatar avtr avatar brendanlensink avatar drama999 avatar falkorichter avatar justusvonbrandt avatar kylebrowning avatar larryonoff avatar mdxs avatar nbrooke avatar robbiet480 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bluejay's Issues

Repeat of connection without disconnect causes crash

Scan for item (user initiated button), do connect. If the user rescans the item (after successful / unsuccessful scan user hits button again), it will cause a crash.

This can be resolved with bluejay.disconnect, but they are then needed in every scenario - .success, .failure, .expired, error

Break library into multiple files

Currently Bluejay is all one file - we should split it, to the degree it makes sense, by class and/or what is appropriate to get the files to roughly 50-250 lines each.

Improve logging

Updating this issue to capture the newest direction for handling logging:

We've stopped using XCGLogger to avoid dependency conflicts. We've also commented out a lot of logs.

We should add back certain logs in the most crucial areas, as well as add a convenience method to log in a more uniformed format.

Turn off write to disk for the logger

Due to how much we're logging, this should be turned off for the time being in favour of allowing scanning with duplicates without blocking the main thread until we get a chance to revisit how to improve logging.

Configure browsable documentation

We should pick a popular/simple/helpful tool for generating simple API documentation out of our swift code with annotation from our comments.

Create Bluejay logo

We should have a logo for Bluejay. Typically we'd bring in a specialist for logo work, but @rachteo here at Steamclock is keen to do some initial experimentation, which is a great way to start. We may come up with something great, or worst case we'd have a starting point for a logo and illustration expert to refine.

Two potential starting points for a logo would be the Bluetooth logo, with its stylized B that if you squint hard enough could evoke a bird:

image

and obviously the image of a blue jay. Obviously we need to be distinctive and clearly different from the various trademarked blue jay logos out there, but they can serve as some inspiration.

image
image
image

Ideally the logo will look professionally executed but have an element of warmth and personality. One open source logo that I like for this aspect that also happens to depict a bird is the Bower logo:

image

Peripheral Cache call has Crash - "Attempt to insert non-property list object"

Using Bluejay SyncPeripheral call writeAndListen, which internally uses Bluejay Peripheral call cache(listeningCharacteristic: CharacteristicIdentifier)

crashes here :

UserDefaults.standard.set([bluejay.uuid.uuidString : newListenCache], forKey: Constant.listenCaches)

writing (example) :

[EAD75440-FEFC-4BCC-81CC-0328EABE2714 : [(serviceUUID: "036C0020-98BA-F401-F139-B510D0C303AD", characteristicUUID: "036C0022-98BA-F401-F139-B510D0C303AD")]

forKey

com.steamclock.bluejay.listenCaches

Consistent crash is Attempt to insert non-property list object

'Attempt to insert non-property list object {
    "EAD75440-FEFC-4BCC-81CC-0328EABE2714" =     (
        "(serviceUUID: \"036C0020-98BA-F401-F139-B510D0C303AD\", characteristicUUID: \"036C0022-98BA-F401-F139-B510D0C303AD\")"
    );
} for key com.steamclock.bluejay.listenCaches'

writeAndListen call :

writeAndListen(
                    writeTo:    OrthopulseBLEConst.SetUp.currentTime,
                    value:      UInt64(28),
                    listenTo:   OrthopulseBLEConst.Log.logEntry,
                    timeoutInSeconds : 20,
                    completion: {...}
   )

OrthopulseBLEConst.SetUp.currentTime is 
currentTime = CharacteristicIdentifier(uuid: "036C0015-98BA-F401-F139-B510D0C303AD", service: OrthopulseBLEConst.setUp)

logEntry is 
logEntry = CharacteristicIdentifier(uuid: "036C0022-98BA-F401-F139-B510D0C303AD", service: OrthopulseBLEConst.log)

Improve error messages

Many error messages can be either simplified or expanded upon to include more details when necessary.

This will save time later when testing and debugging.

Review and update access control

Right now in the middle of reorganizing our source code, there are times when it is not immediately clear what level of access certain code should have.

This is just an issue serving as a reminder to do a sanity check on our library's access control, and making sure we only expose what is critical.

Mainly just want to avoid giving developers too much access, especially to certain instance or static variables. Most accessible variables should probably be read only anyway, and I think a good API shouldn't require writing too much, or any, assignments.

Automated smoke testing

While fully unit testing Bluejay will need to wait until we have mocking in #8, we should at least build some way to do automated smoke testing and sanity checking. @nbrooke proposed a way of doing testing against an app running on a second iPhone, which would probably be a good start and be simpler than needing to run against specific Bluetooth hardware and firmware.

Rename async to run with backgroundTask

Bluejay async call needs a better name

The description in Bluejay is great, but the name doesn't reflect what it does -
"Run a background task using a syncrounous interface to the Bluetooth device."
(ps. spelling error - synchronous)

If the reason was "DispatchQueue.main.async", that works because it is dispatching a QUEUE asynchronously. The queue keyword provides the hint of how the call will work.

runTask (previous name ?) was better IMO.

Bluejay.runTasksAsync ?
Bluejay.queueAsync ?

Test early version of Bluejay API

Find out what are minimum steps to use the current version of Bluejay effectively, and get an overall sense of its strengths and weaknesses, so that we can better improve its API.

Improve scan API

Should probably also rename the current scan function, as it connects on a successful scan.

Update README for 0.1

README hasn't been updated, but we've made some significant changes towards 0.1. Time to do a full-pass of the README and update as necessary.

Test and handle background scanning

From WWDC lab, it seems like setting allowDuplicates to true and service identifiers to nil won't work when the app is background.

If that is true, Bluejay may need to explicitly call the stopped block and provide clear error messages explaining the situation.

Fill out README

Before we make Bluejay public, we should fill out a clear and concise Readme about what it's for and how to use it.

Bluetooth mocking and simulation app for automated and manual testing

This is surprisingly complicated and gnarly to do, but would be a valuable thing both for maintaining Bluejay and our various Bluetooth apps. Ideally we could simulate specific cases such as backgrounding, communication failures, and so on. These are challenging to mock and simulate because they depend on measuring and reproducing what iOS is doing in various edge cases.

In addition to being helpful for automated testing, mocking would allow folks to do basic testing in the simulator, which would be quite helpful.

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.