-
Notifications
You must be signed in to change notification settings - Fork 9
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
base: master
Are you sure you want to change the base?
Conversation
4ccca00
to
dc0d6c1
Compare
dc0d6c1
to
f444bfe
Compare
There was a problem hiding this 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.
java-package/openbci_gui_helpers/src/main/java/openbci_gui_helpers/GUIHelper.java
Show resolved
Hide resolved
java-package/openbci_gui_helpers/src/main/java/openbci_gui_helpers/GUIHelper.java
Outdated
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std::string identifier = peripheral.identifier (); | ||
|
||
if (strncmp (identifier.c_str (), "Ganglion", 8) == 0 || | ||
strncmp (identifier.c_str (), "Simblee", 7) == 0) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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:
- Scan for all devices
- For each found device check if it's a Ganglion (which means it's identifier has either Ganglion or Simblee)
- 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).
@retiutut can you test on your MacOS machine? I don't have access to one at the moment. |
c05ea75
to
91082ff
Compare
No description provided.