Use the SCiO address to connect to the SCiO.
Call the connectDevice() method with the SCiO device to connect to.
The following code sample connects the mobile device to a SCiO sensor:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
__weak typeof(&*self)weakSelf = self;
[[CPScioDevice sharedInstance] connectDevice:self.currentDevice success:^{
[weakSelf toastWithTitle:@"SCiO is connected" message:@"SCiO device connected successfully"];
} failure:^(NSError *error) {
dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf alertWithTitle:error.userInfo[NSLocalizedDescriptionKey] message:error.userInfo[NSLocalizedFailureReasonErrorKey]];
});
}];
__weak typeof(&*self)weakSelf = self; [[CPScioDevice sharedInstance] connectDevice:self.currentDevice success:^{ [weakSelf toastWithTitle:@"SCiO is connected" message:@"SCiO device connected successfully"]; } failure:^(NSError *error) { dispatch_async(dispatch_get_main_queue(), ^{ [weakSelf alertWithTitle:error.userInfo[NSLocalizedDescriptionKey] message:error.userInfo[NSLocalizedFailureReasonErrorKey]]; }); }];
__weak typeof(&*self)weakSelf = self;

    [[CPScioDevice sharedInstance] connectDevice:self.currentDevice success:^{

        [weakSelf toastWithTitle:@"SCiO is connected" message:@"SCiO device connected successfully"];

    } failure:^(NSError *error) {

        dispatch_async(dispatch_get_main_queue(), ^{

            [weakSelf alertWithTitle:error.userInfo[NSLocalizedDescriptionKey]  message:error.userInfo[NSLocalizedFailureReasonErrorKey]];

        });

    }];