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

ofxiOSGetDeviceInfo for querying device type and major / minor versions. #2962

Merged
merged 1 commit into from
Jun 1, 2014

Conversation

ofTheo
Copy link
Member

@ofTheo ofTheo commented May 4, 2014

As discussed in #2872

This is a more future proof approach for determining version of iOS devices ( vs the older approach of listing every single possible device i.e.: OFXIOS_DEVICE_IPHONE_3GS OFXIOS_DEVICE_IPHONE_3GS_CHINA etc )

It returns ofxiOSDeviceInfo which contains device type, device string and major and minor versions of the device.
In the future we could add more info to ofxiOSDeviceInfo i.e.: bHasCamera bRetina etc

Here is how it currently works with the an iPhone 5 and the simulator.

ofxiOSDeviceInfo info = ofxiOSGetDeviceInfo();
cout << "device type " << (int)info.deviceType <<endl;
cout << "device string " << info.deviceString <<endl;
cout << "versionMajor " << info.versionMajor <<endl;
cout << "versionMinor " << info.versionMinor <<endl;

device type 0  // ( OFXIOS_DEVICE_IPHONE )
device string iPhone5,2
versionMajor 5
versionMinor 2

device type 0 // ( OFXIOS_DEVICE_IPHONE )
device string iPhone Simulator
versionMajor 0
versionMinor 0

pinging @julapy @admsyn

…ains type, device string and major and minor versions of the device. Relates to #2872
@ofTheo ofTheo added this to the 0.8.2 milestone May 4, 2014
@bilderbuchi
Copy link
Member

comparison operators which smartly compare major,minor versions would be useful, I'd think.

@julapy
Copy link
Member

julapy commented May 5, 2014

@ofTheo, like it!
it would good if there also was a string to tell you the device model, ie iPhone4, iPhone5s, iPadAid etc.
as @danoli3 pointed out, the major number does not always corrolate with the iPhone model number.
we have the ofxiOSDeviceType already, so many a ofxiOSDeviceModel?
and ofxiOSGetDeviceInfo() would contain the logic for working out the device model...
what do you think?

@kylemcdonald
Copy link
Contributor

just reviewing this during the irc meeting, it looks fine to merge and then add @julapy's suggestion after merging.

kylemcdonald added a commit that referenced this pull request Jun 1, 2014
ofxiOSGetDeviceInfo for querying device type and major / minor versions.
@kylemcdonald kylemcdonald merged commit bd0c366 into master Jun 1, 2014
@bilderbuchi bilderbuchi deleted the feature_ios_device branch May 3, 2015 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants