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

Centralmanager methods #25

Merged
merged 5 commits into from
Jun 21, 2017
Merged

Conversation

wsliaw
Copy link
Contributor

@wsliaw wsliaw commented Jun 21, 2017

Example:

centralManager.retrievePeripheralsWithIdentifiers([connectedPeripheral.identifier]);
centralManager.retrieveConnectedPeripheralsWithServices([TARGET_SERVICE_UUID]);

wsliaw added 3 commits June 21, 2017 18:04
retrievePeripheralsWithIdentifiers & retrieveConnectedPeripheralsWithServices

Signed-off-by: wilson <[email protected]>
Copy link
Owner

@hansemannn hansemannn left a comment

Choose a reason for hiding this comment

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

Left some minor changes, but looks very nice already! I'll add the method to the wiki once it's merged. Please also bump the version to 1.2.0, thx!


NSMutableArray<TiBluetoothPeripheralProxy*> *result = [NSMutableArray array];

for (id peripheral in peripherals) {
Copy link
Owner

Choose a reason for hiding this comment

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

Change to CBPeripheral *peripheral, since the type is determined by the array template-type

NSMutableArray<TiBluetoothPeripheralProxy*> *result = [NSMutableArray array];

for (id peripheral in peripherals) {
ENSURE_TYPE(peripheral, CBPeripheral);
Copy link
Owner

Choose a reason for hiding this comment

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

Remove this as well, see above.

@@ -26,6 +26,22 @@ @implementation TiBluetoothUtils
return result;
}

+ ( NSArray<NSUUID *> * _Nullable)NSUUIDArrayFromStringArray:(NSArray<id> *)array
Copy link
Owner

Choose a reason for hiding this comment

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

Should be (NSArray<NSString *> *)array, since the type must always be an NSString.

NSMutableArray<NSUUID*> *result = [NSMutableArray array];

for (id uuid in array) {
ENSURE_TYPE(uuid, NSString);
Copy link
Owner

Choose a reason for hiding this comment

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

Change to NSString *uuid and remove the ENSURE_TYPE.

wsliaw added 2 commits June 21, 2017 21:58
Signed-off-by: wilson <[email protected]>
@wsliaw
Copy link
Contributor Author

wsliaw commented Jun 21, 2017

Thanks for pointing out!

Copy link
Owner

@hansemannn hansemannn left a comment

Choose a reason for hiding this comment

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

LGMT, approved! Thank you @wsliaw! 🚀

@hansemannn hansemannn merged commit 2b9a529 into hansemannn:master Jun 21, 2017
@hansemannn
Copy link
Owner

hansemannn commented Jun 21, 2017

New release tagged and docs updated.

@wsliaw wsliaw deleted the centralmanager-methods branch June 22, 2017 06:30
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