JuulLabs / able

Able: Android Bluetooth Low Energy library
Apache License 2.0
160 stars 11 forks source link

Split suspendUntilConnectionState into specialized functions #70

Closed twyatt closed 4 years ago

twyatt commented 4 years ago

Having a function specific for suspension while waiting for connect and disconnect allowed for more informative logging and more readable code.

For example, reaching a disconnected state is only a failure while suspending until a connected state (so it just complicated the function when the function was used for disconnect).

codecov[bot] commented 4 years ago

Codecov Report

Merging #70 into develop will increase coverage by 0.05%. The diff coverage is 92.00%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop      #70      +/-   ##
=============================================
+ Coverage      83.18%   83.23%   +0.05%     
- Complexity        55       57       +2     
=============================================
  Files             14       14              
  Lines            339      352      +13     
  Branches          32       34       +2     
=============================================
+ Hits             282      293      +11     
  Misses            48       48              
- Partials           9       11       +2     
Impacted Files Coverage Δ Complexity Δ
core/src/main/java/gatt/GattConnection.kt 100.00% <ø> (ø) 0.00 <0.00> (ø)
core/src/main/java/device/CoroutinesDevice.kt 96.77% <90.90%> (-3.23%) 5.00 <1.00> (+1.00) :arrow_down:
core/src/main/java/gatt/CoroutinesGatt.kt 58.82% <92.85%> (+11.45%) 11.00 <1.00> (+1.00)