BLE example fails with WRONG_OBJECT_TYPE and INVAL...
# help
f
When trying the ble/heart_rate.toit example (https://raw.githubusercontent.com/toitlang/toit/master/examples/ble/heart_rate.toit) I'm getting the following errors:
Copy code
******************************************************************************
Decoding by `jag`, device has version <2.0.0-alpha.81>
******************************************************************************
EXCEPTION error. 
WRONG_OBJECT_TYPE
  0: ble_release_resource_     <sdk>/ble.toit:947:3
  1: Resource_.close_.<block>  <sdk>/ble.toit:859:9
  2: Resource_.close_          <sdk>/ble.toit:853:3
  3: Resource_.<lambda>        <sdk>/ble.toit:851:14
  4: FinalizationStack_.ensure_finalization_task_.<lambda>.<block>.<block> <sdk>/core/finalization.toit:71:31
  5: catch.<block>             <sdk>/core/exceptions.toit:124:10
  6: catch                     <sdk>/core/exceptions.toit:122:1
  7: catch                     <sdk>/core/exceptions.toit:73:10
  8: FinalizationStack_.ensure_finalization_task_.<lambda>.<block> <sdk>/core/finalization.toit:71:11
  9: FinalizationStack_.ensure_finalization_task_.<lambda> <sdk>/core/finalization.toit:61:57
******************************************************************************
Copy code
******************************************************************************
Decoding by `jag`, device has version <2.0.0-alpha.81>
******************************************************************************
EXCEPTION error. 
INVALID_ARGUMENT
  0: ble_add_characteristic__  <sdk>/ble.toit:998:3
  1: ble_add_characteristic_.<block> <sdk>/ble.toit:994:5
  2: ble_run_with_quota_backoff_.<block> <sdk>/ble.toit:1055:60
  3: catch.<block>             <sdk>/core/exceptions.toit:124:10
  4: catch                     <sdk>/core/exceptions.toit:122:1
  5: catch                     <sdk>/core/exceptions.toit:85:10
  6: ble_run_with_quota_backoff_ <sdk>/ble.toit:1055:5
  7: ble_add_characteristic_   <sdk>/ble.toit:993:10
  8: LocalCharacteristic       <sdk>/ble.toit:506:17
  9: LocalService.add_characteristic <sdk>/ble.toit:444:12
 10: LocalService.add_notification_characteristic <sdk>/ble.toit:472:12
 11: main                      ble_heart_rate.toit:20:30
******************************************************************************
@mikkel.damsgaard do you have any idea before I start debugging?
It's
properties & BLE_GATT_CHR_F_READ
that is false and leads to the 'INVALID_ARGUMENT'.
I think that 'if' was missing checks for notify and indicate. I uploaded a PR.
k
Fixed in SDK v2.0.0-alpha.83 shipping in Jaguar v1.9.22 and Artemis v0.6.1.
2 Views