kickingvegas / YmsCoreBluetooth

A block-based framework for building Bluetooth 4.0 Low Energy (aka Smart or LE) iOS and OS X applications using the CoreBluetooth API. Includes Deanna and DeannaMac, applications to communicate with a TI SensorTag for iOS and OS X respectively.
Other
524 stars 128 forks source link

Add simple version int constant #82

Closed hongkongkiwi closed 10 years ago

hongkongkiwi commented 10 years ago

Hi there,

I've written a framework to abstract YmsCoreBluetooth and it works well for both IOS6 and IOS7 versions. Currently I need to detect the difference in versions and compile using a different method.

In your YmsCBCentralManager you have a string constant called: #define kYMSCBVersion "0.946"

This is very great for checking at runtime, however I need to do some compile time checks which you cannot do with strings. I've added this above so I can do a simple compile time check: #define kYMSCBVersionNumber 946

I propose a very minor change of adding this as well as the string constant and keeping them both up to date, this will allow simple pre-processor checks and will save me having to add it every single time I clone.

For the current version I propose to have

#define kYMSCBVersionNumber 1001
#define kYMSCBVersion "1.01"
kickingvegas commented 10 years ago

Proposal for integer version number define accepted. Will use a factor of 1000x to define the integer value from kYMSCBVersion.

So the implementation would be:

#define kYMSCBVersion "1.01"
#define kYMSCBVersionNumber 1010
kickingvegas commented 10 years ago

Also thanks for the suggestion! BTW, if you can, send me an email and let me know what you're using YmsCoreBluetooth for. I'd like to start compiling a list of projects using it.

charles.choi@yummymelon.com

hongkongkiwi commented 10 years ago

Perfect thanks! I've sent you an email with a few details about our project.

kickingvegas commented 10 years ago

Change pushed to master. Please confirm and close.