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

Support Ganglion v3 firmware detection #7

Draft
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

philippitts
Copy link
Member

No description provided.

@philippitts philippitts force-pushed the support-ganglion-v3-firmware-detection branch 6 times, most recently from 4ccca00 to dc0d6c1 Compare September 22, 2023 16:49
Copy link
Member

@retiutut retiutut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need clarification on a few places. Other comments are towards approval.

.github/workflows/cppcheck.yml Show resolved Hide resolved
.gitignore Show resolved Hide resolved
public static void main(String[] args) throws GanglionError {
GanglionDevice[] devices = GUIHelper.scan_for_ganglions(args[0], 3);
for (GanglionDevice device : devices) {
System.out.println("Identifier = " + device.identifier + ", Mac Address = " + device.mac_address
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I take it this test is passing? Didn't see a shared test result.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It passes for me, but it would be better if you also ran the test on your side so we can confirm it works on more than just my device.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

public static void main(String[] args) throws GanglionError {
GanglionDevice[] devices = GUIHelper.scan_for_ganglions(3);
for (GanglionDevice device : devices) {
System.out.println("Identifier = " + device.identifier + ", Mac Address = " + device.mac_address
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here. Result of test?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It passes for me, but it would be better if you also ran the test on your side so we can confirm it works on more than just my device.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

std::string identifier = peripheral.identifier ();

if (strncmp (identifier.c_str (), "Ganglion", 8) == 0 ||
strncmp (identifier.c_str (), "Simblee", 7) == 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we still checking for the name here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The algorithm goes something like this:

  1. Scan for all devices
  2. For each found device check if it's a Ganglion (which means it's identifier has either Ganglion or Simblee)
  3. For each found Ganglion, temporarily connect and get the software revision string which describes the firmware version

On MacOS the device identifier is still Simblee - that hasn't changed. The fix is that we don't use the device identifier to determine the firmware version. We use the actual Software Revision Bluetooth characteristic advertised by the firmware. Note that we can't check that characteristic when using the dongle, so it's still important to have the firmware version in the advertised name for those connections.

When using the dongle, I believe the identifier is reported correctly on MacOS (though this is worth double checking).

@philippitts
Copy link
Member Author

@retiutut can you test on your MacOS machine? I don't have access to one at the moment.

@retiutut retiutut force-pushed the support-ganglion-v3-firmware-detection branch from c05ea75 to 91082ff Compare September 26, 2023 16:47
@philippitts philippitts marked this pull request as draft November 2, 2023 20:41
@philippitts philippitts removed the request for review from retiutut November 2, 2023 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants