Rightpoint / RZBluetooth

Core Bluetooth helper library
Other
136 stars 47 forks source link

Turning RZMockBluetooth into a framework #62

Closed nickls closed 5 years ago

nickls commented 7 years ago

Adding necessary components and project changes to make RZMockBluetooth build as a FW. This is helpful as it allows the FW to be included in projects without using pods and when using git submodules.

Also minor changes:

Let me know if you would prefer these minor changes in their own PR.

KingOfBrian commented 7 years ago

Thanks a lot @nickls, it looks good! I was a bit unsure about isScanning since it looks like it's only a private ivar, and isn't exposed publicly looking at CBCentralManager.h, but I see no harm in adding it. Out of curiosity, why do you need it?

I have to check out the framework changes, but should be able to merge soon. One small nit-pick is the indentation on the peripheralName: tags is off.

nickls commented 7 years ago

It is used in some of the legacy code I built tests for -- knowing when to restart the scanning.

I just checked CBCentralManager.h and it is available there and isn't market private am I missing something?

@property(nonatomic, assign, readonly) BOOL isScanning NS_AVAILABLE(NA, 9_0);

Also, found it in the docs.

nickls commented 7 years ago

Just fixed the indentation issue, good call that was ugly. :-D

Thanks for making such a great library.

cpatterson-lilly commented 7 years ago

@nickls Just curious, if I'm already using RZBMockBluetooth via CocoaPods, will this change how I use it in my test targets?

cpatterson-lilly commented 7 years ago

@nickls Why append the word "Kit" to the framework? "RZBMockBluetooth" is unique enough on its own, matches the existing umbrella header, and the main framework does not use that suffix.

nickls commented 7 years ago

no people can continue to use RZBMockBluetooth via CocoaPods as they always have.

@cpatterson-lilly I was trying to follow convention and to make sure it was obviously a different target in the dropdown. Happy to drop the kit if you would prefer.

KingOfBrian commented 7 years ago

Yea, I'd prefer to drop Kit to keep the naming consistent. Sorry for the delay here, the PR is much appreciated!

Soulphalanx commented 7 years ago

Can the framework scheme be shared so it's compatible with Carthage as well?

nickls commented 7 years ago

I've renamed the framework as requested and built it using Carthage to test.

Let me know if you want to see any other changes. Thanks again for making this!

KingOfBrian commented 7 years ago

Hey @nickls , sorry for the delay, was sick all week. Any chance you could make a PR of just the framework changes?

Also, looking at the name change, I think I'd rather expose the RZBMockPeripheral *peripheral on the RZBSimulatedConnection for configuration rather than pass in configuration options. This would allow: ie:

RZBSimulatedConnection *connection = [simCentral connectionForIdentifier:uuid];
connection.peripheral.name = @"My Name";
connection.peripheral.RSSI = @88;

Sorry for the late-breaking opinion on this, I just think it will be a bit more useful for default RSSI configuration.