YUKAI / konashi-ios-sdk

konashi iOS SDK
http://konashi.ux-xu.com
Apache License 2.0
89 stars 37 forks source link

アプリ起動後初回のconnect後の[Konashi shared].activePeripheralがnil #66

Closed sagiii closed 9 years ago

sagiii commented 9 years ago

下記ViewController.mで, konashi-ios-sdkはここのmaster最新で生じました。

#import "ViewController.h"
#import "Konashi.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.

    [Konashi initialize];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(ready) name:KonashiEventReadyToUseNotification object:nil];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (IBAction)find:(id)sender {
    [Konashi find];
}

- (void)ready
{
    [Konashi pinMode:KonashiLED2 mode:KonashiPinModeOutput];
    [Konashi digitalWrite:KonashiLED2 value:KonashiLevelHigh];
}

@end
sagiii commented 9 years ago

起動後接続

接続完了(bluetoothアイコンが濃い)

一旦切断(konashiの給電を停止)

再度接続

接続完了

LEDが光る

sagiii commented 9 years ago

https://github.com/YUKAI/konashi-ios-sdk/releases/tag/v4.0.0 こちらのリリースにて、本件のbug fixを完了いたしました。