Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simulate BLE scans from the phone UI #1140

Merged
merged 8 commits into from
Mar 29, 2024

Commits on Mar 28, 2024

  1. 🚨 Add a new key to each element in the beacon/device list

    Without this change, we get an error
    
    ```
    Warning: Each child in a list should have a unique "key" prop.
    
    Check the render method of `BluetoothCardList`. See https://reactjs.org/link/warning-keys for more information.
    BluetoothCard@ionic://localhost/dist/bundle.js:21253:18
    BluetoothCardList@ionic://localhost/dist/bundle.js:21666:21
    ```
    
    With this change, the error does not occur
    shankari committed Mar 28, 2024
    Configuration menu
    Copy the full SHA
    48f4847 View commit details
    Browse the repository at this point in the history
  2. 🔧 Add the ability to add new beacons to the list

    We currently have two hardcoded beacons in the list. But everybody is going to
    have their own beacon for testing. Let's make it possible to add new UUIDs
    
    Changes:
    - New field to enter the UUID
    - Add button
    - When add button is clicked, add new entry with the specified UUID and dummy
      values
    
    Testing done:
    Entered two separate UUIDs and clicked "Add"
    Two new entries were created in the list
    shankari committed Mar 28, 2024
    Configuration menu
    Copy the full SHA
    05b2664 View commit details
    Browse the repository at this point in the history

Commits on Mar 29, 2024

  1. 🔧 Allow users to add new beacons to be scanned through the UI

    - Creates a new set of fields at the botton of the page for the UUID,
      identifier, major and minor fields
    - Adds a new "Add" button
    - When the "Add" button is pressed, we add a new UUID entry to the default list
    - After the new entry is added, we clear out the old values to prepare for a
      new entry
    
    Testing done:
    Added three new entries. They were displayed in the list
    e-mission/e-mission-docs#1062 (comment)
    shankari committed Mar 29, 2024
    Configuration menu
    Copy the full SHA
    8bc0457 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8f9b130 View commit details
    Browse the repository at this point in the history
  3. ♻️ Display the values that will change (UUID, major, minor)

    Instead of the statically coded name/identifier
    This involved changing the text size so that we could see the UUID
    I wonder if we should make the UUID the subtitle and the major:minor the title
    
    Testing done:
    e-mission/e-mission-docs#1062 (comment)
    shankari committed Mar 29, 2024
    Configuration menu
    Copy the full SHA
    58b2b0a View commit details
    Browse the repository at this point in the history
  4. ✅ Display the result of the callback in the list + test button

    We don't know what the result will look like when there are multiple beacons with the same UUID, so we just stringify and display the result.
    We cannot test this without having an actual BLE beacon, so I have added a "fake callback button to simulate a callback"
    
    Changes:
    - stringify the result in `didDetermineStateForRegion` and pass it in to
      `setRangeStatus`
    - Change the BluetoothCard to display the `device.result` as Card.Content
    - Add a new button to fake a callback for a device by getting the delegate and
      invoking the `didDetermineStateForRegion` method on it with the device
    - Remove the existing result in the device before invoking the callback to
      avoid nested results
    
    Testing done:
    e-mission/e-mission-docs#1062 (comment)
    shankari committed Mar 29, 2024
    Configuration menu
    Copy the full SHA
    29e434c View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    022ccec View commit details
    Browse the repository at this point in the history
  6. ✨ Implement the two stage range after monitor process suggested by iOS

    Changes:
    - in the monitor callback, launch the range call with the UUID that was found
    - change the fake callback to call the range callback 500ms after the merge
      callback
    - store the two results separately
    - display the two results separately using different background colors
    shankari committed Mar 29, 2024
    Configuration menu
    Copy the full SHA
    7c70840 View commit details
    Browse the repository at this point in the history