diff --git a/Document/html/Classes/KNSPeripheral.html b/Document/html/Classes/KNSPeripheral.html new file mode 100644 index 0000000..ca18029 --- /dev/null +++ b/Document/html/Classes/KNSPeripheral.html @@ -0,0 +1,715 @@ + + + + + KNSPeripheral Class Reference + + + + + + +
+
+

Konashi iOS SDK

+ YUKAI Engineering +
+ + + +
+ +
+
+ + + +
+ +
+ + + + + + + + + + +
Inherits fromNSObject
Conforms toCBPeripheralDelegate
Declared inKNSPeripheral.h
KNSPeripheral.m
+ + + + + + +
+ +

Tasks

+ + + + +

Event handler

+ + +
+ + + + + +
+ +

Properties

+ +
+ +

analogPinDidChangeValueHandler

+ + + +
+

このHandlerはAIOの値が変化した際に呼び出されます。

+
+ + + +
@property (nonatomic, copy) void ( ^ ) ( KonashiAnalogIOPin pin , int value ) analogPinDidChangeValueHandler
+ + + + + + + + + + + + + + + +
+

Declared In

+ KNSPeripheral.h
+
+ + +
+ +
+ +

batteryLevelDidUpdateHandler

+ + + +
+

このHandlerはバッテリー残量の値を取得した際に呼び出されます。

+
+ + + +
@property (nonatomic, copy) void ( ^ ) ( int value ) batteryLevelDidUpdateHandler
+ + + + + + + + + + + + + + + +
+

Declared In

+ KNSPeripheral.h
+
+ + +
+ +
+ +

connectedHandler

+ + + +
+

このHandlerはKonashiが接続された際に呼び出されます。

+
+ + + +
@property (nonatomic, copy) void ( ^ ) ( ) connectedHandler
+ + + + + + + + + + + + + + + +
+

Declared In

+ KNSPeripheral.h
+
+ + +
+ +
+ +

digitalInputDidChangeValueHandler

+ + + +
+

このHandlerはKonashiPinModeInputに設定されているPIOの値が変化した際に呼び出されます。

+
+ + + +
@property (nonatomic, copy) void ( ^ ) ( KonashiDigitalIOPin pin , int value ) digitalInputDidChangeValueHandler
+ + + + + + + + + + + + + + + +
+

Declared In

+ KNSPeripheral.h
+
+ + +
+ +
+ +

digitalOutputDidChangeValueHandler

+ + + +
+

このHandlerはKonashiPinModeOutputに設定されているPIOの値が変化した際に呼び出されます。

+
+ + + +
@property (nonatomic, copy) void ( ^ ) ( KonashiDigitalIOPin pin , int value ) digitalOutputDidChangeValueHandler
+ + + + + + + + + + + + + + + +
+

Declared In

+ KNSPeripheral.h
+
+ + +
+ +
+ +

disconnectedHandler

+ + + +
+

このHandlerはKonashiが切断された際に呼び出されます。

+
+ + + +
@property (nonatomic, copy) void ( ^ ) ( ) disconnectedHandler
+ + + + + + + + + + + + + + + +
+

Declared In

+ KNSPeripheral.h
+
+ + +
+ +
+ +

i2cReadCompleteHandler

+ + + +
+

このHandlerはI2Cで接続されたモジュールからデータを読みだした際に呼び出されます。

+
+ + + +
@property (nonatomic, copy) void ( ^ ) ( NSData *data ) i2cReadCompleteHandler
+ + + + + + + + + + + + + + + +
+

Declared In

+ KNSPeripheral.h
+
+ + +
+ +
+ +

readyHandler

+ + + +
+

このHandlerはKonashiが使用可能状態になった際に呼び出されます。

+
+ + + +
@property (nonatomic, copy) void ( ^ ) ( ) readyHandler
+ + + + + + + + + + + + + + + +
+

Declared In

+ KNSPeripheral.h
+
+ + +
+ +
+ +

signalStrengthDidUpdateHandler

+ + + +
+

このHandlerはRSSIが変化した際に呼び出されます。

+
+ + + +
@property (nonatomic, copy) void ( ^ ) ( int value ) signalStrengthDidUpdateHandler
+ + + + + + + + + + + + + + + +
+

Declared In

+ KNSPeripheral.h
+
+ + +
+ +
+ +

uartRxCompleteHandler

+ + + +
+

このHandlerはUartで値を受信した際に呼び出されます。

+
+ + + +
@property (nonatomic, copy) void ( ^ ) ( NSData *data ) uartRxCompleteHandler
+ + + + + + + + + + + + + + + +
+

Declared In

+ KNSPeripheral.h
+
+ + +
+ +
+ + + + + + + + + + + +
+ + +
+
+ + + \ No newline at end of file diff --git a/Document/html/Classes/Konashi.html b/Document/html/Classes/Konashi.html new file mode 100644 index 0000000..e69b94f --- /dev/null +++ b/Document/html/Classes/Konashi.html @@ -0,0 +1,3623 @@ + + + + + Konashi Class Reference + + + + + + +
+
+

Konashi iOS SDK

+ YUKAI Engineering +
+ + + +
+ +
+
+ + + +
+ +
+ + + + + + + + + + +
Inherits fromNSObject
Conforms toCBPeripheralDelegate
KonashiJavaScriptBindings
Declared inKonashi.h
Konashi.m
+ + + + + + +
+ +

Tasks

+ + + +

Event handler

+ + + + + +

Basic method

+ + + + + +

Digital I/O (PIO)

+ + + + + +

PWM

+ + + + + +

Analog I/O (AIO)

+ + + + + +

I2C

+ + + + + +

UART

+ + + + + +

Hardware Control

+ + + + + +

I2C

+ + + + + +

UART

+ + + +
+ + + + + +
+ +

Properties

+ +
+ +

analogPinDidChangeValueHandler

+ + + +
+

このHandlerはAIOの値が変化した際に呼び出されます。

+
+ + + +
@property (nonatomic, copy) void ( ^ ) ( KonashiAnalogIOPin pin , int value ) analogPinDidChangeValueHandler
+ + + + + + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

batteryLevelDidUpdateHandler

+ + + +
+

このHandlerはバッテリー残量の値を取得した際に呼び出されます。

+
+ + + +
@property (nonatomic, copy) void ( ^ ) ( int value ) batteryLevelDidUpdateHandler
+ + + + + + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

connectedHandler

+ + + +
+

このHandlerはKonashiが接続された際に呼び出されます。

+
+ + + +
@property (nonatomic, copy) void ( ^ ) ( ) connectedHandler
+ + + + + + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

digitalInputDidChangeValueHandler

+ + + +
+

このHandlerはKonashiPinModeInputに設定されているPIOの値が変化した際に呼び出されます。

+
+ + + +
@property (nonatomic, copy) void ( ^ ) ( KonashiDigitalIOPin pin , int value ) digitalInputDidChangeValueHandler
+ + + + + + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

digitalOutputDidChangeValueHandler

+ + + +
+

このHandlerはKonashiPinModeOutputに設定されているPIOの値が変化した際に呼び出されます。

+
+ + + +
@property (nonatomic, copy) void ( ^ ) ( KonashiDigitalIOPin pin , int value ) digitalOutputDidChangeValueHandler
+ + + + + + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

disconnectedHandler

+ + + +
+

このHandlerはKonashiが切断された際に呼び出されます。

+
+ + + +
@property (nonatomic, copy) void ( ^ ) ( ) disconnectedHandler
+ + + + + + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

i2cReadCompleteHandler

+ + + +
+

このHandlerはI2Cで接続されたモジュールからデータを読みだした際に呼び出されます。

+
+ + + +
@property (nonatomic, copy) void ( ^ ) ( NSData *data ) i2cReadCompleteHandler
+ + + + + + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

readyHandler

+ + + +
+

このHandlerはKonashiが使用可能状態になった際に呼び出されます。

+
+ + + +
@property (nonatomic, copy) void ( ^ ) ( ) readyHandler
+ + + + + + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

signalStrengthDidUpdateHandler

+ + + +
+

このHandlerはRSSIが変化した際に呼び出されます。

+
+ + + +
@property (nonatomic, copy) void ( ^ ) ( int value ) signalStrengthDidUpdateHandler
+ + + + + + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

uartRxCompleteHandler

+ + + +
+

このHandlerはUartで値を受信した際に呼び出されます。

+
+ + + +
@property (nonatomic, copy) void ( ^ ) ( NSData *data ) uartRxCompleteHandler
+ + + + + + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ + + +
+ +

Class Methods

+ +
+ +

analogRead:

+ + + +
+

AIOの値を取得します。 [Konashi analogReadRequest:] を用いてAIOの値の要求後に正しい値を取得可能です。

+
+ + + +
+ (int)analogRead:(KonashiAnalogIOPin)pin
+ + + +
+

Parameters

+ +
+
pin
+

AIOの番号

+
+ +
+ + + +
+

Return Value

+

AIOの値。

+
+ + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

analogReadRequest:

+ + + +
+

AIO の指定のピンの入力電圧を取得するリクエストを konashi に送ります。 + 入力電圧の取得が完了した際は KonashiEventAnalogIODidUpdateNotification が発行されます。

+
+ + + +
+ (KonashiResult)analogReadRequest:(KonashiAnalogIOPin)pin
+ + + +
+

Parameters

+ +
+
pin
+

AIOのピン名。

+
+ +
+ + + +
+

Return Value

+

成功した場合はKonashiResultSuccess、何らかの原因で失敗した場合はKonashiResultFailure。

+
+ + + + + +
+

Discussion

+

Bug: koshianでは正確な値を取得することができません。

+
+ + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

analogReference

+ + + +
+

アナログ入出力の基準電圧を返します。

+
+ + + +
+ (int)analogReference
+ + + + + +
+

Return Value

+

アナログ入出力の基準電圧(mV)。

+
+ + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

analogWrite:milliVolt:

+ + + +
+

AIO の指定のピンに任意の電圧を出力します。

+
+ + + +
+ (KonashiResult)analogWrite:(KonashiAnalogIOPin)pin milliVolt:(int)milliVolt
+ + + +
+

Parameters

+ +
+
pin
+

AIOのピン名。

+
+ +
+
milliVolt
+

設定する電圧をmVで指定します。

+
+ +
+ + + +
+

Return Value

+

成功した場合はKonashiResultSuccess、何らかの原因で失敗した場合はKonashiResultFailure。

+
+ + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

batteryLevelRead

+ + + +
+

バッテリーの残量を取得します。

+
+ + + +
+ (int)batteryLevelRead
+ + + + + +
+

Return Value

+

バッテリーの残量(%)

+
+ + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

batteryLevelReadRequest

+ + + +
+

konashi のバッテリ残量を取得するリクエストを konashi に送ります。 + 値の取得が成功した際には KonashiEventBatteryLevelDidUpdateNotification が発行されます。

+
+ + + +
+ (KonashiResult)batteryLevelReadRequest
+ + + + + +
+

Return Value

+

成功した場合はKonashiResultSuccess、何らかの原因で失敗した場合はKonashiResultFailure。

+
+ + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

digitalRead:

+ + + +
+

指定したPIOの値を取得します。

+
+ + + +
+ (KonashiLevel)digitalRead:(KonashiDigitalIOPin)pin
+ + + +
+

Parameters

+ +
+
pin
+

PIOの番号

+
+ +
+ + + +
+

Return Value

+

指定したPIOの値。KonashiLevelHigh及びKonashiLevelLow。

+
+ + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

digitalReadAll

+ + + +
+

PIOの値を取得します。

+
+ + + +
+ (int)digitalReadAll
+ + + + + +
+

Return Value

+

PIOの状態。各bitにおいてHighの場合は1、Lowの場合は0がセットされている。

+
+ + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

digitalWrite:value:

+ + + +
+

PIOの特定のピンの出力状態を設定します。

+
+ + + +
+ (KonashiResult)digitalWrite:(KonashiDigitalIOPin)pin value:(KonashiLevel)value
+ + + +
+

Parameters

+ +
+
pin
+

PIOのピン名。

+
+ +
+
value
+

設定するPIOの出力状態。KonashiLevelHigh もしくは KonashiLevelLow が指定可能です。

+
+ +
+ + + +
+

Return Value

+

成功した場合はKonashiResultSuccess、何らかの原因で失敗した場合はKonashiResultFailure。

+
+ + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

digitalWriteAll:

+ + + +
+

PIOの特定のピンの出力状態を設定します。 + この関数での引数は、PIO0〜PIO7の出力状態が8bit(1byte)で表現されます。bitとピンの対応は以下です。

+
+ + + +
+ (KonashiResult)digitalWriteAll:(int)value
+ + + +
+

Parameters

+ +
+
value
+

PIO0〜PIO7の出力に設定する値。

+
+ +
+ + + +
+

Return Value

+

成功した場合はKonashiResultSuccess、何らかの原因で失敗した場合はKonashiResultFailure。

+
+ + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

disconnect

+ + + +
+

konashiとの接続を解除します。

+
+ + + +
+ (KonashiResult)disconnect
+ + + + + +
+

Return Value

+

切断した場合はKonashiResultSuccess、すでに切断されている及び何らかの原因で失敗した場合はKonashiResultFailure。

+
+ + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

find

+ + + +
+

iPhone周辺のkonashiを探します。 + この関数を実行した後、周りにあるkonashiのリストが出現します。リストに列挙されているkonashiのひとつをクリックすると、konashiに自動的に接続されます。その後、KonashiEventConnectedNotification と KonashiEventReadyToUseNotification が発行されます。

+
+ + + +
+ (KonashiResult)find
+ + + + + +
+

Return Value

+

探索が開始された場合はKonashiResultSuccess、既に接続されている場合はKonashiResultFailure。

+
+ + + + + +
+

Discussion

+

Warning: 本来、KonashiEventCentralManagerPowerOnNotification のイベント以前に find を実行しても無効ですが、この場合に限り、KonashiEventCentralManagerPowerOnNotification のイベント後に自動的に find が遅延実行されるように調整されています。

+
+ + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

findWithName:

+ + + +
+

konashiの名前を指定して接続します。 + find の場合はkonashiのリストが出現しますが、findWithName を実行した場合はリストが出ずに自動的に接続されます。 + 名前に関しては、find を実行することによって下から出現するリストでリストアップされる konashi#4-0452 などの文字列です。konashi#-** の部分の数字は、konashiの緑色チップのシール上に記載されている番号と同じです。 + もし、指定した名前が見つからない場合は KonashiEventPeripheralNotFoundNotification が発行されます。

+
+ + + +
+ (KonashiResult)findWithName:(NSString *)name
+ + + +
+

Parameters

+ +
+
name
+

接続したいkonashiの名前。例:"konashi#4-0452"

+
+ +
+ + + +
+

Return Value

+

探索が開始された場合はKonashiResultSuccess、既に接続されている場合はKonashiResultFailure。

+
+ + + + + +
+

Discussion

+

Warning: 本来、KonashiEventCentralManagerPowerOnNotification のイベント以前に findWithName を実行しても無効ですが、この場合に限り、KonashiEventCentralManagerPowerOnNotification のイベント後に自動的に findWithName が遅延実行されるように調整されています。

+
+ + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

i2cMode:

+ + + +
+

I2C を有効/無効を設定します。

+
+ + + +
+ (KonashiResult)i2cMode:(KonashiI2CMode)mode
+ + + +
+

Parameters

+ +
+
mode
+

設定するI2Cのモード。

+
+ +
+ + + +
+

Return Value

+

設定に成功した場合はKonashiResultSuccess、何らかの原因で失敗した場合はKonashiResultFailure。

+
+ + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

i2cRead:data:

+ + + +
+

I2Cで接続されたモジュールから得られるデータを取得します。[Konashi i2cReadRequest:address:] を用いてデータの要求後に正しいデータを取得可能です。

+
+ + + +
+ (KonashiResult)i2cRead:(int)length data:(unsigned char *)data
+ + + +
+

Parameters

+ +
+
length
+

データの長さ(byte)

+
+ +
+
data
+

格納する変数

+
+ +
+ + + +
+

Return Value

+

値の取得に成功した場合はKonashiResultSuccess、失敗した場合はKonashiResultFailure。

+
+ + + + + +
+

Discussion

+

Warning: このメソッドは非推奨です。 [Konashi i2cReadCompleteHandler] を用いてデータの取得をしてください。

+
+ + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

i2cReadData

+ + + +
+
I2Cで接続されたモジュールから得られるデータを取得します。[Konashi i2cReadRequest:address:] を用いてデータの要求後に正しいデータを取得可能です。
+
+
+ + + +
+ (NSData *)i2cReadData
+ + + + + +
+

Return Value

+

取得したデータ

+
+ + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

i2cReadRequest:address:

+ + + +
+

I2C で指定したアドレスからデータを読み込むリクエストを行います。 + この関数はリクエストを行うだけでデータは取得できません。

+
+ + + +
+ (KonashiResult)i2cReadRequest:(int)length address:(unsigned char)address
+ + + +
+

Parameters

+ +
+
length
+

読み込むデータの長さ

+
+ +
+
address
+

読み込み先のアドレス

+
+ +
+ + + +
+

Return Value

+

成功した場合はKonashiResultSuccess、何らかの原因で失敗した場合はKonashiResultFailure。

+
+ + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

i2cRestartCondition

+ + + +
+

I2C のリスタートコンディションを発行します。 + 事前に i2cMode で I2C を有効にしておいてください。

+
+ + + +
+ (KonashiResult)i2cRestartCondition
+ + + + + +
+

Return Value

+

成功した場合はKonashiResultSuccess、何らかの原因で失敗した場合はKonashiResultFailure。

+
+ + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

i2cStartCondition

+ + + +
+

I2C のスタートコンディションを発行します。 + 事前に i2cMode で I2C を有効にしておいてください。

+
+ + + +
+ (KonashiResult)i2cStartCondition
+ + + + + +
+

Return Value

+

成功した場合はKonashiResultSuccess、何らかの原因で失敗した場合はKonashiResultFailure。

+
+ + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

i2cStopCondition

+ + + +
+

I2C のストップコンディションを発行します。 + 事前に i2cMode で I2C を有効にしておいてください。

+
+ + + +
+ (KonashiResult)i2cStopCondition
+ + + + + +
+

Return Value

+

成功した場合はKonashiResultSuccess、何らかの原因で失敗した場合はKonashiResultFailure。

+
+ + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

i2cWrite:data:address:

+ + + +
+

I2C で指定したアドレスにデータを書き込みます。 + 事前に i2cMode で I2C を有効にしておいてください。

+
+ + + +
+ (KonashiResult)i2cWrite:(int)length data:(unsigned char *)data address:(unsigned char)address
+ + + +
+

Parameters

+ +
+
length
+

書き込むデータの長さ(byte)

+
+ +
+
data
+

書き込むデータ

+
+ +
+
address
+

書き込み先アドレス

+
+ +
+ + + +
+

Return Value

+

成功した場合はKonashiResultSuccess、何らかの原因で失敗した場合はKonashiResultFailure。

+
+ + + + + +
+

Discussion

+

Warning: このメソッドは非推奨です。 [Konashi i2cWriteData:address] を用いてデータの書き込んでください。

+
+ + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

i2cWriteData:address:

+ + + +
+

I2C で指定したアドレスにデータを書き込みます。 + 事前に i2cMode で I2C を有効にしておいてください。

+
+ + + +
+ (KonashiResult)i2cWriteData:(NSData *)data address:(unsigned char)address
+ + + +
+

Parameters

+ +
+
data
+

書き込むデータ

+
+ +
+
address
+

書き込み先アドレス

+
+ +
+ + + +
+

Return Value

+

成功した場合はKonashiResultSuccess、何らかの原因で失敗した場合はKonashiResultFailure。

+
+ + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

i2cWriteString:address:

+ + + +
+

I2C で指定したアドレスに文字列を書き込みます。 + 事前に i2cMode で I2C を有効にしておいてください。

+
+ + + +
+ (KonashiResult)i2cWriteString:(NSString *)data address:(unsigned char)address
+ + + +
+

Parameters

+ +
+
data
+

書き込む文字列

+
+ +
+
address
+

書き込み先アドレス

+
+ +
+ + + +
+

Return Value

+

成功した場合はKonashiResultSuccess、何らかの原因で失敗した場合はKonashiResultFailure。

+
+ + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

isConnected

+ + + +
+

konashiと接続中かを返します。

+
+ + + +
+ (BOOL)isConnected
+ + + + + +
+

Return Value

+

接続されている場合はYES、されていない場合はNO。

+
+ + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

isReady

+ + + +
+

konashiに接続完了しているかを返します。

+
+ + + +
+ (BOOL)isReady
+ + + + + +
+

Return Value

+

接続完了している場合はYES、していない場合はNO.

+
+ + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

peripheralName

+ + + +
+

接続中のkonashiの名前を返します。 + konashiに接続していない状態で peripheralName を実行すると空文字 @“” が返ります。

+
+ + + +
+ (NSString *)peripheralName
+ + + + + +
+

Return Value

+

接続しているkonashiの名前。

+
+ + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

pinMode:mode:

+ + + +
+

PIOのピンを入力として使うか、出力として使うかの設定を行います。

+
+ + + +
+ (KonashiResult)pinMode:(KonashiDigitalIOPin)pin mode:(KonashiPinMode)mode
+ + + +
+

Parameters

+ +
+
pin
+

設定するPIOのピン名。

+
+ +
+
mode
+

ピンに設定するモード。

+
+ +
+ + + +
+

Return Value

+

設定に成功した場合はKonashiResultSuccess、何らかの原因で失敗した場合はKonashiResultFailure。

+
+ + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

pinModeAll:

+ + + +
+

PIOのピンを入力として使うか、出力として使うかの設定を行います。 + それぞれのビットでは、入力設定を0、出力設定を1として表現します。 + この関数での引数は、PIO0〜PIO7の入出力設定を8bit(1byte)で表現します。

+
+ + + +
+ (KonashiResult)pinModeAll:(int)mode
+ + + +
+

Parameters

+ +
+
mode
+

PIO0 〜 PIO7 の計8ピンの設定。

+
+ +
+ + + +
+

Return Value

+

設定に成功した場合はKonashiResultSuccess、何らかの原因で失敗した場合はKonashiResultFailure。

+
+ + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

pinPullup:mode:

+ + + +
+

PIOのピンをプルアップするかの設定を行います。 + 初期状態では、PIOはプルアップされていません(NO_PULLS)。

+
+ + + +
+ (KonashiResult)pinPullup:(KonashiDigitalIOPin)pin mode:(KonashiPinMode)mode
+ + + +
+

Parameters

+ +
+
pin
+

設定するPIOのピン名。

+
+ +
+
mode
+

ピンをプルアップするかの設定。

+
+ +
+ + + +
+

Return Value

+

設定に成功した場合はKonashiResultSuccess、何らかの原因で失敗した場合はKonashiResultFailure。

+
+ + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

pinPullupAll:

+ + + +
+

PIOのピンをプルアップするかの設定を行います。 + この関数での引数は、PIO0〜PIO7のプルアップ設定を8bit(1byte)で表現します。

+
+ + + +
+ (KonashiResult)pinPullupAll:(int)mode
+ + + +
+

Parameters

+ +
+
mode
+

設定するPIOのピン名。

+
+ +
+ + + +
+

Return Value

+

PIO0 〜 PIO7 の計8ピンのプルアップの設定。

+
+ + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

pwmDuty:duty:

+ + + +
+

指定のピンのPWMのデューティ(ONになっている時間)を設定します。 + 単位はマイクロ秒(us)で指定してください。

+
+ + + +
+ (KonashiResult)pwmDuty:(KonashiDigitalIOPin)pin duty:(unsigned int)duty
+ + + +
+

Parameters

+ +
+
pin
+

PIOのピン名。

+
+ +
+
duty
+

デューティ。単位はマイクロ秒(us)で32bitで指定してください。最大232us = 71.5分です。

+
+ +
+ + + +
+

Return Value

+

設定に成功した場合はKonashiResultSuccess、何らかの原因で失敗した場合はKonashiResultFailure。

+
+ + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

pwmLedDrive:dutyRatio:

+ + + +
+

指定のピンのLEDの明るさを0%〜100%で指定します。 + pwmLedDrive 関数を使うには pwmMode で KonashiPWMModeEnableLED を指定してください。

+
+ + + +
+ (KonashiResult)pwmLedDrive:(KonashiDigitalIOPin)pin dutyRatio:(int)ratio
+ + + +
+

Parameters

+ +
+
pin
+

PIOのピン名。

+
+ +
+
ratio
+

LEDの明るさ。0〜100 をしてしてください。

+
+ +
+ + + +
+

Return Value

+

設定に成功した場合はKonashiResultSuccess、何らかの原因で失敗した場合はKonashiResultFailure。

+
+ + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

pwmMode:mode:

+ + + +
+

PIO の指定のピンを PWM として使用する/しないかを設定します。 + PIO のいずれのピンも PWMモード に設定できます。

+
+ + + +
+ (KonashiResult)pwmMode:(KonashiDigitalIOPin)pin mode:(KonashiPWMMode)mode
+ + + +
+

Parameters

+ +
+
pin
+

PWMモードの設定をするPIOのピン名。

+
+ +
+
mode
+

設定するPWMのモード。

+
+ +
+ + + +
+

Return Value

+

設定に成功した場合はKonashiResultSuccess、何らかの原因で失敗した場合はKonashiResultFailure。

+
+ + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

pwmPeriod:period:

+ + + +
+

指定のピンのPWM周期を設定します。 + 周期の単位はマイクロ秒(us)で指定してください。

+
+ + + +
+ (KonashiResult)pwmPeriod:(KonashiDigitalIOPin)pin period:(unsigned int)period
+ + + +
+

Parameters

+ +
+
pin
+

PIOのピン名。

+
+ +
+
period
+

周期。単位はマイクロ秒(us)で32bitで指定してください。最大232us = 71.5分です。

+
+ +
+ + + +
+

Return Value

+

設定に成功した場合はKonashiResultSuccess、何らかの原因で失敗した場合はKonashiResultFailure。

+
+ + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

readUartData

+ + + +
+

uartの値を取得します。

+
+ + + +
+ (NSData *)readUartData
+ + + + + +
+

Return Value

+

取得した値。

+
+ + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

reset

+ + + +
+

konashi を再起動します。 + konashi が再起動すると、自動的にBLEのコネクションは切断されてしまいます。

+
+ + + +
+ (KonashiResult)reset
+ + + + + +
+

Return Value

+

成功した場合はKonashiResultSuccess、何らかの原因で失敗した場合はKonashiResultFailure。

+
+ + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

shared

+ + + +
+

シングルトンを取得します。

+
+ + + +
+ (Konashi *)shared
+ + + + + +
+

Return Value

+

Konashiのインスタンス。

+
+ + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

signalStrengthRead

+ + + +
+

RSSIの値を取得します。

+
+ + + +
+ (int)signalStrengthRead
+ + + + + +
+

Return Value

+

RSSIの値。

+
+ + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

signalStrengthReadRequest

+ + + +
+

konashi の電波強度を取得するリクエストを行います。 + 値の取得が成功した際には KonashiEventSignalStrengthDidUpdateNotification が発行されます。

+
+ + + +
+ (KonashiResult)signalStrengthReadRequest
+ + + + + +
+

Return Value

+

成功した場合はKonashiResultSuccess、何らかの原因で失敗した場合はKonashiResultFailure。

+
+ + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

softwareRevisionString

+ + + +
+

ファームウェアのバージョンを返します。

+
+ + + +
+ (NSString *)softwareRevisionString
+ + + + + +
+

Return Value

+

ファームウェアのバージョン文字列。

+
+ + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

uartBaudrate:

+ + + +
+

UART の通信速度を設定します。

+
+ + + +
+ (KonashiResult)uartBaudrate:(KonashiUartBaudrate)baudrate
+ + + +
+

Parameters

+ +
+
baudrate
+

UARTの通信速度。

+
+ +
+ + + +
+

Return Value

+

設定に成功した場合はKonashiResultSuccess、何らかの原因で失敗した場合はKonashiResultFailure。

+
+ + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

uartMode:

+ + + +
+

UART の有効/無効を設定します。 + 有効にする前に、uartBaudrate でボーレートを設定しておいてください。

+
+ + + +
+ (KonashiResult)uartMode:(KonashiUartMode)mode
+ + + +
+

Parameters

+ +
+
mode
+

設定するUARTのモード。

+
+ +
+ + + +
+

Return Value

+

設定に成功した場合はKonashiResultSuccess、何らかの原因で失敗した場合はKonashiResultFailure。

+
+ + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

uartMode:baudrate:

+ + + +
+

UART の有効/無効を設定します。 + 有効にする前に、uartBaudrate でボーレートを設定しておいてください。

+
+ + + +
+ (KonashiResult)uartMode:(KonashiUartMode)mode baudrate:(KonashiUartBaudrate)baudrate
+ + + +
+

Parameters

+ +
+
mode
+

設定するUARTのモード。

+
+ +
+
baudrate
+

設定するUARTのボーレート。

+
+ +
+ + + +
+

Return Value

+

設定に成功した場合はKonashiResultSuccess、何らかの原因で失敗した場合はKonashiResultFailure。

+
+ + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

uartRead

+ + + +
+

uartの値を取得します。

+
+ + + +
+ (unsigned char)uartRead
+ + + + + +
+

Return Value

+

取得した値。

+
+ + + + + +
+

Discussion

+

Warning: このメソッドは非推奨です。 [Konashi uartRxCompleteHandler] 及び [Konashi readUartData] を用いて値を取得してください。

+
+ + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

uartWrite:

+ + + +
+

UART でデータを送信します。

+
+ + + +
+ (KonashiResult)uartWrite:(unsigned char)data
+ + + +
+

Parameters

+ +
+
data
+

送信するデータ。

+
+ +
+ + + +
+

Return Value

+

成功した場合はKonashiResultSuccess、何らかの原因で失敗した場合はKonashiResultFailure。

+
+ + + + + +
+

Discussion

+

Warning: このメソッドは非推奨です。 [Konashi uartWriteData:] を用いでデータを送信してください。

+
+ + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

uartWriteData:

+ + + +
+

UART でデータを送信します。

+
+ + + +
+ (KonashiResult)uartWriteData:(NSData *)data
+ + + +
+

Parameters

+ +
+
data
+

送信するデータ。

+
+ +
+ + + +
+

Return Value

+

成功した場合はKonashiResultSuccess、何らかの原因で失敗した場合はKonashiResultFailure。

+
+ + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ +

uartWriteString:

+ + + +
+

UART で文字列を送信します。

+
+ + + +
+ (KonashiResult)uartWriteString:(NSString *)string
+ + + +
+

Parameters

+ +
+
string
+

送信する文字列

+
+ +
+ + + +
+

Return Value

+

成功した場合はKonashiResultSuccess、何らかの原因で失敗した場合はKonashiResultFailure。

+
+ + + + + + + + + + + +
+

Declared In

+ Konashi.h
+
+ + +
+ +
+ + + + + + + + + +
+ + +
+
+ + + \ No newline at end of file diff --git a/Document/html/Constants/KonashiACMode.html b/Document/html/Constants/KonashiACMode.html new file mode 100644 index 0000000..8d38ab6 --- /dev/null +++ b/Document/html/Constants/KonashiACMode.html @@ -0,0 +1,236 @@ + + + + + KonashiACMode Constants Reference + + + + + + +
+
+

Konashi iOS SDK

+ YUKAI Engineering +
+ + + +
+ +
+
+ + + +
+ +
+ + + + +
Declared inKonashi+ACDrive.h
+ + + + + + + + + +

KonashiACMode

+ +
+ + +

Definition

+ typedef NS_ENUM(NSUInteger, KonashiACMode ) {
+ +    KonashiACModeOnOff,
+ +    KonashiACModePWM,
+ + };
+ +
+ +
+

Constants

+
+ +
KonashiACModeOnOff
+
+ + +

+ Declared In Konashi+ACDrive.h. +

+ +
+ +
KonashiACModePWM
+
+ + +

+ Declared In Konashi+ACDrive.h. +

+ +
+ +
+
+ + + + + + + +
+ + +
+
+ + + \ No newline at end of file diff --git a/Document/html/Constants/KonashiAnalogIOPin.html b/Document/html/Constants/KonashiAnalogIOPin.html new file mode 100644 index 0000000..ac59bc9 --- /dev/null +++ b/Document/html/Constants/KonashiAnalogIOPin.html @@ -0,0 +1,248 @@ + + + + + KonashiAnalogIOPin Constants Reference + + + + + + +
+
+

Konashi iOS SDK

+ YUKAI Engineering +
+ + + +
+ +
+
+ + + +
+ +
+ + + + +
Declared inKonashiConstant.h
+ + + + + + + + + +

KonashiAnalogIOPin

+ +
+ + +

Definition

+ typedef NS_ENUM(int, KonashiAnalogIOPin ) {
+ +    KonashiAnalogIO0 = 0,
+ +    KonashiAnalogIO1 = 1,
+ +    KonashiAnalogIO2 = 2,
+ + };
+ +
+ +
+

Constants

+
+ +
KonashiAnalogIO0
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
KonashiAnalogIO1
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
KonashiAnalogIO2
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
+
+ + + + + + + +
+ + +
+
+ + + \ No newline at end of file diff --git a/Document/html/Constants/KonashiDigitalIOPin.html b/Document/html/Constants/KonashiDigitalIOPin.html new file mode 100644 index 0000000..14dafd0 --- /dev/null +++ b/Document/html/Constants/KonashiDigitalIOPin.html @@ -0,0 +1,392 @@ + + + + + KonashiDigitalIOPin Constants Reference + + + + + + +
+
+

Konashi iOS SDK

+ YUKAI Engineering +
+ + + +
+ +
+
+ + + +
+ +
+ + + + +
Declared inKonashiConstant.h
+ + + + + + + + + +

KonashiDigitalIOPin

+ +
+ + +

Definition

+ typedef NS_ENUM(int, KonashiDigitalIOPin ) {
+ +    KonashiDigitalIO0 = 0,
+ +    KonashiDigitalIO1 = 1,
+ +    KonashiDigitalIO2 = 2,
+ +    KonashiDigitalIO3 = 3,
+ +    KonashiDigitalIO4 = 4,
+ +    KonashiDigitalIO5 = 5,
+ +    KonashiDigitalIO6 = 6,
+ +    KonashiDigitalIO7 = 7,
+ +    KonashiS1 = KonashiDigitalIO0,
+ +    KonashiLED2 = KonashiDigitalIO1,
+ +    KonashiLED3 = KonashiDigitalIO2,
+ +    KonashiLED4 = KonashiDigitalIO3,
+ +    KonashiLED5 = KonashiDigitalIO4,
+ +    KonashiI2C_SDA = 6,
+ +    KonashiI2C_SCL = 7,
+ + };
+ +
+ +
+

Constants

+
+ +
KonashiDigitalIO0
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
KonashiDigitalIO1
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
KonashiDigitalIO2
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
KonashiDigitalIO3
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
KonashiDigitalIO4
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
KonashiDigitalIO5
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
KonashiDigitalIO6
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
KonashiDigitalIO7
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
KonashiS1
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
KonashiLED2
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
KonashiLED3
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
KonashiLED4
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
KonashiLED5
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
KonashiI2C_SDA
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
KonashiI2C_SCL
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
+
+ + + + + + + +
+ + +
+
+ + + \ No newline at end of file diff --git a/Document/html/Constants/KonashiI2CCondition.html b/Document/html/Constants/KonashiI2CCondition.html new file mode 100644 index 0000000..1ec123a --- /dev/null +++ b/Document/html/Constants/KonashiI2CCondition.html @@ -0,0 +1,248 @@ + + + + + KonashiI2CCondition Constants Reference + + + + + + +
+
+

Konashi iOS SDK

+ YUKAI Engineering +
+ + + +
+ +
+
+ + + +
+ +
+ + + + +
Declared inKonashiConstant.h
+ + + + + + + + + +

KonashiI2CCondition

+ +
+ + +

Definition

+ typedef NS_ENUM(int, KonashiI2CCondition ) {
+ +    KonashiI2CConditionStop = 0,
+ +    KonashiI2CConditionStart = 1,
+ +    KonashiI2CConditionRestart = 2,
+ + };
+ +
+ +
+

Constants

+
+ +
KonashiI2CConditionStop
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
KonashiI2CConditionStart
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
KonashiI2CConditionRestart
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
+
+ + + + + + + +
+ + +
+
+ + + \ No newline at end of file diff --git a/Document/html/Constants/KonashiI2CMode.html b/Document/html/Constants/KonashiI2CMode.html new file mode 100644 index 0000000..a792812 --- /dev/null +++ b/Document/html/Constants/KonashiI2CMode.html @@ -0,0 +1,260 @@ + + + + + KonashiI2CMode Constants Reference + + + + + + +
+
+

Konashi iOS SDK

+ YUKAI Engineering +
+ + + +
+ +
+
+ + + +
+ +
+ + + + +
Declared inKonashiConstant.h
+ + + + + + + + + +

KonashiI2CMode

+ +
+ + +

Definition

+ typedef NS_ENUM(int, KonashiI2CMode ) {
+ +    KonashiI2CModeDisable = 0,
+ +    KonashiI2CModeEnable = 1,
+ +    KonashiI2CModeEnable100K = 1,
+ +    KonashiI2CModeEnable400K = 2,
+ + };
+ +
+ +
+

Constants

+
+ +
KonashiI2CModeDisable
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
KonashiI2CModeEnable
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
KonashiI2CModeEnable100K
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
KonashiI2CModeEnable400K
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
+
+ + + + + + + +
+ + +
+
+ + + \ No newline at end of file diff --git a/Document/html/Constants/KonashiLevel.html b/Document/html/Constants/KonashiLevel.html new file mode 100644 index 0000000..051d630 --- /dev/null +++ b/Document/html/Constants/KonashiLevel.html @@ -0,0 +1,248 @@ + + + + + KonashiLevel Constants Reference + + + + + + +
+
+

Konashi iOS SDK

+ YUKAI Engineering +
+ + + +
+ +
+
+ + + +
+ +
+ + + + +
Declared inKonashiConstant.h
+ + + + + + + + + +

KonashiLevel

+ +
+ + +

Definition

+ typedef NS_ENUM(int, KonashiLevel ) {
+ +    KonashiLevelUnknown = -1,
+ +    KonashiLevelLow = 0,
+ +    KonashiLevelHigh = 1,
+ + };
+ +
+ +
+

Constants

+
+ +
KonashiLevelUnknown
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
KonashiLevelLow
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
KonashiLevelHigh
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
+
+ + + + + + + +
+ + +
+
+ + + \ No newline at end of file diff --git a/Document/html/Constants/KonashiPWMMode.html b/Document/html/Constants/KonashiPWMMode.html new file mode 100644 index 0000000..ace8b21 --- /dev/null +++ b/Document/html/Constants/KonashiPWMMode.html @@ -0,0 +1,248 @@ + + + + + KonashiPWMMode Constants Reference + + + + + + +
+
+

Konashi iOS SDK

+ YUKAI Engineering +
+ + + +
+ +
+
+ + + +
+ +
+ + + + +
Declared inKonashiConstant.h
+ + + + + + + + + +

KonashiPWMMode

+ +
+ + +

Definition

+ typedef NS_ENUM(int, KonashiPWMMode ) {
+ +    KonashiPWMModeDisable = 0,
+ +    KonashiPWMModeEnable = 1,
+ +    KonashiPWMModeEnableLED = 2,
+ + };
+ +
+ +
+

Constants

+
+ +
KonashiPWMModeDisable
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
KonashiPWMModeEnable
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
KonashiPWMModeEnableLED
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
+
+ + + + + + + +
+ + +
+
+ + + \ No newline at end of file diff --git a/Document/html/Constants/KonashiPinMask.html b/Document/html/Constants/KonashiPinMask.html new file mode 100644 index 0000000..f392ad7 --- /dev/null +++ b/Document/html/Constants/KonashiPinMask.html @@ -0,0 +1,308 @@ + + + + + KonashiPinMask Constants Reference + + + + + + +
+
+

Konashi iOS SDK

+ YUKAI Engineering +
+ + + +
+ +
+
+ + + +
+ +
+ + + + +
Declared inKonashiConstant.h
+ + + + + + + + + +

KonashiPinMask

+ +
+ + +

Definition

+ typedef NS_OPTIONS(int, KonashiPinMask ) {
+ +    KonashiPinMask0 = 0,
+ +    KonashiPinMask1 = 1 < < 0,
+ +    KonashiPinMask2 = 1 < < 1,
+ +    KonashiPinMask3 = 1 < < 2,
+ +    KonashiPinMask4 = 1 < < 3,
+ +    KonashiPinMask5 = 1 < < 4,
+ +    KonashiPinMask6 = 1 < < 5,
+ +    KonashiPinMask7 = 1 < < 6,
+ + };
+ +
+ +
+

Constants

+
+ +
KonashiPinMask0
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
KonashiPinMask1
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
KonashiPinMask2
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
KonashiPinMask3
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
KonashiPinMask4
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
KonashiPinMask5
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
KonashiPinMask6
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
KonashiPinMask7
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
+
+ + + + + + + +
+ + +
+
+ + + \ No newline at end of file diff --git a/Document/html/Constants/KonashiPinMode.html b/Document/html/Constants/KonashiPinMode.html new file mode 100644 index 0000000..371d0d3 --- /dev/null +++ b/Document/html/Constants/KonashiPinMode.html @@ -0,0 +1,260 @@ + + + + + KonashiPinMode Constants Reference + + + + + + +
+
+

Konashi iOS SDK

+ YUKAI Engineering +
+ + + +
+ +
+
+ + + +
+ +
+ + + + +
Declared inKonashiConstant.h
+ + + + + + + + + +

KonashiPinMode

+ +
+ + +

Definition

+ typedef NS_ENUM(int, KonashiPinMode ) {
+ +    KonashiPinModeInput = 0,
+ +    KonashiPinModeOutput = 1,
+ +    KonashiPinModeNoPulls = 0,
+ +    KonashiPinModePullup = 1,
+ + };
+ +
+ +
+

Constants

+
+ +
KonashiPinModeInput
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
KonashiPinModeOutput
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
KonashiPinModeNoPulls
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
KonashiPinModePullup
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
+
+ + + + + + + +
+ + +
+
+ + + \ No newline at end of file diff --git a/Document/html/Constants/KonashiResult.html b/Document/html/Constants/KonashiResult.html new file mode 100644 index 0000000..06119b5 --- /dev/null +++ b/Document/html/Constants/KonashiResult.html @@ -0,0 +1,236 @@ + + + + + KonashiResult Constants Reference + + + + + + +
+
+

Konashi iOS SDK

+ YUKAI Engineering +
+ + + +
+ +
+
+ + + +
+ +
+ + + + +
Declared inKonashiConstant.h
+ + + + + + + + + +

KonashiResult

+ +
+ + +

Definition

+ typedef NS_ENUM(int, KonashiResult ) {
+ +    KonashiResultSuccess = 0,
+ +    KonashiResultFailure = -1,
+ + };
+ +
+ +
+

Constants

+
+ +
KonashiResultSuccess
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
KonashiResultFailure
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
+
+ + + + + + + +
+ + +
+
+ + + \ No newline at end of file diff --git a/Document/html/Constants/KonashiUartBaudrate.html b/Document/html/Constants/KonashiUartBaudrate.html new file mode 100644 index 0000000..ac17cd9 --- /dev/null +++ b/Document/html/Constants/KonashiUartBaudrate.html @@ -0,0 +1,296 @@ + + + + + KonashiUartBaudrate Constants Reference + + + + + + +
+
+

Konashi iOS SDK

+ YUKAI Engineering +
+ + + +
+ +
+
+ + + +
+ +
+ + + + +
Declared inKonashiConstant.h
+ + + + + + + + + +

KonashiUartBaudrate

+ +
+ + +

Definition

+ typedef NS_ENUM(int, KonashiUartBaudrate ) {
+ +    KonashiUartBaudrateRate2K4 = 0 x000a,
+ +    KonashiUartBaudrateRate9K6 = 0 x0028,
+ +    KonashiUartBaudrateRate19K2 = 0 x0050,
+ +    KonashiUartBaudrateRate38K4 = 0 x00a0,
+ +    KonashiUartBaudrateRate57K6 = 0 x00f0,
+ +    KonashiUartBaudrateRate76K8 = 0 x0140,
+ +    KonashiUartBaudrateRate115K2 = 0 x01e0,
+ + };
+ +
+ +
+

Constants

+
+ +
KonashiUartBaudrateRate2K4
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
KonashiUartBaudrateRate9K6
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
KonashiUartBaudrateRate19K2
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
KonashiUartBaudrateRate38K4
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
KonashiUartBaudrateRate57K6
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
KonashiUartBaudrateRate76K8
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
KonashiUartBaudrateRate115K2
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
+
+ + + + + + + +
+ + +
+
+ + + \ No newline at end of file diff --git a/Document/html/Constants/KonashiUartMode.html b/Document/html/Constants/KonashiUartMode.html new file mode 100644 index 0000000..9de7de0 --- /dev/null +++ b/Document/html/Constants/KonashiUartMode.html @@ -0,0 +1,236 @@ + + + + + KonashiUartMode Constants Reference + + + + + + +
+
+

Konashi iOS SDK

+ YUKAI Engineering +
+ + + +
+ +
+
+ + + +
+ +
+ + + + +
Declared inKonashiConstant.h
+ + + + + + + + + +

KonashiUartMode

+ +
+ + +

Definition

+ typedef NS_ENUM(int, KonashiUartMode ) {
+ +    KonashiUartModeDisable = 0,
+ +    KonashiUartModeEnable = 1,
+ + };
+ +
+ +
+

Constants

+
+ +
KonashiUartModeDisable
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
KonashiUartModeEnable
+
+ + +

+ Declared In KonashiConstant.h. +

+ +
+ +
+
+ + + + + + + +
+ + +
+
+ + + \ No newline at end of file diff --git a/Document/html/css/styles.css b/Document/html/css/styles.css new file mode 100644 index 0000000..3308189 --- /dev/null +++ b/Document/html/css/styles.css @@ -0,0 +1,615 @@ +body { + font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; + font-size: 13px; +} + +code { + font-family: Courier, Consolas, monospace; + font-size: 13px; + color: #666; +} + +pre { + font-family: Courier, Consolas, monospace; + font-size: 13px; + line-height: 18px; + tab-interval: 0.5em; + border: 1px solid #C7CFD5; + background-color: #F1F5F9; + color: #666; + padding: 0.3em 1em; +} + +ul { + list-style-type: square; +} + +li { + margin-bottom: 10px; +} + +a, a code { + text-decoration: none; + color: #36C; +} + +a:hover, a:hover code { + text-decoration: underline; + color: #36C; +} + +h2 { + border-bottom: 1px solid #8391A8; + color: #3C4C6C; + font-size: 187%; + font-weight: normal; + margin-top: 1.75em; + padding-bottom: 2px; +} + +table { + margin-bottom: 4em; + border-collapse:collapse; + vertical-align: middle; +} + +td { + border: 1px solid #9BB3CD; + padding: .667em; + font-size: 100%; +} + +th { + border: 1px solid #9BB3CD; + padding: .3em .667em .3em .667em; + background: #93A5BB; + font-size: 103%; + font-weight: bold; + color: white; + text-align: left; +} + +/* @group Common page elements */ + +#top_header { + height: 91px; + left: 0; + min-width: 598px; + position: absolute; + right: 0; + top: 0; + z-index: 900; +} + +#footer { + clear: both; + padding-top: 20px; + text-align: center; +} + +#contents, #overview_contents { + -webkit-overflow-scrolling: touch; + border-top: 1px solid #A9A9A9; + position: absolute; + top: 90px; + left: 0; + right: 0; + bottom: 0; + overflow-x: hidden; + overflow-y: auto; + padding-left: 2em; + padding-right: 2em; + padding-top: 1em; + min-width: 550px; +} + +#contents.isShowingTOC { + left: 230px; + min-width: 320px; +} + +.copyright { + font-size: 12px; +} + +.generator { + font-size: 11px; +} + +.main-navigation ul li { + display: inline; + margin-left: 15px; + list-style: none; +} + +.navigation-top { + clear: both; + float: right; +} + +.navigation-bottom { + clear: both; + float: right; + margin-top: 20px; + margin-bottom: -10px; +} + +.open > .disclosure { + background-image: url("../img/disclosure_open.png"); +} + +.disclosure { + background: url("../img/disclosure.png") no-repeat scroll 0 0; +} + +.disclosure, .nodisclosure { + display: inline-block; + height: 8px; + margin-right: 5px; + position: relative; + width: 9px; +} + +/* @end */ + +/* @group Header */ + +#top_header #library { + background: url("../img/library_background.png") repeat-x 0 0 #485E78; + background-color: #ccc; + height: 35px; + font-size: 115%; +} + +#top_header #library #libraryTitle { + color: #FFFFFF; + margin-left: 15px; + text-shadow: 0 -1px 0 #485E78; + top: 8px; + position: absolute; +} + +#libraryTitle { + left: 0; +} + +#top_header #library #developerHome { + color: #92979E; + right: 15px; + top: 8px; + position: absolute; +} + +#top_header #library a:hover { + text-decoration: none; +} + +#top_header #title { + background: url("../img/title_background.png") repeat-x 0 0 #8A98A9; + border-bottom: 1px solid #757575; + height: 25px; + overflow: hidden; +} + +#top_header h1 { + font-size: 105%; + font-weight: normal; + margin: 0; + padding: 3px 0 2px; + text-align: center; + /*text-shadow: 0 1px 0 #D5D5D5;*/ + white-space: nowrap; +} + +#headerButtons { + background-color: #D8D8D8; + background-image: url("../img/button_bar_background.png"); + border-bottom: 0px solid #EDEDED; + border-top: 0px solid #a8a8a8; + font-size: 8pt; + height: 28px; + left: 0; + list-style: none outside none; + margin: 0; + overflow: hidden; + padding: 0; + position: absolute; + right: 0; + top: 61px; +} + +#headerButtons li { + background-repeat: no-repeat; + display: inline; + margin-top: 0; + margin-bottom: 0; + padding: 0; +} + +#toc_button button { + background-color: #EBEEF1; + border-color: #ACACAC; + border-style: none solid none none; + border-width: 0 1px 0 0; + height: 28px; + margin: 0; + padding-left: 30px; + text-align: left; + width: 230px; +} + +li#jumpto_button { + left: 230px; + margin-left: 0; + position: absolute; +} + +li#jumpto_button select { + height: 22px; + margin: 5px 2px 0 10px; + max-width: 300px; +} + +/* @end */ + +/* @group Table of contents */ + +#tocContainer.isShowingTOC { + border-right: 1px solid #ACACAC; + display: block; + overflow-x: hidden; + overflow-y: auto; + padding: 0; +} + +#tocContainer { + background-color: #EBEEF1; + border-top: 1px solid #ACACAC; + bottom: 0; + display: none; + left: 0; + overflow: hidden; + position: absolute; + top: 90px; + width: 229px; +} + +#tocContainer > ul#toc { + font-size: 11px; + margin: 0; + padding: 12px 0 18px; + width: 209px; + -moz-user-select: none; + -webkit-user-select: none; + user-select: none; +} + +#tocContainer > ul#toc > li { + margin: 0; + padding: 0 0 7px 30px; + text-indent: -15px; +} + +#tocContainer > ul#toc > li > .sectionName a { + color: #000000; + font-weight: bold; +} + +#tocContainer > ul#toc > li > .sectionName a:hover { + text-decoration: none; +} + +#tocContainer > ul#toc li.children > ul { + display: none; + height: 0; +} + +#tocContainer > ul#toc > li > ul { + margin: 0; + padding: 0; +} + +#tocContainer > ul#toc > li > ul, ul#toc > li > ul > li { + margin-left: 0; + margin-bottom: 0; + padding-left: 15px; +} + +#tocContainer > ul#toc > li ul { + list-style: none; + margin-right: 0; + padding-right: 0; +} + +#tocContainer > ul#toc li.children.open > ul { + display: block; + height: auto; + margin-left: -15px; + padding-left: 0; +} + +#tocContainer > ul#toc > li > ul, ul#toc > li > ul > li { + margin-left: 0; + padding-left: 15px; +} + +#tocContainer li ul li { + margin-top: 0.583em; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +#tocContainer li ul li span.sectionName { + white-space: normal; +} + +#tocContainer > ul#toc > li > ul > li > .sectionName a { + font-weight: bold; +} + +#tocContainer > ul#toc > li > ul a { + color: #4F4F4F; +} + +/* @end */ + +/* @group Index formatting */ + +.index-title { + font-size: 13px; + font-weight: normal; +} + +.index-column { + float: left; + width: 30%; + min-width: 200px; + font-size: 11px; +} + +.index-column ul { + margin: 8px 0 0 0; + padding: 0; + list-style: none; +} + +.index-column ul li { + margin: 0 0 3px 0; + padding: 0; +} + +.hierarchy-column { + min-width: 400px; +} + +.hierarchy-column ul { + margin: 3px 0 0 15px; +} + +.hierarchy-column ul li { + list-style-type: square; +} + +/* @end */ + +/* @group Common formatting elements */ + +.title { + font-weight: normal; + font-size: 215%; + margin-top:0; +} + +.subtitle { + font-weight: normal; + font-size: 180%; + color: #3C4C6C; + border-bottom: 1px solid #5088C5; +} + +.subsubtitle { + font-weight: normal; + font-size: 145%; + height: 0.7em; +} + +.note { + border: 1px solid #5088C5; + background-color: white; + margin: 1.667em 0 1.75em 0; + padding: 0 .667em .083em .750em; +} + +.warning { + border: 1px solid #5088C5; + background-color: #F0F3F7; + margin-bottom: 0.5em; + padding: 0.3em 0.8em; +} + +.bug { + border: 1px solid #000; + background-color: #ffffcc; + margin-bottom: 0.5em; + padding: 0.3em 0.8em; +} + +.deprecated { + color: #F60425; +} + +/* @end */ + +/* @group Common layout */ + +.section { + margin-top: 3em; +} + +/* @end */ + +/* @group Object specification section */ + +.section-specification { + margin-left: 2.5em; + margin-right: 2.5em; + font-size: 12px; +} + +.section-specification table { + margin-bottom: 0em; + border-top: 1px solid #d6e0e5; +} + +.section-specification td { + vertical-align: top; + border-bottom: 1px solid #d6e0e5; + border-left-width: 0px; + border-right-width: 0px; + border-top-width: 0px; + padding: .6em; +} + +.section-specification .specification-title { + font-weight: bold; +} + +/* @end */ + +/* @group Tasks section */ + +.task-list { + list-style-type: none; + padding-left: 0px; +} + +.task-list li { + margin-bottom: 3px; +} + +.task-item-suffix { + color: #996; + font-size: 12px; + font-style: italic; + margin-left: 0.5em; +} + +span.tooltip span.tooltip { + font-size: 1.0em; + display: none; + padding: 0.3em; + border: 1px solid #aaa; + background-color: #fdfec8; + color: #000; + text-align: left; +} + +span.tooltip:hover span.tooltip { + display: block; + position: absolute; + margin-left: 2em; +} + +/* @end */ + +/* @group Method section */ + +.section-method { + margin-top: 2.3em; +} + +.method-title { + margin-bottom: 1.5em; +} + +.method-subtitle { + margin-top: 0.7em; + margin-bottom: 0.2em; +} + +.method-subsection p { + margin-top: 0.4em; + margin-bottom: 0.8em; +} + +.method-declaration { + margin-top:1.182em; + margin-bottom:.909em; +} + +.method-declaration code { + font:14px Courier, Consolas, monospace; + color:#000; +} + +.declaration { + color: #000; +} + +.termdef { + margin-bottom: 10px; + margin-left: 0px; + margin-right: 0px; + margin-top: 0px; +} + +.termdef dt { + margin: 0; + padding: 0; +} + +.termdef dd { + margin-bottom: 6px; + margin-left: 16px; + margin-right: 0px; + margin-top: 1px; +} + +.termdef dd p { + margin-bottom: 6px; + margin-left: 0px; + margin-right: 0px; + margin-top: -1px; +} + +.argument-def { + margin-top: 0.3em; + margin-bottom: 0.3em; +} + +.argument-def dd { + margin-left: 1.25em; +} + +.see-also-section ul { + list-style-type: none; + padding-left: 0px; + margin-top: 0; +} + +.see-also-section li { + margin-bottom: 3px; +} + +.declared-in-ref { + color: #666; +} + +#tocContainer.hideInXcode { + display: none; + border: 0px solid black; +} + +#top_header.hideInXcode { + display: none; +} + +#contents.hideInXcode { + border: 0px solid black; + top: 0px; + left: 0px; +} + +/* @end */ + diff --git a/Document/html/css/stylesPrint.css b/Document/html/css/stylesPrint.css new file mode 100644 index 0000000..dc54cd2 --- /dev/null +++ b/Document/html/css/stylesPrint.css @@ -0,0 +1,22 @@ + +header { + display: none; +} + +div.main-navigation, div.navigation-top { + display: none; +} + +div#overview_contents, div#contents.isShowingTOC, div#contents { + overflow: visible; + position: relative; + top: 0px; + border: none; + left: 0; +} +#tocContainer.isShowingTOC { + display: none; +} +nav { + display: none; +} \ No newline at end of file diff --git a/Document/html/hierarchy.html b/Document/html/hierarchy.html new file mode 100644 index 0000000..708d90f --- /dev/null +++ b/Document/html/hierarchy.html @@ -0,0 +1,108 @@ + + + + + Konashi iOS SDK Hierarchy + + + + + +
+
+

Konashi iOS SDK

+ YUKAI Engineering +
+ + + +
+
+
+ + +
+ +
+

Class Hierarchy

+ + + +
+ + + + + +
+ + +
+
+ + \ No newline at end of file diff --git a/Document/html/img/button_bar_background.png b/Document/html/img/button_bar_background.png new file mode 100644 index 0000000..71d1019 Binary files /dev/null and b/Document/html/img/button_bar_background.png differ diff --git a/Document/html/img/disclosure.png b/Document/html/img/disclosure.png new file mode 100644 index 0000000..4c5cbf4 Binary files /dev/null and b/Document/html/img/disclosure.png differ diff --git a/Document/html/img/disclosure_open.png b/Document/html/img/disclosure_open.png new file mode 100644 index 0000000..82396fe Binary files /dev/null and b/Document/html/img/disclosure_open.png differ diff --git a/Document/html/img/library_background.png b/Document/html/img/library_background.png new file mode 100644 index 0000000..3006248 Binary files /dev/null and b/Document/html/img/library_background.png differ diff --git a/Document/html/img/title_background.png b/Document/html/img/title_background.png new file mode 100644 index 0000000..846e496 Binary files /dev/null and b/Document/html/img/title_background.png differ diff --git a/Document/html/index.html b/Document/html/index.html new file mode 100644 index 0000000..8d2337e --- /dev/null +++ b/Document/html/index.html @@ -0,0 +1,104 @@ + + + + + Konashi iOS SDK Reference + + + + + +
+
+

Konashi iOS SDK

+ YUKAI Engineering +
+ + + +
+
+
+ + +
+ + + + + +
+

Class References

+ +
+ + + + + +
+ + +
+
+ + \ No newline at end of file diff --git a/Konashi.xcworkspace/contents.xcworkspacedata b/Konashi.xcworkspace/contents.xcworkspacedata index b841f52..cbc00c2 100644 --- a/Konashi.xcworkspace/contents.xcworkspacedata +++ b/Konashi.xcworkspace/contents.xcworkspacedata @@ -1,9 +1,6 @@ - - @@ -14,7 +11,7 @@ location = "group:samples/AioSample/AioSample.xcodeproj"> + location = "group:samples/BlinkLed/BlinkLed.xcodeproj"> @@ -26,21 +23,21 @@ location = "group:samples/I2cSample/I2cSample.xcodeproj"> + location = "group:samples/JSBindingsSample/JSBindingsSample.xcodeproj"> + location = "group:samples/MultiNodeSample/MultiNodeSample.xcodeproj"> + location = "group:samples/PioDrive/PioDrive.xcodeproj"> + location = "group:samples/PwmDrive/PwmDrive.xcodeproj"> + location = "group:samples/UartSample/UartSample.xcodeproj"> + location = "group:Konashi/Konashi.xcodeproj"> diff --git a/Konashi/Konashi.xcodeproj/project.pbxproj b/Konashi/Konashi.xcodeproj/project.pbxproj index 6c01493..b9a21be 100644 --- a/Konashi/Konashi.xcodeproj/project.pbxproj +++ b/Konashi/Konashi.xcodeproj/project.pbxproj @@ -357,7 +357,7 @@ E91E548619C8F2750071D7C9 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0510; + LastUpgradeCheck = 0700; ORGANIZATIONNAME = "Akira Matsuda"; }; buildConfigurationList = E91E548919C8F2750071D7C9 /* Build configuration list for PBXProject "Konashi" */; @@ -466,6 +466,7 @@ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; @@ -566,6 +567,7 @@ "$(inherited)", ); INFOPLIST_FILE = "KonashiTests/KonashiTests-Info.plist"; + PRODUCT_BUNDLE_IDENTIFIER = "com.akira.matsuda.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = xctest; }; @@ -582,6 +584,7 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "Konashi/Konashi-Prefix.pch"; INFOPLIST_FILE = "KonashiTests/KonashiTests-Info.plist"; + PRODUCT_BUNDLE_IDENTIFIER = "com.akira.matsuda.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = xctest; }; diff --git a/Konashi/Konashi.xcodeproj/xcuserdata/Akira.xcuserdatad/xcschemes/Konashi.xcscheme b/Konashi/Konashi.xcodeproj/xcuserdata/Akira.xcuserdatad/xcschemes/Konashi.xcscheme index 9a69622..49cfb54 100644 --- a/Konashi/Konashi.xcodeproj/xcuserdata/Akira.xcuserdatad/xcschemes/Konashi.xcscheme +++ b/Konashi/Konashi.xcodeproj/xcuserdata/Akira.xcuserdatad/xcschemes/Konashi.xcscheme @@ -1,6 +1,6 @@ + + + + + + diff --git a/Konashi/Konashi/Constant/KonashiConstant.h b/Konashi/Konashi/Constant/KonashiConstant.h index e0c0f1a..f2e2da3 100644 --- a/Konashi/Konashi/Constant/KonashiConstant.h +++ b/Konashi/Konashi/Constant/KonashiConstant.h @@ -155,15 +155,4 @@ typedef NS_ENUM(int, KonashiUartBaudrate) { KonashiUartBaudrateRate115K2 = 0x01e0 }; -typedef void(^KonashiEventHandler)(); -typedef void(^KonashiEventHandler1)(int value); -typedef void(^KonashiEventHandler2)(unsigned char value); -typedef void(^KonashiEventHandler3)(NSData *data); -typedef void(^KonashiDigitalPinDidChangeValueHandler)(KonashiDigitalIOPin pin, int value); -typedef void(^KonashiAnalogPinDidChangeValueHandler)(KonashiAnalogIOPin pin, int value); -typedef KonashiEventHandler3 KonashiUartRxCompleteHandler; -typedef KonashiEventHandler3 KonashiI2CReadCompleteHandler; -typedef KonashiEventHandler1 KonashiBatteryLevelDidUpdateHandler; -typedef KonashiEventHandler1 KonashiSignalStrengthDidUpdateHandler; - #endif diff --git a/Konashi/Konashi/KNSCentralManager.m b/Konashi/Konashi/KNSCentralManager.m index 37a6d87..edfca0c 100644 --- a/Konashi/Konashi/KNSCentralManager.m +++ b/Konashi/Konashi/KNSCentralManager.m @@ -162,8 +162,9 @@ - (void)connectWithName:(NSString*)name timeout:(NSTimeInterval)timeout connecte if (self.state != CBCentralManagerStatePoweredOn) { KNS_LOG(@"CoreBluetooth not correctly initialized !"); } + __weak NSString *n = name; [self discover:^(CBPeripheral *peripheral, BOOL *stop) { - if ([peripheral.name isEqualToString:name]) { + if ([peripheral.name isEqualToString:n]) { connectedHandler([self connectWithPeripheral:peripheral]); *stop = YES; } diff --git a/Konashi/Konashi/KNSHandlerManager.h b/Konashi/Konashi/KNSHandlerManager.h index 0e2021d..54e6143 100644 --- a/Konashi/Konashi/KNSHandlerManager.h +++ b/Konashi/Konashi/KNSHandlerManager.h @@ -11,15 +11,15 @@ @interface KNSHandlerManager : NSObject -@property (nonatomic, copy) KonashiEventHandler connectedHandler; -@property (nonatomic, copy) KonashiEventHandler disconnectedHandler; -@property (nonatomic, copy) KonashiEventHandler readyHandler; -@property (nonatomic, copy) KonashiDigitalPinDidChangeValueHandler digitalInputDidChangeValueHandler; -@property (nonatomic, copy) KonashiDigitalPinDidChangeValueHandler digitalOutputDidChangeValueHandler; -@property (nonatomic, copy) KonashiAnalogPinDidChangeValueHandler analogPinDidChangeValueHandler; -@property (nonatomic, copy) KonashiUartRxCompleteHandler uartRxCompleteHandler; -@property (nonatomic, copy) KonashiI2CReadCompleteHandler i2cReadCompleteHandler; -@property (nonatomic, copy) KonashiBatteryLevelDidUpdateHandler batteryLevelDidUpdateHandler; -@property (nonatomic, copy) KonashiSignalStrengthDidUpdateHandler signalStrengthDidUpdateHandler; +@property (nonatomic, copy) void (^connectedHandler)(); +@property (nonatomic, copy) void (^disconnectedHandler)(); +@property (nonatomic, copy) void (^readyHandler)(); +@property (nonatomic, copy) void (^digitalInputDidChangeValueHandler)(KonashiDigitalIOPin pin, int value); +@property (nonatomic, copy) void (^digitalOutputDidChangeValueHandler)(KonashiDigitalIOPin pin, int value); +@property (nonatomic, copy) void (^analogPinDidChangeValueHandler)(KonashiAnalogIOPin pin, int value); +@property (nonatomic, copy) void (^uartRxCompleteHandler)(NSData *data); +@property (nonatomic, copy) void (^i2cReadCompleteHandler)(NSData *data); +@property (nonatomic, copy) void (^batteryLevelDidUpdateHandler)(int value); +@property (nonatomic, copy) void (^signalStrengthDidUpdateHandler)(int value); @end diff --git a/Konashi/Konashi/KNSPeripheral.h b/Konashi/Konashi/KNSPeripheral.h index d6dfd66..8bb0d14 100644 --- a/Konashi/Konashi/KNSPeripheral.h +++ b/Konashi/Konashi/KNSPeripheral.h @@ -30,52 +30,52 @@ /** * このHandlerはKonashiが接続された際に呼び出されます。 */ -@property (nonatomic, copy) KonashiEventHandler connectedHandler; +@property (nonatomic, copy) void (^connectedHandler)(); /** * このHandlerはKonashiが切断された際に呼び出されます。 */ -@property (nonatomic, copy) KonashiEventHandler disconnectedHandler; +@property (nonatomic, copy) void (^disconnectedHandler)(); /** * このHandlerはKonashiが使用可能状態になった際に呼び出されます。 */ -@property (nonatomic, copy) KonashiEventHandler readyHandler; +@property (nonatomic, copy) void (^readyHandler)(); /** * このHandlerはKonashiPinModeInputに設定されているPIOの値が変化した際に呼び出されます。 */ -@property (nonatomic, copy) KonashiDigitalPinDidChangeValueHandler digitalInputDidChangeValueHandler; +@property (nonatomic, copy) void (^digitalInputDidChangeValueHandler)(KonashiDigitalIOPin pin, int value); /** * このHandlerはKonashiPinModeOutputに設定されているPIOの値が変化した際に呼び出されます。 */ -@property (nonatomic, copy) KonashiDigitalPinDidChangeValueHandler digitalOutputDidChangeValueHandler; +@property (nonatomic, copy) void (^digitalOutputDidChangeValueHandler)(KonashiDigitalIOPin pin, int value); /** * このHandlerはAIOの値が変化した際に呼び出されます。 */ -@property (nonatomic, copy) KonashiAnalogPinDidChangeValueHandler analogPinDidChangeValueHandler; +@property (nonatomic, copy) void (^analogPinDidChangeValueHandler)(KonashiAnalogIOPin pin, int value); /** * このHandlerはUartで値を受信した際に呼び出されます。 */ -@property (nonatomic, copy) KonashiUartRxCompleteHandler uartRxCompleteHandler; +@property (nonatomic, copy) void (^uartRxCompleteHandler)(NSData *data); /** * このHandlerはI2Cで接続されたモジュールからデータを読みだした際に呼び出されます。 */ -@property (nonatomic, copy) KonashiI2CReadCompleteHandler i2cReadCompleteHandler; +@property (nonatomic, copy) void (^i2cReadCompleteHandler)(NSData *data); /** * このHandlerはバッテリー残量の値を取得した際に呼び出されます。 */ -@property (nonatomic, copy) KonashiBatteryLevelDidUpdateHandler batteryLevelDidUpdateHandler; +@property (nonatomic, copy) void (^batteryLevelDidUpdateHandler)(int value); /** * このHandlerはRSSIが変化した際に呼び出されます。 */ -@property (nonatomic, copy) KonashiSignalStrengthDidUpdateHandler signalStrengthDidUpdateHandler; +@property (nonatomic, copy) void (^signalStrengthDidUpdateHandler)(int value); - (instancetype)initWithPeripheral:(CBPeripheral *)p; - (void)writeData:(NSData *)data serviceUUID:(CBUUID*)uuid characteristicUUID:(CBUUID*)charasteristicUUID; diff --git a/Konashi/Konashi/KNSPeripheral.m b/Konashi/Konashi/KNSPeripheral.m index 7b4bf81..9ef407f 100644 --- a/Konashi/Konashi/KNSPeripheral.m +++ b/Konashi/Konashi/KNSPeripheral.m @@ -52,52 +52,52 @@ - (void)setHandlerManager:(KNSHandlerManager *)handlerManager _impl.handlerManager = _handlerManager; } -- (void)setConnectedHandler:(KonashiEventHandler)connectedHander +- (void)setConnectedHandler:(void (^)())connectedHandler { - _handlerManager.connectedHandler = connectedHander; + _handlerManager.connectedHandler = connectedHandler; } -- (void)setDisconnectedHandler:(KonashiEventHandler)disconnectedHandler +- (void)setDisconnectedHandler:(void (^)())disconnectedHandler { _handlerManager.disconnectedHandler = disconnectedHandler; } -- (void)setReadyHandler:(KonashiEventHandler)readyHander +- (void)setReadyHandler:(void (^)())readyHandler { - _handlerManager.readyHandler = readyHander; + _handlerManager.readyHandler = readyHandler; } -- (void)setDigitalInputDidChangeValueHandler:(KonashiDigitalPinDidChangeValueHandler)digitalInputDidChangeValueHandler +- (void)setDigitalInputDidChangeValueHandler:(void (^)(KonashiDigitalIOPin, int))digitalInputDidChangeValueHandler { _handlerManager.digitalInputDidChangeValueHandler = digitalInputDidChangeValueHandler; } -- (void)setDigitalOutputDidChangeValueHandler:(KonashiDigitalPinDidChangeValueHandler)digitalOutputDidChangeValueHandler +- (void)setDigitalOutputDidChangeValueHandler:(void (^)(KonashiDigitalIOPin, int))digitalOutputDidChangeValueHandler { _handlerManager.digitalOutputDidChangeValueHandler = digitalOutputDidChangeValueHandler; } -- (void)setAnalogPinDidChangeValueHandler:(KonashiAnalogPinDidChangeValueHandler)analogPinDidChangeValueHandler +- (void)setAnalogPinDidChangeValueHandler:(void (^)(KonashiAnalogIOPin, int))analogPinDidChangeValueHandler { _handlerManager.analogPinDidChangeValueHandler = analogPinDidChangeValueHandler; } -- (void)setUartRxCompleteHandler:(KonashiUartRxCompleteHandler)uartRxCompleteHandler +- (void)setUartRxCompleteHandler:(void (^)(NSData *))uartRxCompleteHandler { _handlerManager.uartRxCompleteHandler = uartRxCompleteHandler; } -- (void)setI2cReadCompleteHandler:(KonashiI2CReadCompleteHandler)i2cReadCompleteHandler +- (void)setI2cReadCompleteHandler:(void (^)(NSData *))i2cReadCompleteHandler { _handlerManager.i2cReadCompleteHandler = i2cReadCompleteHandler; } -- (void)setBatteryLevelDidUpdateHandler:(KonashiBatteryLevelDidUpdateHandler)batteryLevelDidUpdateHandler +- (void)setBatteryLevelDidUpdateHandler:(void (^)(int))batteryLevelDidUpdateHandler { _handlerManager.batteryLevelDidUpdateHandler = batteryLevelDidUpdateHandler; } -- (void)setSignalStrengthDidUpdateHandler:(KonashiSignalStrengthDidUpdateHandler)signalStrengthDidUpdateHandler +- (void)setSignalStrengthDidUpdateHandler:(void (^)(int))signalStrengthDidUpdateHandler { _handlerManager.signalStrengthDidUpdateHandler = signalStrengthDidUpdateHandler; } diff --git a/Konashi/Konashi/Konashi.h b/Konashi/Konashi/Konashi.h index 485c3ba..7f4caf9 100644 --- a/Konashi/Konashi/Konashi.h +++ b/Konashi/Konashi/Konashi.h @@ -39,52 +39,52 @@ /** * このHandlerはKonashiが接続された際に呼び出されます。 */ -@property (nonatomic, copy) KonashiEventHandler connectedHandler; +@property (nonatomic, copy) void (^connectedHandler)(); /** * このHandlerはKonashiが切断された際に呼び出されます。 */ -@property (nonatomic, copy) KonashiEventHandler disconnectedHandler; +@property (nonatomic, copy) void (^disconnectedHandler)(); /** * このHandlerはKonashiが使用可能状態になった際に呼び出されます。 */ -@property (nonatomic, copy) KonashiEventHandler readyHandler; +@property (nonatomic, copy) void (^readyHandler)(); /** * このHandlerはKonashiPinModeInputに設定されているPIOの値が変化した際に呼び出されます。 */ -@property (nonatomic, copy) KonashiDigitalPinDidChangeValueHandler digitalInputDidChangeValueHandler; +@property (nonatomic, copy) void (^digitalInputDidChangeValueHandler)(KonashiDigitalIOPin pin, int value); /** * このHandlerはKonashiPinModeOutputに設定されているPIOの値が変化した際に呼び出されます。 */ -@property (nonatomic, copy) KonashiDigitalPinDidChangeValueHandler digitalOutputDidChangeValueHandler; +@property (nonatomic, copy) void (^digitalOutputDidChangeValueHandler)(KonashiDigitalIOPin pin, int value); /** * このHandlerはAIOの値が変化した際に呼び出されます。 */ -@property (nonatomic, copy) KonashiAnalogPinDidChangeValueHandler analogPinDidChangeValueHandler; +@property (nonatomic, copy) void (^analogPinDidChangeValueHandler)(KonashiAnalogIOPin pin, int value); /** * このHandlerはUartで値を受信した際に呼び出されます。 */ -@property (nonatomic, copy) KonashiUartRxCompleteHandler uartRxCompleteHandler; +@property (nonatomic, copy) void (^uartRxCompleteHandler)(NSData *data); /** * このHandlerはI2Cで接続されたモジュールからデータを読みだした際に呼び出されます。 */ -@property (nonatomic, copy) KonashiI2CReadCompleteHandler i2cReadCompleteHandler; +@property (nonatomic, copy) void (^i2cReadCompleteHandler)(NSData *data); /** * このHandlerはバッテリー残量の値を取得した際に呼び出されます。 */ -@property (nonatomic, copy) KonashiBatteryLevelDidUpdateHandler batteryLevelDidUpdateHandler; +@property (nonatomic, copy) void (^batteryLevelDidUpdateHandler)(int value); /** * このHandlerはRSSIが変化した際に呼び出されます。 */ -@property (nonatomic, copy) KonashiSignalStrengthDidUpdateHandler signalStrengthDidUpdateHandler; +@property (nonatomic, copy) void (^signalStrengthDidUpdateHandler)(int value); /// --------------------------------- /// @name Basic method @@ -558,7 +558,4 @@ */ + (unsigned char) uartRead __attribute__ ((deprecated)); -+ (void) addObserver:(id)notificationObserver selector:(SEL)notificationSelector name:(NSString*)notificationName __attribute__ ((deprecated)); -+ (void) removeObserver:(id)notificationObserver __attribute__ ((deprecated)); - @end diff --git a/Konashi/Konashi/Konashi.m b/Konashi/Konashi/Konashi.m index b63177e..d51c73f 100644 --- a/Konashi/Konashi/Konashi.m +++ b/Konashi/Konashi/Konashi.m @@ -27,12 +27,10 @@ #import "CBUUID+Konashi.h" @interface Konashi () -{ - NSString *findName; - KNSHandlerManager *handlerManager; -} +@property (nonatomic, strong) NSString *findName; @property (nonatomic, assign) BOOL callFind; +@property (nonatomic, strong) KNSHandlerManager *handlerManager; @end @@ -43,16 +41,16 @@ @implementation Konashi + (Konashi *) shared { - static Konashi *_konashi = nil; - - @synchronized (self){ - static dispatch_once_t pred; - dispatch_once(&pred, ^{ - _konashi = [[Konashi alloc] init]; - }); - } + static Konashi *_konashi = nil; + + @synchronized (self){ + static dispatch_once_t pred; + dispatch_once(&pred, ^{ + _konashi = [[Konashi alloc] init]; + }); + } - return _konashi; + return _konashi; } - (instancetype)init @@ -60,14 +58,13 @@ - (instancetype)init self = [super init]; if (self) { [KNSCentralManager sharedInstance]; - handlerManager = [KNSHandlerManager new]; - __weak typeof(findName) bfindName = findName; + self.handlerManager = [KNSHandlerManager new]; [[NSNotificationCenter defaultCenter] addObserverForName:KonashiEventCentralManagerPowerOnNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *note) { if (_callFind) { _callFind = NO; - if (bfindName) { + if (self.findName) { KNS_LOG(@"Try findWithName"); - [Konashi findWithName:bfindName]; + [Konashi findWithName:self.findName]; } else { [Konashi find]; @@ -76,6 +73,16 @@ - (instancetype)init }]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(readyToUse:) name:KonashiEventReadyToUseNotification object:nil]; + [[NSNotificationCenter defaultCenter] addObserverForName:KonashiEventConnectedNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *note) { + if ([Konashi shared].connectedHandler) { + [Konashi shared].connectedHandler(); + } + }]; + [[NSNotificationCenter defaultCenter] addObserverForName:KonashiEventDisconnectedNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *note) { + if ([Konashi shared].disconnectedHandler) { + [Konashi shared].disconnectedHandler(); + } + }]; } return self; @@ -86,11 +93,14 @@ - (void)readyToUse:(NSNotification *)note KNSPeripheral *connectedPeripheral = [note userInfo][KonashiPeripheralKey]; KNS_LOG(@"Peripheral(UUID : %@) is ready to use.", connectedPeripheral.peripheral.identifier.UUIDString); _activePeripheral = connectedPeripheral; - _activePeripheral.handlerManager = handlerManager; + _activePeripheral.handlerManager = self.handlerManager; // Enable PIO input notification [_activePeripheral enablePIOInputNotification]; // Enable UART RX notification [_activePeripheral enableUART_RXNotification]; + if (self.readyHandler) { + self.readyHandler(); + } } #pragma mark - @@ -124,6 +134,7 @@ + (KonashiResult) findWithName:(NSString*)name KNS_LOG(@"CoreBluetooth not correctly initialized !"); KNS_LOG(@"State = %ld (%@)", (long)[KNSCentralManager sharedInstance].state, NSStringFromCBCentralManagerState([KNSCentralManager sharedInstance].state)); [Konashi shared].callFind = YES; + [Konashi shared].findName = name; return KonashiResultSuccess; } [[KNSCentralManager sharedInstance] connectWithName:name timeout:KonashiFindTimeoutInterval connectedHandler:^(KNSPeripheral *connectedPeripheral) { @@ -155,35 +166,35 @@ + (BOOL) isConnected + (BOOL) isReady { - return [[Konashi shared].activePeripheral isReady]; + return [[Konashi shared].activePeripheral isReady]; } + (NSString *) peripheralName { - return [Konashi shared].activePeripheral.peripheral.name; + return [Konashi shared].activePeripheral.peripheral.name; } #pragma mark - #pragma mark - Konashi PIO public methods + (KonashiResult) pinMode:(KonashiDigitalIOPin)pin mode:(KonashiPinMode)mode -{ - return [[Konashi shared].activePeripheral pinMode:pin mode:mode]; +{ + return [[Konashi shared].activePeripheral pinMode:pin mode:mode]; } + (KonashiResult) pinModeAll:(int)mode { - return [[Konashi shared].activePeripheral pinModeAll:mode]; + return [[Konashi shared].activePeripheral pinModeAll:mode]; } + (KonashiResult) pinPullup:(KonashiDigitalIOPin)pin mode:(KonashiPinMode)mode { - return [[Konashi shared].activePeripheral pinPullup:pin mode:mode]; + return [[Konashi shared].activePeripheral pinPullup:pin mode:mode]; } + (KonashiResult) pinPullupAll:(int)mode { - return [[Konashi shared].activePeripheral pinPullupAll:mode]; + return [[Konashi shared].activePeripheral pinPullupAll:mode]; } + (KonashiResult) digitalWrite:(KonashiDigitalIOPin)pin value:(KonashiLevel)value @@ -211,22 +222,22 @@ + (int) digitalReadAll + (KonashiResult) pwmMode:(KonashiDigitalIOPin)pin mode:(KonashiPWMMode)mode { - return [[Konashi shared].activePeripheral pwmMode:pin mode:mode]; + return [[Konashi shared].activePeripheral pwmMode:pin mode:mode]; } + (KonashiResult) pwmPeriod:(KonashiDigitalIOPin)pin period:(unsigned int)period { - return [[Konashi shared].activePeripheral pwmPeriod:pin period:period]; + return [[Konashi shared].activePeripheral pwmPeriod:pin period:period]; } + (KonashiResult) pwmDuty:(KonashiDigitalIOPin)pin duty:(unsigned int)duty { - return [[Konashi shared].activePeripheral pwmDuty:pin duty:duty]; + return [[Konashi shared].activePeripheral pwmDuty:pin duty:duty]; } + (KonashiResult) pwmLedDrive:(KonashiDigitalIOPin)pin dutyRatio:(int)ratio { - return [[Konashi shared].activePeripheral pwmLedDrive:pin dutyRatio:ratio]; + return [[Konashi shared].activePeripheral pwmLedDrive:pin dutyRatio:ratio]; } #pragma mark - @@ -234,17 +245,17 @@ + (KonashiResult) pwmLedDrive:(KonashiDigitalIOPin)pin dutyRatio:(int)ratio + (int) analogReference { - return [[Konashi shared].activePeripheral analogReference]; + return [[Konashi shared].activePeripheral analogReference]; } + (KonashiResult) analogReadRequest:(KonashiAnalogIOPin)pin { - return [[Konashi shared].activePeripheral analogReadRequest:pin]; + return [[Konashi shared].activePeripheral analogReadRequest:pin]; } + (KonashiResult) analogWrite:(KonashiAnalogIOPin)pin milliVolt:(int)milliVolt { - return [[Konashi shared].activePeripheral analogWrite:pin milliVolt:(int)milliVolt]; + return [[Konashi shared].activePeripheral analogWrite:pin milliVolt:(int)milliVolt]; } + (int) analogRead:(KonashiAnalogIOPin)pin @@ -257,22 +268,22 @@ + (int) analogRead:(KonashiAnalogIOPin)pin + (KonashiResult) i2cMode:(KonashiI2CMode)mode { - return [[Konashi shared].activePeripheral i2cMode:mode]; + return [[Konashi shared].activePeripheral i2cMode:mode]; } + (KonashiResult) i2cStartCondition { - return [[Konashi shared].activePeripheral i2cSendCondition:KonashiI2CConditionStart]; + return [[Konashi shared].activePeripheral i2cSendCondition:KonashiI2CConditionStart]; } + (KonashiResult) i2cRestartCondition { - return [[Konashi shared].activePeripheral i2cSendCondition:KonashiI2CConditionRestart]; + return [[Konashi shared].activePeripheral i2cSendCondition:KonashiI2CConditionRestart]; } + (KonashiResult) i2cStopCondition { - return [[Konashi shared].activePeripheral i2cSendCondition:KonashiI2CConditionStop]; + return [[Konashi shared].activePeripheral i2cSendCondition:KonashiI2CConditionStop]; } + (KonashiResult)i2cWriteData:(NSData *)data address:(unsigned char)address @@ -287,7 +298,7 @@ + (KonashiResult) i2cWriteString:(NSString *)data address:(unsigned char)address + (KonashiResult) i2cReadRequest:(int)length address:(unsigned char)address { - return [[Konashi shared].activePeripheral i2cReadRequest:length address:address]; + return [[Konashi shared].activePeripheral i2cReadRequest:length address:address]; } + (NSData *)i2cReadData @@ -323,91 +334,141 @@ + (NSData *)readUartData + (KonashiResult) reset { - return [[Konashi shared].activePeripheral reset]; + return [[Konashi shared].activePeripheral reset]; } + (KonashiResult) batteryLevelReadRequest { - return [[Konashi shared].activePeripheral batteryLevelReadRequest]; + return [[Konashi shared].activePeripheral batteryLevelReadRequest]; } + (KonashiResult) signalStrengthReadRequest { - return [[Konashi shared].activePeripheral signalStrengthReadRequest]; + return [[Konashi shared].activePeripheral signalStrengthReadRequest]; } #pragma mark - #pragma mark - Blocks -- (void)setConnectedHandler:(KonashiEventHandler)connectedHander +- (void)setConnectedHandler:(void (^)())connectedHandler +{ + self.handlerManager.connectedHandler = connectedHandler; +} + +- (void (^)())connectedHandler { - handlerManager.connectedHandler = connectedHander; + return self.handlerManager.connectedHandler; } -- (void)setDisconnectedHandler:(KonashiEventHandler)disconnectedHandler +- (void)setDisconnectedHandler:(void (^)())disconnectedHandler { - handlerManager.disconnectedHandler = disconnectedHandler; + self.handlerManager.disconnectedHandler = disconnectedHandler; } -- (void)setReadyHandler:(KonashiEventHandler)readyHander +- (void (^)())disconnectedHandler { - handlerManager.readyHandler = readyHander; + return self.handlerManager.disconnectedHandler; } -- (void)setDigitalInputDidChangeValueHandler:(KonashiDigitalPinDidChangeValueHandler)digitalInputDidChangeValueHandler +- (void)setReadyHandler:(void (^)())readyHandler { - handlerManager.digitalInputDidChangeValueHandler = digitalInputDidChangeValueHandler; + self.handlerManager.readyHandler = readyHandler; } -- (void)setDigitalOutputDidChangeValueHandler:(KonashiDigitalPinDidChangeValueHandler)digitalOutputDidChangeValueHandler +- (void (^)())readyHandler { - handlerManager.digitalOutputDidChangeValueHandler = digitalOutputDidChangeValueHandler; + return self.handlerManager.readyHandler; } -- (void)setAnalogPinDidChangeValueHandler:(KonashiAnalogPinDidChangeValueHandler)analogPinDidChangeValueHandler +- (void)setDigitalInputDidChangeValueHandler:(void (^)(KonashiDigitalIOPin, int))digitalInputDidChangeValueHandler { - handlerManager.analogPinDidChangeValueHandler = analogPinDidChangeValueHandler; + self.handlerManager.digitalInputDidChangeValueHandler = digitalInputDidChangeValueHandler; } -- (void)setUartRxCompleteHandler:(KonashiUartRxCompleteHandler)uartRxCompleteHandler +- (void (^)(KonashiDigitalIOPin, int))digitalInputDidChangeValueHandler { - handlerManager.uartRxCompleteHandler = uartRxCompleteHandler; + return self.handlerManager.digitalInputDidChangeValueHandler; } -- (void)setI2cReadCompleteHandler:(KonashiI2CReadCompleteHandler)i2cReadCompleteHandler +- (void)setDigitalOutputDidChangeValueHandler:(void (^)(KonashiDigitalIOPin, int))digitalOutputDidChangeValueHandler { - handlerManager.i2cReadCompleteHandler = i2cReadCompleteHandler; + self.handlerManager.digitalOutputDidChangeValueHandler = digitalOutputDidChangeValueHandler; } -- (void)setBatteryLevelDidUpdateHandler:(KonashiBatteryLevelDidUpdateHandler)batteryLevelDidUpdateHandler +- (void (^)(KonashiDigitalIOPin, int))digitalOutputDidChangeValueHandler { - handlerManager.batteryLevelDidUpdateHandler = batteryLevelDidUpdateHandler; + return self.handlerManager.digitalOutputDidChangeValueHandler; } -- (void)setSignalStrengthDidUpdateHandler:(KonashiSignalStrengthDidUpdateHandler)signalStrengthDidUpdateHandler +- (void)setAnalogPinDidChangeValueHandler:(void (^)(KonashiAnalogIOPin, int))analogPinDidChangeValueHandler { - handlerManager.signalStrengthDidUpdateHandler = signalStrengthDidUpdateHandler; + self.handlerManager.analogPinDidChangeValueHandler = analogPinDidChangeValueHandler; +} + +- (void (^)(KonashiAnalogIOPin, int))analogPinDidChangeValueHandler +{ + return self.handlerManager.analogPinDidChangeValueHandler; +} + +- (void)setUartRxCompleteHandler:(void (^)(NSData *))uartRxCompleteHandler +{ + self.handlerManager.uartRxCompleteHandler = uartRxCompleteHandler; +} + +- (void (^)(NSData *))uartRxCompleteHandler +{ + return self.handlerManager.uartRxCompleteHandler; +} + +- (void)setI2cReadCompleteHandler:(void (^)(NSData *))i2cReadCompleteHandler +{ + self.handlerManager.i2cReadCompleteHandler = i2cReadCompleteHandler; +} + +- (void (^)(NSData *))i2cReadCompleteHandler +{ + return self.handlerManager.i2cReadCompleteHandler; +} + +- (void)setBatteryLevelDidUpdateHandler:(void (^)(int))batteryLevelDidUpdateHandler +{ + self.handlerManager.batteryLevelDidUpdateHandler = batteryLevelDidUpdateHandler; +} + +- (void (^)(int))batteryLevelDidUpdateHandler +{ + return self.handlerManager.batteryLevelDidUpdateHandler; +} + +- (void)setSignalStrengthDidUpdateHandler:(void (^)(int))signalStrengthDidUpdateHandler +{ + self.handlerManager.signalStrengthDidUpdateHandler = signalStrengthDidUpdateHandler; +} + +- (void (^)(int))signalStrengthDidUpdateHandler +{ + return self.handlerManager.signalStrengthDidUpdateHandler; } #pragma mark - Depricated methods - (BOOL) _isConnected { - return (self.activePeripheral && self.activePeripheral.state == CBPeripheralStateConnected); + return (self.activePeripheral && self.activePeripheral.state == CBPeripheralStateConnected); } - (BOOL) _isReady { - return [[Konashi shared].activePeripheral isReady]; + return [[Konashi shared].activePeripheral isReady]; } - (NSString *) _peripheralName { - if(self.activePeripheral && self.activePeripheral.state == CBPeripheralStateConnected){ - return self.activePeripheral.peripheral.name; - } else { - return @""; - } + if(self.activePeripheral && self.activePeripheral.state == CBPeripheralStateConnected){ + return self.activePeripheral.peripheral.name; + } else { + return @""; + } } #pragma mark - Deprecated @@ -465,24 +526,4 @@ + (int) signalStrengthRead return [[Konashi shared].activePeripheral signalStrengthRead]; } -#pragma mark - Notification - -+ (void) addObserver:(id)notificationObserver selector:(SEL)notificationSelector name:(NSString*)notificationName -{ - NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; - [nc addObserver:notificationObserver selector:notificationSelector name:notificationName object:nil]; -} - -+ (void) removeObserver:(id)notificationObserver -{ - NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; - [nc removeObserver:notificationObserver]; -} - -- (void) postNotification:(NSString*)notificationName -{ - NSNotification *n = [NSNotification notificationWithName:notificationName object:self]; - [[NSNotificationCenter defaultCenter] postNotification:n]; -} - @end diff --git a/Konashi/KonashiTests/KonashiTests-Info.plist b/Konashi/KonashiTests/KonashiTests-Info.plist index 55a962c..169b6f7 100644 --- a/Konashi/KonashiTests/KonashiTests-Info.plist +++ b/Konashi/KonashiTests/KonashiTests-Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier - com.akira.matsuda.${PRODUCT_NAME:rfc1034identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType diff --git a/README.md b/README.md index cb5e259..b0bbfe5 100644 --- a/README.md +++ b/README.md @@ -13,12 +13,12 @@ Physical computing toolkit for smartphones and tablets --- ## CocoaPods に対応しました -以下の様な Podfile を作成。(ios6.1を指定) +以下の様な Podfile を作成。 ``` source "https://github.com/CocoaPods/Specs.git" platform :ios, "7.1" -pod "konashi-ios-sdk", "~> 3.0" +pod "konashi-ios-sdk" ``` そして diff --git a/samples/ACDriveExtension/ACDriveExtension.xcodeproj/project.pbxproj b/samples/ACDriveExtension/ACDriveExtension.xcodeproj/project.pbxproj index 156b6c5..2d9c150 100644 --- a/samples/ACDriveExtension/ACDriveExtension.xcodeproj/project.pbxproj +++ b/samples/ACDriveExtension/ACDriveExtension.xcodeproj/project.pbxproj @@ -275,6 +275,7 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "ACDriveExtension/ACDriveExtension-Prefix.pch"; INFOPLIST_FILE = "ACDriveExtension/ACDriveExtension-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 7.1; LIBRARY_SEARCH_PATHS = "$(inherited)"; OTHER_LDFLAGS = ( "-all_load", @@ -292,6 +293,7 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "ACDriveExtension/ACDriveExtension-Prefix.pch"; INFOPLIST_FILE = "ACDriveExtension/ACDriveExtension-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 7.1; LIBRARY_SEARCH_PATHS = "$(inherited)"; OTHER_LDFLAGS = ( "-all_load", diff --git a/samples/ACDriveExtension/ACDriveExtension/ACDriveExtension-Info.plist b/samples/ACDriveExtension/ACDriveExtension/ACDriveExtension-Info.plist index 8f474e1..9215eb5 100644 --- a/samples/ACDriveExtension/ACDriveExtension/ACDriveExtension-Info.plist +++ b/samples/ACDriveExtension/ACDriveExtension/ACDriveExtension-Info.plist @@ -9,7 +9,7 @@ CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier - com.ux-xu.konashi.${PRODUCT_NAME:rfc1034identifier} + com.ux-xu.konashi.$(PRODUCT_NAME:rfc1034identifier) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/samples/ACDriveExtension/ACDriveExtension/ViewController.m b/samples/ACDriveExtension/ACDriveExtension/ViewController.m index d48a437..2b8aabd 100644 --- a/samples/ACDriveExtension/ACDriveExtension/ViewController.m +++ b/samples/ACDriveExtension/ACDriveExtension/ViewController.m @@ -21,10 +21,11 @@ - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. - [Konashi initialize]; - [Konashi addObserver:self selector:@selector(ready) name:KonashiEventReadyToUseNotification]; - - timer=[NSTimer scheduledTimerWithTimeInterval:0.15f target:self selector:@selector(refreshDuty) userInfo:nil repeats:YES]; + [[Konashi shared] setReadyHandler:^{ + NSLog(@"Ready"); + [Konashi initACDrive:KONASHI_AC_MODE_PWM freq:KONASHI_AC_FREQ_50HZ]; + }]; + timer = [NSTimer scheduledTimerWithTimeInterval:0.15f target:self selector:@selector(refreshDuty) userInfo:nil repeats:YES]; [timer fire]; } @@ -37,16 +38,11 @@ - (void)didReceiveMemoryWarning - (void)refreshDuty { int duty; - duty=[brightnessSlider value]; + duty = [brightnessSlider value]; NSLog(@"Duty: %d",duty); [Konashi updateACDriveDuty:duty]; } -- (void)ready { - NSLog(@"Ready"); - [Konashi initACDrive:KONASHI_AC_MODE_PWM freq:KONASHI_AC_FREQ_50HZ]; -} - - (IBAction)find:(id)sender { [Konashi find]; } diff --git a/samples/ACDriveExtension/ACDriveExtension/en.lproj/MainStoryboard.storyboard b/samples/ACDriveExtension/ACDriveExtension/en.lproj/MainStoryboard.storyboard index a424166..c053442 100644 --- a/samples/ACDriveExtension/ACDriveExtension/en.lproj/MainStoryboard.storyboard +++ b/samples/ACDriveExtension/ACDriveExtension/en.lproj/MainStoryboard.storyboard @@ -1,45 +1,47 @@ - + - + + + + + + - + - + + + - - - - - - - - - + + + + + + + + + @@ -66,22 +68,9 @@ - - - - - - - - - - - - - - \ No newline at end of file + diff --git a/samples/ADCExtension/ADCExtension.xcodeproj/project.pbxproj b/samples/ADCExtension/ADCExtension.xcodeproj/project.pbxproj index e3b7485..91c424a 100644 --- a/samples/ADCExtension/ADCExtension.xcodeproj/project.pbxproj +++ b/samples/ADCExtension/ADCExtension.xcodeproj/project.pbxproj @@ -145,7 +145,7 @@ 32CAD1E5180421690082729D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0460; + LastUpgradeCheck = 0700; ORGANIZATIONNAME = "YUKAI Engineering"; }; buildConfigurationList = 32CAD1E8180421690082729D /* Build configuration list for PBXProject "ADCExtension" */; @@ -227,6 +227,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; @@ -275,11 +276,13 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "ADCExtension/ADCExtension-Prefix.pch"; INFOPLIST_FILE = "ADCExtension/ADCExtension-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 7.1; LIBRARY_SEARCH_PATHS = "$(inherited)"; OTHER_LDFLAGS = ( "-all_load", "-ObjC", ); + PRODUCT_BUNDLE_IDENTIFIER = "com.ux-xu.konashi.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; USER_HEADER_SEARCH_PATHS = "$(BUILT_PRODUCTS_DIR)/** $(PROJECT_DIR)/../../**"; WRAPPER_EXTENSION = app; @@ -292,11 +295,13 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "ADCExtension/ADCExtension-Prefix.pch"; INFOPLIST_FILE = "ADCExtension/ADCExtension-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 7.1; LIBRARY_SEARCH_PATHS = "$(inherited)"; OTHER_LDFLAGS = ( "-all_load", "-ObjC", ); + PRODUCT_BUNDLE_IDENTIFIER = "com.ux-xu.konashi.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; USER_HEADER_SEARCH_PATHS = "$(BUILT_PRODUCTS_DIR)/** $(PROJECT_DIR)/../../**"; WRAPPER_EXTENSION = app; diff --git a/samples/ADCExtension/ADCExtension/ADCExtension-Info.plist b/samples/ADCExtension/ADCExtension/ADCExtension-Info.plist index 8f474e1..8a34c1e 100644 --- a/samples/ADCExtension/ADCExtension/ADCExtension-Info.plist +++ b/samples/ADCExtension/ADCExtension/ADCExtension-Info.plist @@ -9,7 +9,7 @@ CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier - com.ux-xu.konashi.${PRODUCT_NAME:rfc1034identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/samples/ADCExtension/ADCExtension/ViewController.m b/samples/ADCExtension/ADCExtension/ViewController.m index 6fc66e3..1255549 100644 --- a/samples/ADCExtension/ADCExtension/ViewController.m +++ b/samples/ADCExtension/ADCExtension/ViewController.m @@ -21,11 +21,21 @@ - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. - [Konashi initialize]; - [Konashi addObserver:self selector:@selector(ready) name:KonashiEventReadyToUseNotification]; - [Konashi addObserver:self selector:@selector(completeI2cRead) name:KonashiEventI2CReadCompleteNotification]; + [[Konashi shared] setReadyHandler:^{ + NSLog(@"Ready"); + [Konashi initADC:KONASHI_ADC_ADDR_00]; + [Konashi selectPowerMode:KONASHI_ADC_REFON_ADCON]; + }]; + [[Konashi shared] setI2cReadCompleteHandler:^(NSData *data) { + uint8_t val[2]; + [Konashi i2cStopCondition]; + [Konashi i2cRead:2 data:val]; + int amp = val[0] * 256 + val[1]; + [adcValueLabel setText:[NSString stringWithFormat:@"%d",amp]]; + NSLog(@"ADC Value: %d\n",amp); + }]; - timer=[NSTimer scheduledTimerWithTimeInterval:0.9f target:self selector:@selector(readValue) userInfo:nil repeats:YES]; + timer = [NSTimer scheduledTimerWithTimeInterval:0.9f target:self selector:@selector(readValue) userInfo:nil repeats:YES]; [timer fire]; } @@ -35,21 +45,6 @@ - (void)didReceiveMemoryWarning // Dispose of any resources that can be recreated. } -- (void)ready{ - NSLog(@"Ready"); - [Konashi initADC:KONASHI_ADC_ADDR_00]; - [Konashi selectPowerMode:KONASHI_ADC_REFON_ADCON]; -} - -- (void)completeI2cRead{ - uint8_t val[2]; - [Konashi i2cStopCondition]; - [Konashi i2cRead:2 data:val]; - int amp=val[0]*256+val[1]; - [adcValueLabel setText:[NSString stringWithFormat:@"%d",amp]]; - NSLog(@"ADC Value: %d\n",amp); -} - - (void)readValue{ [Konashi readADCWithChannel:KONASHI_ADC_CH0]; } @@ -61,4 +56,5 @@ - (IBAction)find:(id)sender { - (IBAction)disconnect:(id)sender { [Konashi disconnect]; } + @end diff --git a/samples/ADCExtension/ADCExtension/en.lproj/MainStoryboard.storyboard b/samples/ADCExtension/ADCExtension/en.lproj/MainStoryboard.storyboard index b2d1795..6d918ed 100644 --- a/samples/ADCExtension/ADCExtension/en.lproj/MainStoryboard.storyboard +++ b/samples/ADCExtension/ADCExtension/en.lproj/MainStoryboard.storyboard @@ -1,49 +1,50 @@ - + - + + + + + + - + - - - - - - - - + + + + + + + + @@ -69,22 +70,9 @@ - - - - - - - - - - - - - - \ No newline at end of file + diff --git a/samples/AioSample/AioSample.xcodeproj/project.pbxproj b/samples/AioSample/AioSample.xcodeproj/project.pbxproj index a26d507..81d54f3 100644 --- a/samples/AioSample/AioSample.xcodeproj/project.pbxproj +++ b/samples/AioSample/AioSample.xcodeproj/project.pbxproj @@ -154,7 +154,7 @@ 085A3193168A806700A75E66 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0510; + LastUpgradeCheck = 0700; ORGANIZATIONNAME = "Yukai Engineering"; }; buildConfigurationList = 085A3196168A806700A75E66 /* Build configuration list for PBXProject "AioSample" */; @@ -236,6 +236,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; @@ -281,11 +282,13 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "AioSample/AioSample-Prefix.pch"; INFOPLIST_FILE = "AioSample/AioSample-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 7.1; LIBRARY_SEARCH_PATHS = "$(inherited)"; OTHER_LDFLAGS = ( "-all_load", "-ObjC", ); + PRODUCT_BUNDLE_IDENTIFIER = "com.ux-xu.konashi.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; USER_HEADER_SEARCH_PATHS = "$(BUILT_PRODUCTS_DIR)/** $(PROJECT_DIR)/../../**"; WRAPPER_EXTENSION = app; @@ -298,11 +301,13 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "AioSample/AioSample-Prefix.pch"; INFOPLIST_FILE = "AioSample/AioSample-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 7.1; LIBRARY_SEARCH_PATHS = "$(inherited)"; OTHER_LDFLAGS = ( "-all_load", "-ObjC", ); + PRODUCT_BUNDLE_IDENTIFIER = "com.ux-xu.konashi.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; USER_HEADER_SEARCH_PATHS = "$(BUILT_PRODUCTS_DIR)/** $(PROJECT_DIR)/../../**"; WRAPPER_EXTENSION = app; diff --git a/samples/AioSample/AioSample/AioSample-Info.plist b/samples/AioSample/AioSample/AioSample-Info.plist index fea8338..71d280d 100644 --- a/samples/AioSample/AioSample/AioSample-Info.plist +++ b/samples/AioSample/AioSample/AioSample-Info.plist @@ -22,7 +22,7 @@ CFBundleIdentifier - net.uxux.monaka.aio.${PRODUCT_NAME:rfc1034identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/samples/AioSample/AioSample/ViewController.m b/samples/AioSample/AioSample/ViewController.m index d2bcf6e..e97c607 100644 --- a/samples/AioSample/AioSample/ViewController.m +++ b/samples/AioSample/AioSample/ViewController.m @@ -19,20 +19,26 @@ - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. - - [Konashi initialize]; - - [Konashi addObserver:self selector:@selector(connected) name:KonashiEventConnectedNotification]; - [Konashi addObserver:self selector:@selector(ready) name:KonashiEventReadyToUseNotification]; - [Konashi addObserver:self selector:@selector(readAio) name:KonashiEventAnalogIODidUpdateNotification]; - [Konashi addObserver:self selector:@selector(readAio0) name:KonashiEventAnalogIO0DidUpdateNotification]; + + [[Konashi shared] setConnectedHandler:^{ + NSLog(@"CONNECTED"); + }]; + [[Konashi shared] setReadyHandler:^{ + NSLog(@"READY"); + + self.statusMessage.hidden = NO; + }]; + [[Konashi shared] setAnalogPinDidChangeValueHandler:^(KonashiAnalogIOPin pin, int value) { + NSLog(@"READ_AIO0: %d", [Konashi analogRead:KonashiAnalogIO0]); + self.adcValue.text = [NSString stringWithFormat:@"%.3f", (float)[Konashi analogRead:KonashiAnalogIO0]/1000]; + }]; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. - } +} - (IBAction)find:(id)sender { [Konashi find]; @@ -46,26 +52,4 @@ - (IBAction)requestReadAio0:(id)sender { [Konashi analogReadRequest:KonashiAnalogIO0]; } -- (void) connected -{ - NSLog(@"CONNECTED"); -} - -- (void) ready -{ - NSLog(@"READY"); - - self.statusMessage.hidden = FALSE; -} - -- (void) readAio -{ - NSLog(@"READ_AIO"); -} - -- (void) readAio0 -{ - NSLog(@"READ_AIO0: %d", [Konashi analogRead:KonashiAnalogIO0]); - self.adcValue.text = [NSString stringWithFormat:@"%.3f", (float)[Konashi analogRead:KonashiAnalogIO0]/1000];} - @end diff --git a/samples/AioSample/AioSample/en.lproj/MainStoryboard.storyboard b/samples/AioSample/AioSample/en.lproj/MainStoryboard.storyboard index 7f079e9..0fd3310 100644 --- a/samples/AioSample/AioSample/en.lproj/MainStoryboard.storyboard +++ b/samples/AioSample/AioSample/en.lproj/MainStoryboard.storyboard @@ -1,68 +1,66 @@ - + - + + + + + + - + - + - + - - + + - + @@ -105,24 +104,9 @@ - - - - - - - - - - - - - - - - \ No newline at end of file + diff --git a/samples/BlinkLed/GettingStarted.xcodeproj/project.pbxproj b/samples/BlinkLed/BlinkLed.xcodeproj/project.pbxproj similarity index 62% rename from samples/BlinkLed/GettingStarted.xcodeproj/project.pbxproj rename to samples/BlinkLed/BlinkLed.xcodeproj/project.pbxproj index 3e3c697..45e4f74 100644 --- a/samples/BlinkLed/GettingStarted.xcodeproj/project.pbxproj +++ b/samples/BlinkLed/BlinkLed.xcodeproj/project.pbxproj @@ -10,37 +10,31 @@ 08AE632616CE96040027B895 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 08AE632516CE96040027B895 /* UIKit.framework */; }; 08AE632816CE96040027B895 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 08AE632716CE96040027B895 /* Foundation.framework */; }; 08AE632A16CE96040027B895 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 08AE632916CE96040027B895 /* CoreGraphics.framework */; }; - 08AE633016CE96040027B895 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 08AE632E16CE96040027B895 /* InfoPlist.strings */; }; - 08AE633216CE96040027B895 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 08AE633116CE96040027B895 /* main.m */; }; - 08AE633616CE96040027B895 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 08AE633516CE96040027B895 /* AppDelegate.m */; }; - 08AE633816CE96040027B895 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 08AE633716CE96040027B895 /* Default.png */; }; - 08AE633A16CE96050027B895 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 08AE633916CE96050027B895 /* Default@2x.png */; }; - 08AE633C16CE96050027B895 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 08AE633B16CE96050027B895 /* Default-568h@2x.png */; }; - 08AE633F16CE96050027B895 /* MainStoryboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 08AE633D16CE96050027B895 /* MainStoryboard.storyboard */; }; - 08AE634216CE96050027B895 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 08AE634116CE96050027B895 /* ViewController.m */; }; 08AE634916CE96140027B895 /* CoreBluetooth.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 08AE634816CE96140027B895 /* CoreBluetooth.framework */; }; + E92D57BD1B63B3E400FE1BF8 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = E92D57B81B63B3E400FE1BF8 /* AppDelegate.m */; }; + E92D57BE1B63B3E400FE1BF8 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = E92D57BA1B63B3E400FE1BF8 /* main.m */; }; + E92D57BF1B63B3E400FE1BF8 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E92D57BC1B63B3E400FE1BF8 /* ViewController.m */; }; + E92D57C21B63B40000FE1BF8 /* BlinkLed-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = E92D57C11B63B40000FE1BF8 /* BlinkLed-Info.plist */; }; + E92D57C61B63B41600FE1BF8 /* MainStoryboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E92D57C41B63B41600FE1BF8 /* MainStoryboard.storyboard */; }; + E92D57CA1B63B46C00FE1BF8 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E92D57C91B63B46C00FE1BF8 /* Images.xcassets */; }; E98BA8181A10C4750075F9B9 /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E98BA8171A10C4740075F9B9 /* JavaScriptCore.framework */; }; E9E64FFA19C8F3E400AC0F17 /* libKonashi.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E9E64FF919C8F3E400AC0F17 /* libKonashi.a */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 08AE632216CE96040027B895 /* GettingStarted.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GettingStarted.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 08AE632216CE96040027B895 /* BlinkLed.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BlinkLed.app; sourceTree = BUILT_PRODUCTS_DIR; }; 08AE632516CE96040027B895 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 08AE632716CE96040027B895 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 08AE632916CE96040027B895 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; - 08AE632D16CE96040027B895 /* GettingStarted-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "GettingStarted-Info.plist"; sourceTree = ""; }; - 08AE632F16CE96040027B895 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; - 08AE633116CE96040027B895 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 08AE633316CE96040027B895 /* GettingStarted-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "GettingStarted-Prefix.pch"; sourceTree = ""; }; - 08AE633416CE96040027B895 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 08AE633516CE96040027B895 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 08AE633716CE96040027B895 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; - 08AE633916CE96050027B895 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = ""; }; - 08AE633B16CE96050027B895 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; - 08AE633E16CE96050027B895 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard.storyboard; sourceTree = ""; }; - 08AE634016CE96050027B895 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; - 08AE634116CE96050027B895 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 08AE634816CE96140027B895 /* CoreBluetooth.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreBluetooth.framework; path = System/Library/Frameworks/CoreBluetooth.framework; sourceTree = SDKROOT; }; + E92D57B71B63B3E400FE1BF8 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = BlinkLed/AppDelegate.h; sourceTree = ""; }; + E92D57B81B63B3E400FE1BF8 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = BlinkLed/AppDelegate.m; sourceTree = ""; }; + E92D57BA1B63B3E400FE1BF8 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = BlinkLed/main.m; sourceTree = ""; }; + E92D57BB1B63B3E400FE1BF8 /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ViewController.h; path = BlinkLed/ViewController.h; sourceTree = ""; }; + E92D57BC1B63B3E400FE1BF8 /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ViewController.m; path = BlinkLed/ViewController.m; sourceTree = ""; }; + E92D57C11B63B40000FE1BF8 /* BlinkLed-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "BlinkLed-Info.plist"; path = "BlinkLed/BlinkLed-Info.plist"; sourceTree = ""; }; + E92D57C51B63B41600FE1BF8 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = BlinkLed/en.lproj/MainStoryboard.storyboard; sourceTree = ""; }; + E92D57C91B63B46C00FE1BF8 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = BlinkLed/Images.xcassets; sourceTree = ""; }; E98BA8171A10C4740075F9B9 /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; E9E64FF919C8F3E400AC0F17 /* libKonashi.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libKonashi.a; path = "../../../../../../Library/Developer/Xcode/DerivedData/Konashi-dhofczlcrxxgidezchdszsmucwex/Build/Products/Debug-iphoneos/libKonashi.a"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -65,8 +59,7 @@ 08AE631916CE96040027B895 = { isa = PBXGroup; children = ( - 08AE634816CE96140027B895 /* CoreBluetooth.framework */, - 08AE632B16CE96040027B895 /* GettingStarted */, + E92D57C01B63B3ED00FE1BF8 /* BlinkLed */, 08AE632416CE96040027B895 /* Frameworks */, 08AE632316CE96040027B895 /* Products */, ); @@ -75,7 +68,7 @@ 08AE632316CE96040027B895 /* Products */ = { isa = PBXGroup; children = ( - 08AE632216CE96040027B895 /* GettingStarted.app */, + 08AE632216CE96040027B895 /* BlinkLed.app */, ); name = Products; sourceTree = ""; @@ -83,6 +76,7 @@ 08AE632416CE96040027B895 /* Frameworks */ = { isa = PBXGroup; children = ( + 08AE634816CE96140027B895 /* CoreBluetooth.framework */, E98BA8171A10C4740075F9B9 /* JavaScriptCore.framework */, E9E64FF919C8F3E400AC0F17 /* libKonashi.a */, 08AE632516CE96040027B895 /* UIKit.framework */, @@ -92,29 +86,25 @@ name = Frameworks; sourceTree = ""; }; - 08AE632B16CE96040027B895 /* GettingStarted */ = { + E92D57C01B63B3ED00FE1BF8 /* BlinkLed */ = { isa = PBXGroup; children = ( - 08AE633416CE96040027B895 /* AppDelegate.h */, - 08AE633516CE96040027B895 /* AppDelegate.m */, - 08AE633D16CE96050027B895 /* MainStoryboard.storyboard */, - 08AE634016CE96050027B895 /* ViewController.h */, - 08AE634116CE96050027B895 /* ViewController.m */, - 08AE632C16CE96040027B895 /* Supporting Files */, + E92D57C31B63B40500FE1BF8 /* Supporting Files */, + E92D57C41B63B41600FE1BF8 /* MainStoryboard.storyboard */, + E92D57B71B63B3E400FE1BF8 /* AppDelegate.h */, + E92D57B81B63B3E400FE1BF8 /* AppDelegate.m */, + E92D57BB1B63B3E400FE1BF8 /* ViewController.h */, + E92D57BC1B63B3E400FE1BF8 /* ViewController.m */, + E92D57C91B63B46C00FE1BF8 /* Images.xcassets */, ); - path = GettingStarted; + name = BlinkLed; sourceTree = ""; }; - 08AE632C16CE96040027B895 /* Supporting Files */ = { + E92D57C31B63B40500FE1BF8 /* Supporting Files */ = { isa = PBXGroup; children = ( - 08AE632D16CE96040027B895 /* GettingStarted-Info.plist */, - 08AE632E16CE96040027B895 /* InfoPlist.strings */, - 08AE633116CE96040027B895 /* main.m */, - 08AE633316CE96040027B895 /* GettingStarted-Prefix.pch */, - 08AE633716CE96040027B895 /* Default.png */, - 08AE633916CE96050027B895 /* Default@2x.png */, - 08AE633B16CE96050027B895 /* Default-568h@2x.png */, + E92D57C11B63B40000FE1BF8 /* BlinkLed-Info.plist */, + E92D57BA1B63B3E400FE1BF8 /* main.m */, ); name = "Supporting Files"; sourceTree = ""; @@ -122,9 +112,9 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - 08AE632116CE96040027B895 /* GettingStarted */ = { + 08AE632116CE96040027B895 /* BlinkLed */ = { isa = PBXNativeTarget; - buildConfigurationList = 08AE634516CE96050027B895 /* Build configuration list for PBXNativeTarget "GettingStarted" */; + buildConfigurationList = 08AE634516CE96050027B895 /* Build configuration list for PBXNativeTarget "BlinkLed" */; buildPhases = ( 08AE631E16CE96040027B895 /* Sources */, 08AE631F16CE96040027B895 /* Frameworks */, @@ -134,9 +124,9 @@ ); dependencies = ( ); - name = GettingStarted; + name = BlinkLed; productName = GettingStarted; - productReference = 08AE632216CE96040027B895 /* GettingStarted.app */; + productReference = 08AE632216CE96040027B895 /* BlinkLed.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ @@ -145,10 +135,10 @@ 08AE631A16CE96040027B895 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0460; + LastUpgradeCheck = 0700; ORGANIZATIONNAME = "Yukai Engineering"; }; - buildConfigurationList = 08AE631D16CE96040027B895 /* Build configuration list for PBXProject "GettingStarted" */; + buildConfigurationList = 08AE631D16CE96040027B895 /* Build configuration list for PBXProject "BlinkLed" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; @@ -160,7 +150,7 @@ projectDirPath = ""; projectRoot = ""; targets = ( - 08AE632116CE96040027B895 /* GettingStarted */, + 08AE632116CE96040027B895 /* BlinkLed */, ); }; /* End PBXProject section */ @@ -170,11 +160,9 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 08AE633016CE96040027B895 /* InfoPlist.strings in Resources */, - 08AE633816CE96040027B895 /* Default.png in Resources */, - 08AE633A16CE96050027B895 /* Default@2x.png in Resources */, - 08AE633C16CE96050027B895 /* Default-568h@2x.png in Resources */, - 08AE633F16CE96050027B895 /* MainStoryboard.storyboard in Resources */, + E92D57C61B63B41600FE1BF8 /* MainStoryboard.storyboard in Resources */, + E92D57CA1B63B46C00FE1BF8 /* Images.xcassets in Resources */, + E92D57C21B63B40000FE1BF8 /* BlinkLed-Info.plist in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -185,27 +173,19 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 08AE633216CE96040027B895 /* main.m in Sources */, - 08AE633616CE96040027B895 /* AppDelegate.m in Sources */, - 08AE634216CE96050027B895 /* ViewController.m in Sources */, + E92D57BF1B63B3E400FE1BF8 /* ViewController.m in Sources */, + E92D57BE1B63B3E400FE1BF8 /* main.m in Sources */, + E92D57BD1B63B3E400FE1BF8 /* AppDelegate.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXVariantGroup section */ - 08AE632E16CE96040027B895 /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 08AE632F16CE96040027B895 /* en */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; - 08AE633D16CE96050027B895 /* MainStoryboard.storyboard */ = { + E92D57C41B63B41600FE1BF8 /* MainStoryboard.storyboard */ = { isa = PBXVariantGroup; children = ( - 08AE633E16CE96050027B895 /* en */, + E92D57C51B63B41600FE1BF8 /* en */, ); name = MainStoryboard.storyboard; sourceTree = ""; @@ -227,6 +207,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; @@ -272,15 +253,17 @@ 08AE634616CE96050027B895 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "GettingStarted/GettingStarted-Prefix.pch"; - INFOPLIST_FILE = "GettingStarted/GettingStarted-Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/BlinkLed/BlinkLed-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 7.1; LIBRARY_SEARCH_PATHS = "$(inherited)"; OTHER_LDFLAGS = ( "-all_load", "-ObjC", ); - PRODUCT_NAME = "$(TARGET_NAME)"; + PRODUCT_NAME = BlinkLed; USER_HEADER_SEARCH_PATHS = "$(BUILT_PRODUCTS_DIR)/** $(PROJECT_DIR)/../../**"; WRAPPER_EXTENSION = app; }; @@ -289,15 +272,17 @@ 08AE634716CE96050027B895 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "GettingStarted/GettingStarted-Prefix.pch"; - INFOPLIST_FILE = "GettingStarted/GettingStarted-Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/BlinkLed/BlinkLed-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 7.1; LIBRARY_SEARCH_PATHS = "$(inherited)"; OTHER_LDFLAGS = ( "-all_load", "-ObjC", ); - PRODUCT_NAME = "$(TARGET_NAME)"; + PRODUCT_NAME = BlinkLed; USER_HEADER_SEARCH_PATHS = "$(BUILT_PRODUCTS_DIR)/** $(PROJECT_DIR)/../../**"; WRAPPER_EXTENSION = app; }; @@ -306,7 +291,7 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 08AE631D16CE96040027B895 /* Build configuration list for PBXProject "GettingStarted" */ = { + 08AE631D16CE96040027B895 /* Build configuration list for PBXProject "BlinkLed" */ = { isa = XCConfigurationList; buildConfigurations = ( 08AE634316CE96050027B895 /* Debug */, @@ -315,7 +300,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 08AE634516CE96050027B895 /* Build configuration list for PBXNativeTarget "GettingStarted" */ = { + 08AE634516CE96050027B895 /* Build configuration list for PBXNativeTarget "BlinkLed" */ = { isa = XCConfigurationList; buildConfigurations = ( 08AE634616CE96050027B895 /* Debug */, diff --git a/samples/BlinkLed/GettingStarted/AppDelegate.h b/samples/BlinkLed/BlinkLed/AppDelegate.h similarity index 100% rename from samples/BlinkLed/GettingStarted/AppDelegate.h rename to samples/BlinkLed/BlinkLed/AppDelegate.h diff --git a/samples/BlinkLed/GettingStarted/AppDelegate.m b/samples/BlinkLed/BlinkLed/AppDelegate.m similarity index 100% rename from samples/BlinkLed/GettingStarted/AppDelegate.m rename to samples/BlinkLed/BlinkLed/AppDelegate.m diff --git a/samples/GettingStarted/GettingStarted/GettingStarted-Info.plist b/samples/BlinkLed/BlinkLed/BlinkLed-Info.plist similarity index 88% rename from samples/GettingStarted/GettingStarted/GettingStarted-Info.plist rename to samples/BlinkLed/BlinkLed/BlinkLed-Info.plist index 5e9662e..2f033b5 100644 --- a/samples/GettingStarted/GettingStarted/GettingStarted-Info.plist +++ b/samples/BlinkLed/BlinkLed/BlinkLed-Info.plist @@ -8,8 +8,12 @@ ${PRODUCT_NAME} CFBundleExecutable ${EXECUTABLE_NAME} + CFBundleIcons + + CFBundleIcons~ipad + CFBundleIdentifier - com.uxux.monaka.test.${PRODUCT_NAME:rfc1034identifier} + com.ux-xu.konashi.$(PRODUCT_NAME:rfc1034identifier) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/samples/BlinkLed/BlinkLed/Images.xcassets/AppIcon.appiconset/Contents.json b/samples/BlinkLed/BlinkLed/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..afff8c0 --- /dev/null +++ b/samples/BlinkLed/BlinkLed/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,43 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "57x57", + "scale" : "1x" + }, + { + "idiom" : "iphone", + "size" : "57x57", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/samples/BlinkLed/BlinkLed/Images.xcassets/LaunchImage.launchimage/Contents.json b/samples/BlinkLed/BlinkLed/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..f0fce54 --- /dev/null +++ b/samples/BlinkLed/BlinkLed/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,39 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "filename" : "Default-568h@2x.png", + "minimum-system-version" : "7.0", + "subtype" : "retina4", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "scale" : "1x", + "orientation" : "portrait" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "orientation" : "portrait" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "filename" : "Default-568h@2x.png", + "subtype" : "retina4", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/samples/BlinkLed/GettingStarted/Default-568h@2x.png b/samples/BlinkLed/BlinkLed/Images.xcassets/LaunchImage.launchimage/Default-568h@2x.png similarity index 100% rename from samples/BlinkLed/GettingStarted/Default-568h@2x.png rename to samples/BlinkLed/BlinkLed/Images.xcassets/LaunchImage.launchimage/Default-568h@2x.png diff --git a/samples/GettingStarted/GettingStarted/ViewController.h b/samples/BlinkLed/BlinkLed/ViewController.h similarity index 81% rename from samples/GettingStarted/GettingStarted/ViewController.h rename to samples/BlinkLed/BlinkLed/ViewController.h index 78caa59..399234c 100644 --- a/samples/GettingStarted/GettingStarted/ViewController.h +++ b/samples/BlinkLed/BlinkLed/ViewController.h @@ -10,5 +10,6 @@ @interface ViewController : UIViewController - (IBAction)find:(id)sender; +@property (nonatomic, strong) NSTimer* blinkTimer; @end diff --git a/samples/BlinkLed/BlinkLed/ViewController.m b/samples/BlinkLed/BlinkLed/ViewController.m new file mode 100644 index 0000000..4f80087 --- /dev/null +++ b/samples/BlinkLed/BlinkLed/ViewController.m @@ -0,0 +1,53 @@ +// +// ViewController.m +// GettingStarted +// +// Copyright (c) 2013 Yukai Engineering. All rights reserved. +// + +#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 shared] setReadyHandler:^{ + // Set pin mode to output + [Konashi pinMode:KonashiLED2 mode:KonashiPinModeOutput]; + + // blink timer + self.blinkTimer = [NSTimer scheduledTimerWithTimeInterval:0.5 target:self selector:@selector(blink) userInfo:nil repeats:YES]; + }]; + + [[Konashi shared] setDisconnectedHandler:^{ + // stop blinking + [self.blinkTimer invalidate]; + }]; +} + +- (void)blink +{ + static BOOL glow = NO; + glow = !glow; + [Konashi digitalWrite:KonashiLED2 value:(glow ? KonashiLevelHigh : KonashiLevelLow)]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (IBAction)find:(id)sender { + [Konashi find]; +} + +@end diff --git a/samples/BlinkLed/GettingStarted/en.lproj/InfoPlist.strings b/samples/BlinkLed/BlinkLed/en.lproj/InfoPlist.strings similarity index 100% rename from samples/BlinkLed/GettingStarted/en.lproj/InfoPlist.strings rename to samples/BlinkLed/BlinkLed/en.lproj/InfoPlist.strings diff --git a/samples/BlinkLed/GettingStarted/en.lproj/MainStoryboard.storyboard b/samples/BlinkLed/BlinkLed/en.lproj/MainStoryboard.storyboard similarity index 66% rename from samples/BlinkLed/GettingStarted/en.lproj/MainStoryboard.storyboard rename to samples/BlinkLed/BlinkLed/en.lproj/MainStoryboard.storyboard index 0deac89..50bbb3b 100644 --- a/samples/BlinkLed/GettingStarted/en.lproj/MainStoryboard.storyboard +++ b/samples/BlinkLed/BlinkLed/en.lproj/MainStoryboard.storyboard @@ -1,29 +1,31 @@ - + - + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/samples/GettingStarted/GettingStarted/main.m b/samples/GettingStarted/GettingStarted/main.m deleted file mode 100644 index 5fe17a2..0000000 --- a/samples/GettingStarted/GettingStarted/main.m +++ /dev/null @@ -1,17 +0,0 @@ -// -// main.m -// GettingStarted -// -// Copyright (c) 2013 Yukai Engineering. All rights reserved. -// - -#import - -#import "AppDelegate.h" - -int main(int argc, char *argv[]) -{ - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/samples/GroveExtension/GroveExtension.xcodeproj/project.pbxproj b/samples/GroveExtension/GroveExtension.xcodeproj/project.pbxproj index 4a4d106..1663f53 100644 --- a/samples/GroveExtension/GroveExtension.xcodeproj/project.pbxproj +++ b/samples/GroveExtension/GroveExtension.xcodeproj/project.pbxproj @@ -145,7 +145,7 @@ 32E2C4DE1802B2E100DF5810 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0460; + LastUpgradeCheck = 0700; ORGANIZATIONNAME = "YUKAI Engineering"; }; buildConfigurationList = 32E2C4E11802B2E100DF5810 /* Build configuration list for PBXProject "GroveExtension" */; @@ -227,6 +227,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; @@ -275,11 +276,13 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "GroveExtension/GroveExtension-Prefix.pch"; INFOPLIST_FILE = "GroveExtension/GroveExtension-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 7.1; LIBRARY_SEARCH_PATHS = "$(inherited)"; OTHER_LDFLAGS = ( "-all_load", "-ObjC", ); + PRODUCT_BUNDLE_IDENTIFIER = "com.ux-xu.konashi.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; USER_HEADER_SEARCH_PATHS = "$(BUILT_PRODUCTS_DIR)/** $(PROJECT_DIR)/../../**"; WRAPPER_EXTENSION = app; @@ -292,11 +295,13 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "GroveExtension/GroveExtension-Prefix.pch"; INFOPLIST_FILE = "GroveExtension/GroveExtension-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 7.1; LIBRARY_SEARCH_PATHS = "$(inherited)"; OTHER_LDFLAGS = ( "-all_load", "-ObjC", ); + PRODUCT_BUNDLE_IDENTIFIER = "com.ux-xu.konashi.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; USER_HEADER_SEARCH_PATHS = "$(BUILT_PRODUCTS_DIR)/** $(PROJECT_DIR)/../../**"; WRAPPER_EXTENSION = app; diff --git a/samples/GroveExtension/GroveExtension/GroveExtension-Info.plist b/samples/GroveExtension/GroveExtension/GroveExtension-Info.plist index 8f474e1..8a34c1e 100644 --- a/samples/GroveExtension/GroveExtension/GroveExtension-Info.plist +++ b/samples/GroveExtension/GroveExtension/GroveExtension-Info.plist @@ -9,7 +9,7 @@ CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier - com.ux-xu.konashi.${PRODUCT_NAME:rfc1034identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/samples/GroveExtension/GroveExtension/ViewController.m b/samples/GroveExtension/GroveExtension/ViewController.m index df9d5f0..c1379cb 100644 --- a/samples/GroveExtension/GroveExtension/ViewController.m +++ b/samples/GroveExtension/GroveExtension/ViewController.m @@ -19,11 +19,17 @@ - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. - [Konashi initialize]; - [Konashi addObserver:self selector:@selector(ready) name:KonashiEventReadyToUseNotification]; - [Konashi addObserver:self selector:@selector(completeAnalogRead) name:KonashiEventAnalogIO0DidUpdateNotification]; - - timer=[NSTimer scheduledTimerWithTimeInterval:0.15f target:self selector:@selector(readBrightness) userInfo:nil repeats:YES]; + [[Konashi shared] setReadyHandler:^{ + NSLog(@"Ready"); + [Konashi pwmMode:KonashiLED2 mode:KonashiPWMModeEnableLED]; + }]; + [[Konashi shared] setAnalogPinDidChangeValueHandler:^(KonashiAnalogIOPin pin, int value) { + int aioValue = [Konashi analogRead:KonashiAnalogIO0]; + [Konashi pwmLedDrive:KonashiLED2 dutyRatio:aioValue/13]; + NSLog(@"Brightness:%d",aioValue); + }]; + + timer = [NSTimer scheduledTimerWithTimeInterval:0.15f target:self selector:@selector(readBrightness) userInfo:nil repeats:YES]; [timer fire]; } @@ -33,19 +39,6 @@ - (void)didReceiveMemoryWarning // Dispose of any resources that can be recreated. } -- (void)ready -{ - NSLog(@"Ready"); - [Konashi pwmMode:KonashiLED2 mode:KonashiPWMModeEnableLED]; -} - -- (void)completeAnalogRead -{ - int aioValue=[Konashi analogRead:KonashiAnalogIO0]; - [Konashi pwmLedDrive:KonashiLED2 dutyRatio:aioValue/13]; - NSLog(@"Brightness:%d",aioValue); -} - - (void)readBrightness { [Konashi readGroveAnalogPort:KonashiAnalogIO0]; diff --git a/samples/GroveExtension/GroveExtension/en.lproj/MainStoryboard.storyboard b/samples/GroveExtension/GroveExtension/en.lproj/MainStoryboard.storyboard index 705d1ad..7d1c8df 100644 --- a/samples/GroveExtension/GroveExtension/en.lproj/MainStoryboard.storyboard +++ b/samples/GroveExtension/GroveExtension/en.lproj/MainStoryboard.storyboard @@ -1,39 +1,38 @@ - + - + + + + + + - + + - + + + + + + + + + + + - + - - + + + - + - - + + - - + + - + + - - - - + + + + + @@ -122,6 +139,7 @@ + @@ -129,26 +147,9 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file + diff --git a/samples/I2cSample/I2cSample.xcodeproj/project.pbxproj b/samples/I2cSample/I2cSample.xcodeproj/project.pbxproj index 7b44e8d..54a6abf 100644 --- a/samples/I2cSample/I2cSample.xcodeproj/project.pbxproj +++ b/samples/I2cSample/I2cSample.xcodeproj/project.pbxproj @@ -154,7 +154,7 @@ 08232586168AAAE200586AE2 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0510; + LastUpgradeCheck = 0700; ORGANIZATIONNAME = "Yukai Engineering"; }; buildConfigurationList = 08232589168AAAE200586AE2 /* Build configuration list for PBXProject "I2cSample" */; @@ -236,6 +236,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; @@ -281,11 +282,13 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "I2cSample/I2cSample-Prefix.pch"; INFOPLIST_FILE = "I2cSample/I2cSample-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 7.1; LIBRARY_SEARCH_PATHS = "$(inherited)"; OTHER_LDFLAGS = ( "-all_load", "-ObjC", ); + PRODUCT_BUNDLE_IDENTIFIER = "com.ux-xu.konashi.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; USER_HEADER_SEARCH_PATHS = "$(BUILT_PRODUCTS_DIR)/** $(PROJECT_DIR)/../../**"; WRAPPER_EXTENSION = app; @@ -298,11 +301,13 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "I2cSample/I2cSample-Prefix.pch"; INFOPLIST_FILE = "I2cSample/I2cSample-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 7.1; LIBRARY_SEARCH_PATHS = "$(inherited)"; OTHER_LDFLAGS = ( "-all_load", "-ObjC", ); + PRODUCT_BUNDLE_IDENTIFIER = "com.ux-xu.konashi.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; USER_HEADER_SEARCH_PATHS = "$(BUILT_PRODUCTS_DIR)/** $(PROJECT_DIR)/../../**"; WRAPPER_EXTENSION = app; diff --git a/samples/I2cSample/I2cSample/I2cSample-Info.plist b/samples/I2cSample/I2cSample/I2cSample-Info.plist index 1491c8a..71d280d 100644 --- a/samples/I2cSample/I2cSample/I2cSample-Info.plist +++ b/samples/I2cSample/I2cSample/I2cSample-Info.plist @@ -22,7 +22,7 @@ CFBundleIdentifier - net.uxux.monaka.i2c.${PRODUCT_NAME:rfc1034identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/samples/I2cSample/I2cSample/ViewController.m b/samples/I2cSample/I2cSample/ViewController.m index 23c8a31..c3a4f84 100644 --- a/samples/I2cSample/I2cSample/ViewController.m +++ b/samples/I2cSample/I2cSample/ViewController.m @@ -21,10 +21,16 @@ - (void)viewDidLoad [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. - [Konashi initialize]; - - [Konashi addObserver:self selector:@selector(connected) name:KonashiEventConnectedNotification]; - [Konashi addObserver:self selector:@selector(ready) name:KonashiEventReadyToUseNotification]; + [[Konashi shared] setConnectedHandler:^{ + NSLog(@"CONNECTED"); + }]; + [[Konashi shared] setReadyHandler:^{ + NSLog(@"READY"); + + self.statusMessage.hidden = NO; + + [Konashi i2cMode:KonashiI2CModeEnable100K]; + }]; } - (void)didReceiveMemoryWarning @@ -45,20 +51,6 @@ - (IBAction)clearLcd:(id)sender { [self writeCmd:0x31]; } -- (void) connected -{ - NSLog(@"CONNECTED"); -} - -- (void) ready -{ - NSLog(@"READY"); - - self.statusMessage.hidden = FALSE; - - [Konashi i2cMode:KonashiI2CModeEnable100K]; -} - - (void) writeCmd:(unsigned char)cmd { unsigned char t[2]; diff --git a/samples/I2cSample/I2cSample/en.lproj/MainStoryboard.storyboard b/samples/I2cSample/I2cSample/en.lproj/MainStoryboard.storyboard index 6d08b43..f49cd05 100644 --- a/samples/I2cSample/I2cSample/en.lproj/MainStoryboard.storyboard +++ b/samples/I2cSample/I2cSample/en.lproj/MainStoryboard.storyboard @@ -1,47 +1,48 @@ - + - + + + + + + + - + - \ No newline at end of file + diff --git a/samples/PwmDrive/PwmDrive.xcodeproj/project.pbxproj b/samples/PwmDrive/PwmDrive.xcodeproj/project.pbxproj index 3e8c437..c6556d3 100644 --- a/samples/PwmDrive/PwmDrive.xcodeproj/project.pbxproj +++ b/samples/PwmDrive/PwmDrive.xcodeproj/project.pbxproj @@ -154,7 +154,7 @@ 085A314C168A6B6D00A75E66 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0510; + LastUpgradeCheck = 0700; ORGANIZATIONNAME = "Yukai Engineering"; }; buildConfigurationList = 085A314F168A6B6D00A75E66 /* Build configuration list for PBXProject "PwmDrive" */; @@ -236,6 +236,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; @@ -286,6 +287,7 @@ "-all_load", "-ObjC", ); + PRODUCT_BUNDLE_IDENTIFIER = "com.ux-xu.konashi.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; USER_HEADER_SEARCH_PATHS = "$(BUILT_PRODUCTS_DIR)/** $(PROJECT_DIR)/../../**"; WRAPPER_EXTENSION = app; @@ -303,6 +305,7 @@ "-all_load", "-ObjC", ); + PRODUCT_BUNDLE_IDENTIFIER = "com.ux-xu.konashi.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; USER_HEADER_SEARCH_PATHS = "$(BUILT_PRODUCTS_DIR)/** $(PROJECT_DIR)/../../**"; WRAPPER_EXTENSION = app; diff --git a/samples/PwmDrive/PwmDrive/PwmDrive-Info.plist b/samples/PwmDrive/PwmDrive/PwmDrive-Info.plist index cf3f529..71d280d 100644 --- a/samples/PwmDrive/PwmDrive/PwmDrive-Info.plist +++ b/samples/PwmDrive/PwmDrive/PwmDrive-Info.plist @@ -22,7 +22,7 @@ CFBundleIdentifier - net.uxux.monaka.pwm.${PRODUCT_NAME:rfc1034identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/samples/PwmDrive/PwmDrive/ViewController.h b/samples/PwmDrive/PwmDrive/ViewController.h index 6684cf7..1c1844c 100644 --- a/samples/PwmDrive/PwmDrive/ViewController.h +++ b/samples/PwmDrive/PwmDrive/ViewController.h @@ -11,11 +11,11 @@ @interface ViewController : UIViewController @property (weak, nonatomic) IBOutlet UILabel *statusMessage; -@property (weak, nonatomic) IBOutlet UISlider *blightnessSlider; +@property (weak, nonatomic) IBOutlet UISlider *brightnessSlider; - (IBAction)find:(id)sender; -- (IBAction)changeLedBlightness20:(id)sender; -- (IBAction)changeLedBlightness50:(id)sender; -- (IBAction)changeLedBlightness80:(id)sender; -- (IBAction)changeLedBlightnessBar:(id)sender; +- (IBAction)changeLedBrightness20:(id)sender; +- (IBAction)changeLedBrightness50:(id)sender; +- (IBAction)changeLedBrightness80:(id)sender; +- (IBAction)changeLedBrightnessBar:(id)sender; @end diff --git a/samples/PwmDrive/PwmDrive/ViewController.m b/samples/PwmDrive/PwmDrive/ViewController.m index 80688dc..bb49621 100644 --- a/samples/PwmDrive/PwmDrive/ViewController.m +++ b/samples/PwmDrive/PwmDrive/ViewController.m @@ -20,10 +20,16 @@ - (void)viewDidLoad [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. - [Konashi initialize]; - - [Konashi addObserver:self selector:@selector(connected) name:KonashiEventConnectedNotification]; - [Konashi addObserver:self selector:@selector(ready) name:KonashiEventReadyToUseNotification]; + [[Konashi shared] setConnectedHandler:^{ + NSLog(@"CONNECTED"); + }]; + [[Konashi shared] setReadyHandler:^{ + NSLog(@"READY"); + self.statusMessage.hidden = NO; + // Drive LED + [Konashi pwmMode:KonashiLED2 mode:KonashiPWMModeEnableLED]; + [Konashi pwmLedDrive:KonashiLED2 dutyRatio:50.0]; + }]; } - (void)didReceiveMemoryWarning @@ -36,46 +42,22 @@ - (IBAction)find:(id)sender { [Konashi find]; } -- (IBAction)changeLedBlightness20:(id)sender { +- (IBAction)changeLedBrightness20:(id)sender { [Konashi pwmLedDrive:KonashiLED2 dutyRatio:20.0]; } -- (IBAction)changeLedBlightness50:(id)sender { +- (IBAction)changeLedBrightness50:(id)sender { [Konashi pwmLedDrive:KonashiLED2 dutyRatio:50.0]; } -- (IBAction)changeLedBlightness80:(id)sender { +- (IBAction)changeLedBrightness80:(id)sender { [Konashi pwmLedDrive:KonashiLED2 dutyRatio:80.0]; } -- (IBAction)changeLedBlightnessBar:(id)sender { - NSLog(@"Blightness: %f", self.blightnessSlider.value); - - [Konashi pwmLedDrive:KonashiLED2 dutyRatio:self.blightnessSlider.value]; -} - -- (void) connected -{ - NSLog(@"CONNECTED"); -} - -- (void) ready -{ - NSLog(@"READY"); - - - self.statusMessage.hidden = FALSE; - - // Drive LED - [Konashi pwmMode:KonashiLED2 mode:KonashiPWMModeEnableLED]; - [Konashi pwmLedDrive:KonashiLED2 dutyRatio:50.0]; +- (IBAction)changeLedBrightnessBar:(id)sender { + NSLog(@"Brightness: %f", self.brightnessSlider.value); - /* - //Blink LED (interval: 0.5s) - [Konashi pwmPeriod:LED2 period:1000000]; // 1.0s - [Konashi pwmDuty:LED2 duty:500000]; // 0.5s - [Konashi pwmMode:LED2 mode:ENABLE]; - */ + [Konashi pwmLedDrive:KonashiLED2 dutyRatio:self.brightnessSlider.value]; } @end diff --git a/samples/PwmDrive/PwmDrive/en.lproj/MainStoryboard.storyboard b/samples/PwmDrive/PwmDrive/en.lproj/MainStoryboard.storyboard index acbb1c6..54d5e61 100644 --- a/samples/PwmDrive/PwmDrive/en.lproj/MainStoryboard.storyboard +++ b/samples/PwmDrive/PwmDrive/en.lproj/MainStoryboard.storyboard @@ -1,86 +1,82 @@ - + - + + + + + + - + + - + - - + - - - + + + - + - - + + - + @@ -113,27 +109,9 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file + diff --git a/samples/TestAllFunctions/TestAllFunctions.xcodeproj/project.pbxproj b/samples/TestAllFunctions/TestAllFunctions.xcodeproj/project.pbxproj deleted file mode 100644 index a0e665e..0000000 --- a/samples/TestAllFunctions/TestAllFunctions.xcodeproj/project.pbxproj +++ /dev/null @@ -1,417 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 084B92EA16C91EAC0089C59A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 084B92E916C91EAC0089C59A /* UIKit.framework */; }; - 084B92EC16C91EAC0089C59A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 084B92EB16C91EAC0089C59A /* Foundation.framework */; }; - 084B92EE16C91EAC0089C59A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 084B92ED16C91EAC0089C59A /* CoreGraphics.framework */; }; - 084B92F416C91EAC0089C59A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 084B92F216C91EAC0089C59A /* InfoPlist.strings */; }; - 084B92F616C91EAC0089C59A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 084B92F516C91EAC0089C59A /* main.m */; }; - 084B92FA16C91EAC0089C59A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 084B92F916C91EAC0089C59A /* AppDelegate.m */; }; - 084B92FC16C91EAC0089C59A /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 084B92FB16C91EAC0089C59A /* Default.png */; }; - 084B92FE16C91EAC0089C59A /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 084B92FD16C91EAC0089C59A /* Default@2x.png */; }; - 084B930016C91EAC0089C59A /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 084B92FF16C91EAC0089C59A /* Default-568h@2x.png */; }; - 084B930316C91EAC0089C59A /* MainStoryboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 084B930116C91EAC0089C59A /* MainStoryboard.storyboard */; }; - 084B930616C91EAC0089C59A /* HomeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 084B930516C91EAC0089C59A /* HomeViewController.m */; }; - 084B930816C91EAC0089C59A /* first.png in Resources */ = {isa = PBXBuildFile; fileRef = 084B930716C91EAC0089C59A /* first.png */; }; - 084B930A16C91EAC0089C59A /* first@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 084B930916C91EAC0089C59A /* first@2x.png */; }; - 084B930D16C91EAC0089C59A /* PioViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 084B930C16C91EAC0089C59A /* PioViewController.m */; }; - 084B931A16C91F110089C59A /* icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = 084B931716C91F110089C59A /* icon-72.png */; }; - 084B931B16C91F110089C59A /* icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 084B931816C91F110089C59A /* icon.png */; }; - 084B931C16C91F110089C59A /* icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 084B931916C91F110089C59A /* icon@2x.png */; }; - 084B932716C91FCB0089C59A /* CoreBluetooth.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 084B932616C91FCB0089C59A /* CoreBluetooth.framework */; }; - 084B932A16C93CF20089C59A /* PwnViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 084B932916C93CF20089C59A /* PwnViewController.m */; }; - 084B932D16C93FE40089C59A /* AnalogViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 084B932C16C93FE40089C59A /* AnalogViewController.m */; }; - 084B933616C945330089C59A /* CommViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 084B933516C945330089C59A /* CommViewController.m */; }; - 085A502016D311FF008E28A0 /* aio.png in Resources */ = {isa = PBXBuildFile; fileRef = 085A501616D311FF008E28A0 /* aio.png */; }; - 085A502116D311FF008E28A0 /* aio@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 085A501716D311FF008E28A0 /* aio@2x.png */; }; - 085A502216D311FF008E28A0 /* comm.png in Resources */ = {isa = PBXBuildFile; fileRef = 085A501816D311FF008E28A0 /* comm.png */; }; - 085A502316D311FF008E28A0 /* comm@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 085A501916D311FF008E28A0 /* comm@2x.png */; }; - 085A502416D311FF008E28A0 /* pio.png in Resources */ = {isa = PBXBuildFile; fileRef = 085A501A16D311FF008E28A0 /* pio.png */; }; - 085A502516D311FF008E28A0 /* pio@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 085A501B16D311FF008E28A0 /* pio@2x.png */; }; - 085A502616D311FF008E28A0 /* pwm.png in Resources */ = {isa = PBXBuildFile; fileRef = 085A501C16D311FF008E28A0 /* pwm.png */; }; - 085A502716D311FF008E28A0 /* pwm@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 085A501D16D311FF008E28A0 /* pwm@2x.png */; }; - 085A502C16D3125F008E28A0 /* control.png in Resources */ = {isa = PBXBuildFile; fileRef = 085A502A16D3125F008E28A0 /* control.png */; }; - 085A502D16D3125F008E28A0 /* control@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 085A502B16D3125F008E28A0 /* control@2x.png */; }; - E98BA80D1A10C2F30075F9B9 /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E98BA80C1A10C2F30075F9B9 /* JavaScriptCore.framework */; }; - E9E6500819C8F4D300AC0F17 /* libKonashi.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E9E6500719C8F4D300AC0F17 /* libKonashi.a */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 084B92E616C91EAC0089C59A /* TestAllFunctions.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TestAllFunctions.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 084B92E916C91EAC0089C59A /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; - 084B92EB16C91EAC0089C59A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - 084B92ED16C91EAC0089C59A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; - 084B92F116C91EAC0089C59A /* TestAllFunctions-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "TestAllFunctions-Info.plist"; sourceTree = ""; }; - 084B92F316C91EAC0089C59A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; - 084B92F516C91EAC0089C59A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 084B92F716C91EAC0089C59A /* TestAllFunctions-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "TestAllFunctions-Prefix.pch"; sourceTree = ""; }; - 084B92F816C91EAC0089C59A /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 084B92F916C91EAC0089C59A /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 084B92FB16C91EAC0089C59A /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; - 084B92FD16C91EAC0089C59A /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = ""; }; - 084B92FF16C91EAC0089C59A /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; - 084B930216C91EAC0089C59A /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard.storyboard; sourceTree = ""; }; - 084B930416C91EAC0089C59A /* HomeViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HomeViewController.h; sourceTree = ""; }; - 084B930516C91EAC0089C59A /* HomeViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HomeViewController.m; sourceTree = ""; }; - 084B930716C91EAC0089C59A /* first.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = first.png; sourceTree = ""; }; - 084B930916C91EAC0089C59A /* first@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "first@2x.png"; sourceTree = ""; }; - 084B930B16C91EAC0089C59A /* PioViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PioViewController.h; sourceTree = ""; }; - 084B930C16C91EAC0089C59A /* PioViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PioViewController.m; sourceTree = ""; }; - 084B931716C91F110089C59A /* icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon-72.png"; sourceTree = ""; }; - 084B931816C91F110089C59A /* icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon.png; sourceTree = ""; }; - 084B931916C91F110089C59A /* icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon@2x.png"; sourceTree = ""; }; - 084B932616C91FCB0089C59A /* CoreBluetooth.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreBluetooth.framework; path = System/Library/Frameworks/CoreBluetooth.framework; sourceTree = SDKROOT; }; - 084B932816C93CF20089C59A /* PwnViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PwnViewController.h; sourceTree = ""; }; - 084B932916C93CF20089C59A /* PwnViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PwnViewController.m; sourceTree = ""; }; - 084B932B16C93FE40089C59A /* AnalogViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AnalogViewController.h; sourceTree = ""; }; - 084B932C16C93FE40089C59A /* AnalogViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AnalogViewController.m; sourceTree = ""; }; - 084B933416C945330089C59A /* CommViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommViewController.h; sourceTree = ""; }; - 084B933516C945330089C59A /* CommViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CommViewController.m; sourceTree = ""; }; - 085A501616D311FF008E28A0 /* aio.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = aio.png; sourceTree = ""; }; - 085A501716D311FF008E28A0 /* aio@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "aio@2x.png"; sourceTree = ""; }; - 085A501816D311FF008E28A0 /* comm.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = comm.png; sourceTree = ""; }; - 085A501916D311FF008E28A0 /* comm@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "comm@2x.png"; sourceTree = ""; }; - 085A501A16D311FF008E28A0 /* pio.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = pio.png; sourceTree = ""; }; - 085A501B16D311FF008E28A0 /* pio@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pio@2x.png"; sourceTree = ""; }; - 085A501C16D311FF008E28A0 /* pwm.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = pwm.png; sourceTree = ""; }; - 085A501D16D311FF008E28A0 /* pwm@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pwm@2x.png"; sourceTree = ""; }; - 085A502A16D3125F008E28A0 /* control.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = control.png; sourceTree = ""; }; - 085A502B16D3125F008E28A0 /* control@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "control@2x.png"; sourceTree = ""; }; - E98BA80C1A10C2F30075F9B9 /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; - E9E6500719C8F4D300AC0F17 /* libKonashi.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libKonashi.a; path = "../../../../../../Library/Developer/Xcode/DerivedData/Konashi-dhofczlcrxxgidezchdszsmucwex/Build/Products/Debug-iphoneos/libKonashi.a"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 084B92E316C91EAC0089C59A /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - E98BA80D1A10C2F30075F9B9 /* JavaScriptCore.framework in Frameworks */, - E9E6500819C8F4D300AC0F17 /* libKonashi.a in Frameworks */, - 084B932716C91FCB0089C59A /* CoreBluetooth.framework in Frameworks */, - 084B92EA16C91EAC0089C59A /* UIKit.framework in Frameworks */, - 084B92EC16C91EAC0089C59A /* Foundation.framework in Frameworks */, - 084B92EE16C91EAC0089C59A /* CoreGraphics.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 084B92DD16C91EAC0089C59A = { - isa = PBXGroup; - children = ( - 084B92EF16C91EAC0089C59A /* TestAllFunctions */, - 084B92E816C91EAC0089C59A /* Frameworks */, - 084B92E716C91EAC0089C59A /* Products */, - ); - sourceTree = ""; - }; - 084B92E716C91EAC0089C59A /* Products */ = { - isa = PBXGroup; - children = ( - 084B92E616C91EAC0089C59A /* TestAllFunctions.app */, - ); - name = Products; - sourceTree = ""; - }; - 084B92E816C91EAC0089C59A /* Frameworks */ = { - isa = PBXGroup; - children = ( - E98BA80C1A10C2F30075F9B9 /* JavaScriptCore.framework */, - E9E6500719C8F4D300AC0F17 /* libKonashi.a */, - 084B932616C91FCB0089C59A /* CoreBluetooth.framework */, - 084B92E916C91EAC0089C59A /* UIKit.framework */, - 084B92EB16C91EAC0089C59A /* Foundation.framework */, - 084B92ED16C91EAC0089C59A /* CoreGraphics.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - 084B92EF16C91EAC0089C59A /* TestAllFunctions */ = { - isa = PBXGroup; - children = ( - 085A502A16D3125F008E28A0 /* control.png */, - 085A502B16D3125F008E28A0 /* control@2x.png */, - 085A501616D311FF008E28A0 /* aio.png */, - 085A501716D311FF008E28A0 /* aio@2x.png */, - 085A501816D311FF008E28A0 /* comm.png */, - 085A501916D311FF008E28A0 /* comm@2x.png */, - 085A501A16D311FF008E28A0 /* pio.png */, - 085A501B16D311FF008E28A0 /* pio@2x.png */, - 085A501C16D311FF008E28A0 /* pwm.png */, - 085A501D16D311FF008E28A0 /* pwm@2x.png */, - 084B931816C91F110089C59A /* icon.png */, - 084B931916C91F110089C59A /* icon@2x.png */, - 084B931716C91F110089C59A /* icon-72.png */, - 084B92F816C91EAC0089C59A /* AppDelegate.h */, - 084B92F916C91EAC0089C59A /* AppDelegate.m */, - 084B930116C91EAC0089C59A /* MainStoryboard.storyboard */, - 084B930416C91EAC0089C59A /* HomeViewController.h */, - 084B930516C91EAC0089C59A /* HomeViewController.m */, - 084B930716C91EAC0089C59A /* first.png */, - 084B930916C91EAC0089C59A /* first@2x.png */, - 084B930B16C91EAC0089C59A /* PioViewController.h */, - 084B930C16C91EAC0089C59A /* PioViewController.m */, - 084B932816C93CF20089C59A /* PwnViewController.h */, - 084B932916C93CF20089C59A /* PwnViewController.m */, - 084B932B16C93FE40089C59A /* AnalogViewController.h */, - 084B932C16C93FE40089C59A /* AnalogViewController.m */, - 084B933416C945330089C59A /* CommViewController.h */, - 084B933516C945330089C59A /* CommViewController.m */, - 084B92F016C91EAC0089C59A /* Supporting Files */, - ); - path = TestAllFunctions; - sourceTree = ""; - }; - 084B92F016C91EAC0089C59A /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 084B92F116C91EAC0089C59A /* TestAllFunctions-Info.plist */, - 084B92F216C91EAC0089C59A /* InfoPlist.strings */, - 084B92F516C91EAC0089C59A /* main.m */, - 084B92F716C91EAC0089C59A /* TestAllFunctions-Prefix.pch */, - 084B92FB16C91EAC0089C59A /* Default.png */, - 084B92FD16C91EAC0089C59A /* Default@2x.png */, - 084B92FF16C91EAC0089C59A /* Default-568h@2x.png */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 084B92E516C91EAC0089C59A /* TestAllFunctions */ = { - isa = PBXNativeTarget; - buildConfigurationList = 084B931416C91EAD0089C59A /* Build configuration list for PBXNativeTarget "TestAllFunctions" */; - buildPhases = ( - 084B92E216C91EAC0089C59A /* Sources */, - 084B92E316C91EAC0089C59A /* Frameworks */, - 084B92E416C91EAC0089C59A /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = TestAllFunctions; - productName = TestAllFunctions; - productReference = 084B92E616C91EAC0089C59A /* TestAllFunctions.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 084B92DE16C91EAC0089C59A /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0460; - ORGANIZATIONNAME = "Yukai Engineering"; - }; - buildConfigurationList = 084B92E116C91EAC0089C59A /* Build configuration list for PBXProject "TestAllFunctions" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = 084B92DD16C91EAC0089C59A; - productRefGroup = 084B92E716C91EAC0089C59A /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 084B92E516C91EAC0089C59A /* TestAllFunctions */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 084B92E416C91EAC0089C59A /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 084B92F416C91EAC0089C59A /* InfoPlist.strings in Resources */, - 084B92FC16C91EAC0089C59A /* Default.png in Resources */, - 084B92FE16C91EAC0089C59A /* Default@2x.png in Resources */, - 084B930016C91EAC0089C59A /* Default-568h@2x.png in Resources */, - 084B930316C91EAC0089C59A /* MainStoryboard.storyboard in Resources */, - 084B930816C91EAC0089C59A /* first.png in Resources */, - 084B930A16C91EAC0089C59A /* first@2x.png in Resources */, - 084B931A16C91F110089C59A /* icon-72.png in Resources */, - 084B931B16C91F110089C59A /* icon.png in Resources */, - 084B931C16C91F110089C59A /* icon@2x.png in Resources */, - 085A502016D311FF008E28A0 /* aio.png in Resources */, - 085A502116D311FF008E28A0 /* aio@2x.png in Resources */, - 085A502216D311FF008E28A0 /* comm.png in Resources */, - 085A502316D311FF008E28A0 /* comm@2x.png in Resources */, - 085A502416D311FF008E28A0 /* pio.png in Resources */, - 085A502516D311FF008E28A0 /* pio@2x.png in Resources */, - 085A502616D311FF008E28A0 /* pwm.png in Resources */, - 085A502716D311FF008E28A0 /* pwm@2x.png in Resources */, - 085A502C16D3125F008E28A0 /* control.png in Resources */, - 085A502D16D3125F008E28A0 /* control@2x.png in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 084B92E216C91EAC0089C59A /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 084B92F616C91EAC0089C59A /* main.m in Sources */, - 084B92FA16C91EAC0089C59A /* AppDelegate.m in Sources */, - 084B930616C91EAC0089C59A /* HomeViewController.m in Sources */, - 084B930D16C91EAC0089C59A /* PioViewController.m in Sources */, - 084B932A16C93CF20089C59A /* PwnViewController.m in Sources */, - 084B932D16C93FE40089C59A /* AnalogViewController.m in Sources */, - 084B933616C945330089C59A /* CommViewController.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 084B92F216C91EAC0089C59A /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 084B92F316C91EAC0089C59A /* en */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; - 084B930116C91EAC0089C59A /* MainStoryboard.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 084B930216C91EAC0089C59A /* en */, - ); - name = MainStoryboard.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 084B931216C91EAD0089C59A /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - "KONASHI_DEBUG=1", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 6.0; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - }; - name = Debug; - }; - 084B931316C91EAD0089C59A /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 6.0; - OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; - SDKROOT = iphoneos; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 084B931516C91EAD0089C59A /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "TestAllFunctions/TestAllFunctions-Prefix.pch"; - INFOPLIST_FILE = "TestAllFunctions/TestAllFunctions-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 6.0; - LIBRARY_SEARCH_PATHS = "$(inherited)"; - OTHER_LDFLAGS = ( - "-all_load", - "-ObjC", - ); - PRODUCT_NAME = "$(TARGET_NAME)"; - USER_HEADER_SEARCH_PATHS = "$(BUILT_PRODUCTS_DIR)/** $(PROJECT_DIR)/../../**"; - WRAPPER_EXTENSION = app; - }; - name = Debug; - }; - 084B931616C91EAD0089C59A /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "TestAllFunctions/TestAllFunctions-Prefix.pch"; - INFOPLIST_FILE = "TestAllFunctions/TestAllFunctions-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 6.0; - LIBRARY_SEARCH_PATHS = "$(inherited)"; - OTHER_LDFLAGS = ( - "-all_load", - "-ObjC", - ); - PRODUCT_NAME = "$(TARGET_NAME)"; - USER_HEADER_SEARCH_PATHS = "$(BUILT_PRODUCTS_DIR)/** $(PROJECT_DIR)/../../**"; - WRAPPER_EXTENSION = app; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 084B92E116C91EAC0089C59A /* Build configuration list for PBXProject "TestAllFunctions" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 084B931216C91EAD0089C59A /* Debug */, - 084B931316C91EAD0089C59A /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 084B931416C91EAD0089C59A /* Build configuration list for PBXNativeTarget "TestAllFunctions" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 084B931516C91EAD0089C59A /* Debug */, - 084B931616C91EAD0089C59A /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 084B92DE16C91EAC0089C59A /* Project object */; -} diff --git a/samples/TestAllFunctions/TestAllFunctions/AnalogViewController.h b/samples/TestAllFunctions/TestAllFunctions/AnalogViewController.h deleted file mode 100644 index b6c7737..0000000 --- a/samples/TestAllFunctions/TestAllFunctions/AnalogViewController.h +++ /dev/null @@ -1,30 +0,0 @@ -// -// AnalogViewController.h -// TestAllFunctions -// -// Copyright (c) 2013 Yukai Engineering. All rights reserved. -// - -#import - -@interface AnalogViewController : UIViewController - - -@property (weak, nonatomic) IBOutlet UISlider *dacBar0; -@property (weak, nonatomic) IBOutlet UISlider *dacBar1; -@property (weak, nonatomic) IBOutlet UISlider *dacBar2; -@property (weak, nonatomic) IBOutlet UILabel *dac0; -@property (weak, nonatomic) IBOutlet UILabel *dac1; -@property (weak, nonatomic) IBOutlet UILabel *dac2; -- (IBAction)setAio0:(id)sender; -- (IBAction)setAio1:(id)sender; -- (IBAction)setAio2:(id)sender; - -@property (weak, nonatomic) IBOutlet UILabel *adc0; -@property (weak, nonatomic) IBOutlet UILabel *adc1; -@property (weak, nonatomic) IBOutlet UILabel *adc2; -- (IBAction)getAio0:(id)sender; -- (IBAction)getAio1:(id)sender; -- (IBAction)getAio2:(id)sender; - -@end diff --git a/samples/TestAllFunctions/TestAllFunctions/AnalogViewController.m b/samples/TestAllFunctions/TestAllFunctions/AnalogViewController.m deleted file mode 100644 index f0be842..0000000 --- a/samples/TestAllFunctions/TestAllFunctions/AnalogViewController.m +++ /dev/null @@ -1,102 +0,0 @@ -// -// AnalogViewController.m -// TestAllFunctions -// -// Copyright (c) 2013 Yukai Engineering. All rights reserved. -// - -#import "AnalogViewController.h" -#import "Konashi.h" - -@interface AnalogViewController () - -@end - -@implementation AnalogViewController - -- (void)viewDidLoad -{ - [super viewDidLoad]; - // Do any additional setup after loading the view. - - [self.dacBar0 addTarget:self action:@selector(onChangeDacBar:) forControlEvents:UIControlEventValueChanged]; - [self.dacBar1 addTarget:self action:@selector(onChangeDacBar:) forControlEvents:UIControlEventValueChanged]; - [self.dacBar2 addTarget:self action:@selector(onChangeDacBar:) forControlEvents:UIControlEventValueChanged]; - - // ADC - [Konashi addObserver:self selector:@selector(onGetAio0) name:KonashiEventAnalogIO0DidUpdateNotification]; - [Konashi addObserver:self selector:@selector(onGetAio1) name:KonashiEventAnalogIO1DidUpdateNotification]; - [Konashi addObserver:self selector:@selector(onGetAio2) name:KonashiEventAnalogIO2DidUpdateNotification]; - - [Konashi shared].analogPinDidChangeValueHandler = ^(KonashiAnalogIOPin pin, int value) { - NSLog(@"aio changed:%d(pin:%d)", value, pin); - }; -} - -- (void)didReceiveMemoryWarning -{ - [super didReceiveMemoryWarning]; - // Dispose of any resources that can be recreated. -} - -///////////////////////////////////// -// DAC - -- (void)onChangeDacBar:(id)sender -{ - if(sender == self.dacBar0){ - self.dac0.text = [NSString stringWithFormat:@"%.3f", self.dacBar0.value * 1.3]; - } - else if(sender == self.dacBar1){ - self.dac1.text = [NSString stringWithFormat:@"%.3f", self.dacBar1.value * 1.3]; - } - else if(sender == self.dacBar2){ - self.dac2.text = [NSString stringWithFormat:@"%.3f", self.dacBar2.value * 1.3]; - } -} - -- (IBAction)setAio0:(id)sender { - int volt = (int)(self.dacBar0.value * 1300); - [Konashi analogWrite:KonashiAnalogIO0 milliVolt:volt]; -} - -- (IBAction)setAio1:(id)sender { - int volt = (int)(self.dacBar1.value * 1300); - [Konashi analogWrite:KonashiAnalogIO1 milliVolt:volt]; -} - -- (IBAction)setAio2:(id)sender { - int volt = (int)(self.dacBar2.value * 1300); - [Konashi analogWrite:KonashiAnalogIO2 milliVolt:volt]; -} - - -///////////////////////////////////// -// ADC - -- (IBAction)getAio0:(id)sender { - [Konashi analogReadRequest:KonashiAnalogIO0]; -} - -- (IBAction)getAio1:(id)sender { - [Konashi analogReadRequest:KonashiAnalogIO1]; -} - -- (IBAction)getAio2:(id)sender { - [Konashi analogReadRequest:KonashiAnalogIO2]; -} - -- (void)onGetAio0 -{ - self.adc0.text = [NSString stringWithFormat:@"%.3f", (double)[Konashi analogRead:KonashiAnalogIO0] / 1000]; -} -- (void)onGetAio1 -{ - self.adc1.text = [NSString stringWithFormat:@"%.3f", (double)[Konashi analogRead:KonashiAnalogIO1] / 1000]; -} -- (void)onGetAio2 -{ - self.adc2.text = [NSString stringWithFormat:@"%.3f", (double)[Konashi analogRead:KonashiAnalogIO2] / 1000]; -} - -@end diff --git a/samples/TestAllFunctions/TestAllFunctions/AppDelegate.h b/samples/TestAllFunctions/TestAllFunctions/AppDelegate.h deleted file mode 100644 index 03c8169..0000000 --- a/samples/TestAllFunctions/TestAllFunctions/AppDelegate.h +++ /dev/null @@ -1,14 +0,0 @@ -// -// AppDelegate.h -// TestAllFunctions -// -// Copyright (c) 2013 Yukai Engineering. All rights reserved. -// - -#import - -@interface AppDelegate : UIResponder - -@property (strong, nonatomic) UIWindow *window; - -@end diff --git a/samples/TestAllFunctions/TestAllFunctions/AppDelegate.m b/samples/TestAllFunctions/TestAllFunctions/AppDelegate.m deleted file mode 100644 index 26450a5..0000000 --- a/samples/TestAllFunctions/TestAllFunctions/AppDelegate.m +++ /dev/null @@ -1,49 +0,0 @@ -// -// AppDelegate.m -// TestAllFunctions -// -// Copyright (c) 2013 Yukai Engineering. All rights reserved. -// - -#import "AppDelegate.h" -#import "Konashi.h" - -@implementation AppDelegate - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions -{ - // 初期化 - [Konashi initialize]; - - // Override point for customization after application launch. - return YES; -} - -- (void)applicationWillResignActive:(UIApplication *)application -{ - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. -} - -- (void)applicationDidEnterBackground:(UIApplication *)application -{ - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. -} - -- (void)applicationWillEnterForeground:(UIApplication *)application -{ - // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. -} - -- (void)applicationDidBecomeActive:(UIApplication *)application -{ - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. -} - -- (void)applicationWillTerminate:(UIApplication *)application -{ - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. -} - -@end diff --git a/samples/TestAllFunctions/TestAllFunctions/CommViewController.h b/samples/TestAllFunctions/TestAllFunctions/CommViewController.h deleted file mode 100644 index 6315001..0000000 --- a/samples/TestAllFunctions/TestAllFunctions/CommViewController.h +++ /dev/null @@ -1,25 +0,0 @@ -// -// CommViewController.h -// TestAllFunctions -// -// Copyright (c) 2013 Yukai Engineering. All rights reserved. -// - -#import - -@interface CommViewController : UIViewController - -@property (weak, nonatomic) IBOutlet UISwitch *uartSetting; -@property (weak, nonatomic) IBOutlet UILabel *uartBaudrateLabel; -@property (weak, nonatomic) IBOutlet UITextField *uartSendText; -@property (weak, nonatomic) IBOutlet UITextView *uartRecvText; -- (IBAction)uartSend:(id)sender; -- (IBAction)changeBaudrate:(id)sender; - -@property (weak, nonatomic) IBOutlet UISwitch *i2cSetting; -@property (weak, nonatomic) IBOutlet UISegmentedControl *i2cSpeed; -@property (weak, nonatomic) IBOutlet UITextView *i2cRecvText; -- (IBAction)i2cSend:(id)sender; -- (IBAction)i2cRecv:(id)sender; - -@end diff --git a/samples/TestAllFunctions/TestAllFunctions/CommViewController.m b/samples/TestAllFunctions/TestAllFunctions/CommViewController.m deleted file mode 100644 index 84562ef..0000000 --- a/samples/TestAllFunctions/TestAllFunctions/CommViewController.m +++ /dev/null @@ -1,158 +0,0 @@ -// -// CommViewController.m -// TestAllFunctions -// -// Copyright (c) 2013 Yukai Engineering. All rights reserved. -// - -#import "CommViewController.h" -#import "Konashi.h" - -@interface CommViewController () -{ - KonashiUartBaudrate baudrate; - NSArray *baudrateList; -} - -@end - -@implementation CommViewController - -- (void)viewDidLoad -{ - [super viewDidLoad]; - // Do any additional setup after loading the view. - - // UART系のイベントハンドラ - [Konashi shared].uartRxCompleteHandler = ^(NSData *data) { - NSLog(@"uart RX complete:%@", [data description]); - NSString *string = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding]; - self.uartRecvText.text = [self.uartRecvText.text stringByAppendingString:string]; - }; - - // I2C系のイベントハンドラ - [Konashi addObserver:self selector:@selector(onI2cRecv) name:KonashiEventI2CReadCompleteNotification]; - [Konashi shared].i2cReadCompleteHandler = ^(NSData *data) { - NSLog(@"i2c read complete:%@(%ld)", [data description], data.length); - }; - - baudrate = KonashiUartBaudrateRate2K4; - baudrateList = @[@"2400", @"9600", @"19200", @"38400", @"57600", @"76800", @"115200"]; - self.uartBaudrateLabel.text = @"2400"; - - [self.uartSetting addTarget:self action:@selector(onChageUartSetting:) forControlEvents:UIControlEventValueChanged]; - [self.i2cSetting addTarget:self action:@selector(onChageI2cSetting:) forControlEvents:UIControlEventValueChanged]; -} - -- (void)didReceiveMemoryWarning -{ - [super didReceiveMemoryWarning]; - // Dispose of any resources that can be recreated. -} - - -///////////////////////////////////// -// UART - -- (void)onChageUartSetting:(id)sender -{ - if(self.uartSetting.on){ - [Konashi uartBaudrate:baudrate]; - [Konashi uartMode:KonashiUartModeEnable]; - } - else { - [Konashi uartMode:KonashiUartModeDisable]; - } -} - -- (IBAction)uartSend:(id)sender -{ - [Konashi uartWriteData:[self.uartSendText.text dataUsingEncoding:NSASCIIStringEncoding]]; -} - -- (IBAction)changeBaudrate:(id)sender -{ - UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Select baudrate" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:nil]; - for (NSString *title in baudrateList) { - [actionSheet addButtonWithTitle:title]; - } - [actionSheet setCancelButtonIndex:0]; - [actionSheet showInView:self.view]; -} - -- (IBAction)clearUartTextView:(id)sender -{ - self.uartRecvText.text = @""; -} - -///////////////////////////////////// -// I2C - -- (void)onChageI2cSetting:(id)sender -{ - if(self.i2cSetting.on){ - if(self.i2cSpeed.selectedSegmentIndex == 0) { - [Konashi i2cMode:KonashiI2CModeEnable100K]; - } else { - [Konashi i2cMode:KonashiI2CModeEnable400K]; - } - } - else { - [Konashi i2cMode:KonashiI2CModeDisable]; - } -} - -- (IBAction)i2cSend:(id)sender { - unsigned char t[[[[Konashi shared].activePeripheral.impl class] i2cDataMaxLength]]; - int i; - - for(i=0; i<(int)[[[Konashi shared].activePeripheral.impl class] i2cDataMaxLength]; i++){ - t[i] = 'A' + i; - } - - [Konashi i2cStartCondition]; - [NSThread sleepForTimeInterval:0.01]; - [Konashi i2cWriteData:[NSData dataWithBytes:t length:(int)[[[Konashi shared].activePeripheral.impl class] i2cDataMaxLength]] address:0x1F]; - [NSThread sleepForTimeInterval:0.01]; - [Konashi i2cStopCondition]; - [NSThread sleepForTimeInterval:0.01]; -} - -- (IBAction)i2cRecv:(id)sender { - [Konashi i2cStartCondition]; - [NSThread sleepForTimeInterval:0.01]; - [Konashi i2cReadRequest:(int)[[[Konashi shared].activePeripheral.impl class] i2cDataMaxLength] address:0x1F]; -} - -- (void)onI2cRecv -{ - unsigned char data[[[[Konashi shared].activePeripheral.impl class] i2cDataMaxLength]]; - - [Konashi i2cRead:(int)[[[Konashi shared].activePeripheral.impl class] i2cDataMaxLength] data:data]; - [NSThread sleepForTimeInterval:0.01]; - [Konashi i2cStopCondition]; - - int i; - for(i=0; i<(int)[[[Konashi shared].activePeripheral.impl class] i2cDataMaxLength]; i++){ - NSLog(@"I2C Recv data: %d", data[i]); - self.i2cRecvText.text = [self.i2cRecvText.text stringByAppendingString:[NSString stringWithFormat:@"%d ", data[i]]]; - } -} - -- (IBAction)clearI2CTextView:(id)sender -{ - self.i2cRecvText.text = @""; -} - -#pragma mark - UIActionSheetDelegate - -- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex -{ - if (buttonIndex > 0) { - baudrate = (KonashiUartBaudrate)([baudrateList[buttonIndex - 1] integerValue] / 240); - self.uartBaudrateLabel.text = baudrateList[buttonIndex - 1]; - [Konashi uartBaudrate:baudrate]; - } -} - -@end diff --git a/samples/TestAllFunctions/TestAllFunctions/Default-568h@2x.png b/samples/TestAllFunctions/TestAllFunctions/Default-568h@2x.png deleted file mode 100644 index 97325a1..0000000 Binary files a/samples/TestAllFunctions/TestAllFunctions/Default-568h@2x.png and /dev/null differ diff --git a/samples/TestAllFunctions/TestAllFunctions/Default.png b/samples/TestAllFunctions/TestAllFunctions/Default.png deleted file mode 100644 index e587832..0000000 Binary files a/samples/TestAllFunctions/TestAllFunctions/Default.png and /dev/null differ diff --git a/samples/TestAllFunctions/TestAllFunctions/Default@2x.png b/samples/TestAllFunctions/TestAllFunctions/Default@2x.png deleted file mode 100644 index 5bddcca..0000000 Binary files a/samples/TestAllFunctions/TestAllFunctions/Default@2x.png and /dev/null differ diff --git a/samples/TestAllFunctions/TestAllFunctions/HomeViewController.h b/samples/TestAllFunctions/TestAllFunctions/HomeViewController.h deleted file mode 100644 index 5379a73..0000000 --- a/samples/TestAllFunctions/TestAllFunctions/HomeViewController.h +++ /dev/null @@ -1,26 +0,0 @@ -// -// HomeViewController.h -// TestAllFunctions -// -// Copyright (c) 2013 Yukai Engineering. All rights reserved. -// - -#import - -@interface HomeViewController : UIViewController - -- (IBAction)find:(id)sender; -- (IBAction)reset:(id)sender; -- (IBAction)howto:(id)sender; - -- (IBAction)getBattery:(id)sender; - -@property (weak, nonatomic) IBOutlet UIButton *connectButton; -@property (weak, nonatomic) IBOutlet UILabel *statusMessage; -@property (weak, nonatomic) IBOutlet UIProgressView *dbBar; -@property (weak, nonatomic) IBOutlet UIProgressView *batteryBar; -@property (weak, nonatomic) IBOutlet UILabel *softwareRevisionString; - - - -@end diff --git a/samples/TestAllFunctions/TestAllFunctions/HomeViewController.m b/samples/TestAllFunctions/TestAllFunctions/HomeViewController.m deleted file mode 100644 index 7761fb9..0000000 --- a/samples/TestAllFunctions/TestAllFunctions/HomeViewController.m +++ /dev/null @@ -1,147 +0,0 @@ -// -// HomeViewController.m -// TestAllFunctions -// -// Copyright (c) 2013 Yukai Engineering. All rights reserved. -// - -#import "HomeViewController.h" -#import "Konashi.h" - -@interface HomeViewController () - -@end - -@implementation HomeViewController - -- (void)viewDidLoad -{ - [super viewDidLoad]; - // Do any additional setup after loading the view, typically from a nib. - - // コネクション系 - [Konashi addObserver:self selector:@selector(connected) name:KonashiEventConnectedNotification]; - [Konashi shared].connectedHandler = ^() { - NSLog(@"connected"); - }; - [Konashi addObserver:self selector:@selector(ready) name:KonashiEventReadyToUseNotification]; - [Konashi shared].readyHandler = ^() { - NSLog(@"ready to use"); - }; - - [Konashi shared].disconnectedHandler = ^() { - NSLog(@"disconnected"); - }; - - // 電波強度 - [Konashi addObserver:self selector:@selector(updateRSSI) name:KonashiEventSignalStrengthDidUpdateNotification]; - [Konashi shared].signalStrengthDidUpdateHandler = ^(int value) { - NSLog(@"RSSI did update:%d", value); - }; - - // バッテリー - [Konashi addObserver:self selector:@selector(updateBatteryLevel) name:KonashiEventBatteryLevelDidUpdateNotification]; - [Konashi shared].batteryLevelDidUpdateHandler = ^(int value) { - NSLog(@"battery level did update:%d", value); - }; - - [[NSNotificationCenter defaultCenter] addObserverForName:KonashiEventDidFindSoftwareRevisionStringNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *note) { - self.softwareRevisionString.text = [NSString stringWithFormat:@"Software Revision:%@", [Konashi softwareRevisionString]]; - }]; -} - -- (void)didReceiveMemoryWarning -{ - [super didReceiveMemoryWarning]; - // Dispose of any resources that can be recreated. -} - -- (IBAction)find:(id)sender { - if ( [Konashi isConnected] ) { - [Konashi disconnect]; - [self.connectButton setTitle: @"konashi に接続する" forState:UIControlStateNormal]; - } else { - [Konashi find]; - } -} - -- (IBAction)disconnect:(id)sender { - [Konashi disconnect]; -} - -- (IBAction)reset:(id)sender { - [Konashi reset]; -} - -/////////////////////////////////////////////////// -// 使い方 -- (IBAction)howto:(id)sender { - [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://konashi.ux-xu.com/getting_started/#first_touch"]]; -} - -- (void)connected -{ - NSLog(@"CONNECTED"); -} - -- (void)ready -{ - NSLog(@"READY"); - - self.statusMessage.hidden = FALSE; - [self.connectButton setTitle: @"接続を切る" forState:UIControlStateNormal]; - - // 電波強度タイマー - NSTimer *tm = [NSTimer - scheduledTimerWithTimeInterval:01.0f - target:self - selector:@selector(onRSSITimer:) - userInfo:nil - repeats:YES - ]; - [tm fire]; -} - -/////////////////////////////////////////////////// -// 電波強度 - -- (void) onRSSITimer:(NSTimer*)timer -{ - [Konashi signalStrengthReadRequest]; -} - -- (void) updateRSSI -{ - float progress = -1.0 * [Konashi signalStrengthRead]; - - if(progress > 100.0){ - progress = 100.0; - } - - self.dbBar.progress = progress / 100; - - //NSLog(@"RSSI: %ddb", [Konashi signalStrengthRead]); -} - - -/////////////////////////////////////////////////// -// バッテリー - -- (IBAction)getBattery:(id)sender { - [Konashi batteryLevelReadRequest]; -} - -- (void) updateBatteryLevel -{ - float progress = [Konashi batteryLevelRead]; - - if(progress > 100.0){ - progress = 100.0; - } - - self.batteryBar.progress = progress / 100; - - NSLog(@"BATTERY LEVEL: %d%%", [Konashi batteryLevelRead]); -} - -@end diff --git a/samples/TestAllFunctions/TestAllFunctions/PioViewController.h b/samples/TestAllFunctions/TestAllFunctions/PioViewController.h deleted file mode 100644 index b485c67..0000000 --- a/samples/TestAllFunctions/TestAllFunctions/PioViewController.h +++ /dev/null @@ -1,49 +0,0 @@ -// -// PioViewController.h -// TestAllFunctions -// -// Copyright (c) 2013 Yukai Engineering. All rights reserved. -// - -#import - -@interface PioViewController : UIViewController - -@property (weak, nonatomic) IBOutlet UISwitch *pin0; -@property (weak, nonatomic) IBOutlet UISwitch *pin1; -@property (weak, nonatomic) IBOutlet UISwitch *pin2; -@property (weak, nonatomic) IBOutlet UISwitch *pin3; -@property (weak, nonatomic) IBOutlet UISwitch *pin4; -@property (weak, nonatomic) IBOutlet UISwitch *pin5; -@property (weak, nonatomic) IBOutlet UISwitch *pin6; -@property (weak, nonatomic) IBOutlet UISwitch *pin7; - -@property (weak, nonatomic) IBOutlet UISwitch *out0; -@property (weak, nonatomic) IBOutlet UISwitch *out1; -@property (weak, nonatomic) IBOutlet UISwitch *out2; -@property (weak, nonatomic) IBOutlet UISwitch *out3; -@property (weak, nonatomic) IBOutlet UISwitch *out4; -@property (weak, nonatomic) IBOutlet UISwitch *out5; -@property (weak, nonatomic) IBOutlet UISwitch *out6; -@property (weak, nonatomic) IBOutlet UISwitch *out7; - -@property (weak, nonatomic) IBOutlet UISwitch *in0; -@property (weak, nonatomic) IBOutlet UISwitch *in1; -@property (weak, nonatomic) IBOutlet UISwitch *in2; -@property (weak, nonatomic) IBOutlet UISwitch *in3; -@property (weak, nonatomic) IBOutlet UISwitch *in4; -@property (weak, nonatomic) IBOutlet UISwitch *in5; -@property (weak, nonatomic) IBOutlet UISwitch *in6; -@property (weak, nonatomic) IBOutlet UISwitch *in7; - -@property (weak, nonatomic) IBOutlet UISwitch *pullup0; -@property (weak, nonatomic) IBOutlet UISwitch *pullup1; -@property (weak, nonatomic) IBOutlet UISwitch *pullup2; -@property (weak, nonatomic) IBOutlet UISwitch *pullup3; -@property (weak, nonatomic) IBOutlet UISwitch *pullup4; -@property (weak, nonatomic) IBOutlet UISwitch *pullup5; -@property (weak, nonatomic) IBOutlet UISwitch *pullup6; -@property (weak, nonatomic) IBOutlet UISwitch *pullup7; - - -@end diff --git a/samples/TestAllFunctions/TestAllFunctions/PioViewController.m b/samples/TestAllFunctions/TestAllFunctions/PioViewController.m deleted file mode 100644 index 952b722..0000000 --- a/samples/TestAllFunctions/TestAllFunctions/PioViewController.m +++ /dev/null @@ -1,322 +0,0 @@ -// -// PioViewController.m -// TestAllFunctions -// -// Copyright (c) 2013 Yukai Engineering. All rights reserved. -// - -#import "PioViewController.h" -#import "Konashi.h" - -@interface PioViewController () - -@end - -@implementation PioViewController - -- (void)viewDidLoad -{ - [super viewDidLoad]; - // Do any additional setup after loading the view, typically from a nib. - - // I/O設定のスイッチのイベントハンドラ登録 - [self.pin0 addTarget:self action:@selector(onChangePin:) forControlEvents:UIControlEventValueChanged]; - [self.pin1 addTarget:self action:@selector(onChangePin:) forControlEvents:UIControlEventValueChanged]; - [self.pin2 addTarget:self action:@selector(onChangePin:) forControlEvents:UIControlEventValueChanged]; - [self.pin3 addTarget:self action:@selector(onChangePin:) forControlEvents:UIControlEventValueChanged]; - [self.pin4 addTarget:self action:@selector(onChangePin:) forControlEvents:UIControlEventValueChanged]; - [self.pin5 addTarget:self action:@selector(onChangePin:) forControlEvents:UIControlEventValueChanged]; - [self.pin6 addTarget:self action:@selector(onChangePin:) forControlEvents:UIControlEventValueChanged]; - [self.pin7 addTarget:self action:@selector(onChangePin:) forControlEvents:UIControlEventValueChanged]; - - // 出力のスイッチのイベントハンドラ登録 - [self.out0 addTarget:self action:@selector(onChangeOutput:) forControlEvents:UIControlEventValueChanged]; - [self.out1 addTarget:self action:@selector(onChangeOutput:) forControlEvents:UIControlEventValueChanged]; - [self.out2 addTarget:self action:@selector(onChangeOutput:) forControlEvents:UIControlEventValueChanged]; - [self.out3 addTarget:self action:@selector(onChangeOutput:) forControlEvents:UIControlEventValueChanged]; - [self.out4 addTarget:self action:@selector(onChangeOutput:) forControlEvents:UIControlEventValueChanged]; - [self.out5 addTarget:self action:@selector(onChangeOutput:) forControlEvents:UIControlEventValueChanged]; - [self.out6 addTarget:self action:@selector(onChangeOutput:) forControlEvents:UIControlEventValueChanged]; - [self.out7 addTarget:self action:@selector(onChangeOutput:) forControlEvents:UIControlEventValueChanged]; - - // プルアップのイベントハンドラ登録 - [self.pullup0 addTarget:self action:@selector(onChangePullup:) forControlEvents:UIControlEventValueChanged]; - [self.pullup1 addTarget:self action:@selector(onChangePullup:) forControlEvents:UIControlEventValueChanged]; - [self.pullup2 addTarget:self action:@selector(onChangePullup:) forControlEvents:UIControlEventValueChanged]; - [self.pullup3 addTarget:self action:@selector(onChangePullup:) forControlEvents:UIControlEventValueChanged]; - [self.pullup4 addTarget:self action:@selector(onChangePullup:) forControlEvents:UIControlEventValueChanged]; - [self.pullup5 addTarget:self action:@selector(onChangePullup:) forControlEvents:UIControlEventValueChanged]; - [self.pullup6 addTarget:self action:@selector(onChangePullup:) forControlEvents:UIControlEventValueChanged]; - [self.pullup7 addTarget:self action:@selector(onChangePullup:) forControlEvents:UIControlEventValueChanged]; - - // 入力状態の変化イベントハンドラ - [Konashi addObserver:self selector:@selector(updatePioInput) name:KonashiEventDigitalIODidUpdateNotification]; - - [Konashi shared].digitalInputDidChangeValueHandler = ^(KonashiDigitalIOPin pin, int value) { - NSLog(@"pio input changed:%d(pin:%d)", value, pin); - }; - [Konashi shared].digitalOutputDidChangeValueHandler = ^(KonashiDigitalIOPin pin, int value) { - NSLog(@"pio output changed:%d(pin:%d)", value, pin); - }; -} - -- (void)didReceiveMemoryWarning -{ - [super didReceiveMemoryWarning]; - // Dispose of any resources that can be recreated. -} - - -///////////////////////////////////// -// I/O設定 - -- (void)onChangePin:(id)sender -{ - UISwitch *pin = (UISwitch *)sender; - - if(pin==self.pin0){ - if(pin.on){ - self.out0.enabled = YES; - self.pullup0.enabled = NO; - [Konashi pinMode:KonashiDigitalIO0 mode:KonashiPinModeOutput]; - } else { - self.out0.enabled = NO; - self.pullup0.enabled = YES; - [Konashi pinMode:KonashiDigitalIO0 mode:KonashiPinModeInput]; - } - } - else if(pin==self.pin1){ - if(pin.on){ - self.out1.enabled = YES; - self.pullup1.enabled = NO; - [Konashi pinMode:KonashiDigitalIO1 mode:KonashiPinModeOutput]; - } else { - self.out1.enabled = NO; - self.pullup1.enabled = YES; - [Konashi pinMode:KonashiDigitalIO1 mode:KonashiPinModeInput]; - } - } - else if(pin==self.pin2){ - if(pin.on){ - self.out2.enabled = YES; - self.pullup2.enabled = NO; - [Konashi pinMode:KonashiDigitalIO2 mode:KonashiPinModeOutput]; - } else { - self.out2.enabled = NO; - self.pullup2.enabled = YES; - [Konashi pinMode:KonashiDigitalIO2 mode:KonashiPinModeInput]; - } - } - else if(pin==self.pin3){ - if(pin.on){ - self.out3.enabled = YES; - self.pullup3.enabled = NO; - [Konashi pinMode:KonashiDigitalIO3 mode:KonashiPinModeOutput]; - } else { - self.out3.enabled = NO; - self.pullup3.enabled = YES; - [Konashi pinMode:KonashiDigitalIO3 mode:KonashiPinModeInput]; - } - } - else if(pin==self.pin4){ - if(pin.on){ - self.out4.enabled = YES; - self.pullup4.enabled = NO; - [Konashi pinMode:KonashiDigitalIO4 mode:KonashiPinModeOutput]; - } else { - self.out4.enabled = NO; - self.pullup4.enabled = YES; - [Konashi pinMode:KonashiDigitalIO4 mode:KonashiPinModeInput]; - } - } - else if(pin==self.pin5){ - if(pin.on){ - self.out5.enabled = YES; - self.pullup5.enabled = NO; - [Konashi pinMode:KonashiDigitalIO5 mode:KonashiPinModeOutput]; - } else { - self.out5.enabled = NO; - self.pullup5.enabled = YES; - [Konashi pinMode:KonashiDigitalIO5 mode:KonashiPinModeInput]; - } - } - else if(pin==self.pin6){ - if(pin.on){ - self.out6.enabled = YES; - self.pullup6.enabled = NO; - [Konashi pinMode:KonashiDigitalIO6 mode:KonashiPinModeOutput]; - } else { - self.out6.enabled = NO; - self.pullup6.enabled = YES; - [Konashi pinMode:KonashiDigitalIO6 mode:KonashiPinModeInput]; - } - } - else if(pin==self.pin7){ - if(pin.on){ - self.out7.enabled = YES; - self.pullup7.enabled = NO; - [Konashi pinMode:KonashiDigitalIO7 mode:KonashiPinModeOutput]; - } else { - self.out7.enabled = NO; - self.pullup7.enabled = YES; - [Konashi pinMode:KonashiDigitalIO7 mode:KonashiPinModeInput]; - } - } -} - - -///////////////////////////////////// -// OUTPUT / 出力 - -- (void)onChangeOutput:(id)sender -{ - UISwitch *pin = (UISwitch *)sender; - - if(pin==self.out0){ - if(pin.on){ - [Konashi digitalWrite:KonashiDigitalIO0 value:KonashiLevelHigh]; - } else { - [Konashi digitalWrite:KonashiDigitalIO0 value:KonashiLevelLow]; - } - } - else if(pin==self.out1){ - if(pin.on){ - [Konashi digitalWrite:KonashiDigitalIO1 value:KonashiLevelHigh]; - } else { - [Konashi digitalWrite:KonashiDigitalIO1 value:KonashiLevelLow]; - } - } - else if(pin==self.out2){ - if(pin.on){ - [Konashi digitalWrite:KonashiDigitalIO2 value:KonashiLevelHigh]; - } else { - [Konashi digitalWrite:KonashiDigitalIO2 value:KonashiLevelLow]; - } - } - else if(pin==self.out3){ - if(pin.on){ - [Konashi digitalWrite:KonashiDigitalIO3 value:KonashiLevelHigh]; - } else { - [Konashi digitalWrite:KonashiDigitalIO3 value:KonashiLevelLow]; - } - } - else if(pin==self.out4){ - if(pin.on){ - [Konashi digitalWrite:KonashiDigitalIO4 value:KonashiLevelHigh]; - } else { - [Konashi digitalWrite:KonashiDigitalIO4 value:KonashiLevelLow]; - } - } - else if(pin==self.out5){ - if(pin.on){ - [Konashi digitalWrite:KonashiDigitalIO5 value:KonashiLevelHigh]; - } else { - [Konashi digitalWrite:KonashiDigitalIO5 value:KonashiLevelLow]; - } - } - else if(pin==self.out6){ - if(pin.on){ - [Konashi digitalWrite:KonashiDigitalIO6 value:KonashiLevelHigh]; - } else { - [Konashi digitalWrite:KonashiDigitalIO6 value:KonashiLevelLow]; - } - } - else if(pin==self.out7){ - if(pin.on){ - [Konashi digitalWrite:KonashiDigitalIO7 value:KonashiLevelHigh]; - } else { - [Konashi digitalWrite:KonashiDigitalIO7 value:KonashiLevelLow]; - } - } -} - - -///////////////////////////////////// -// PULLUP / プルアップ - -- (void)onChangePullup:(id)sender -{ - UISwitch *pin = (UISwitch *)sender; - - if(pin==self.pullup0){ - if(pin.on){ - [Konashi pinPullup:KonashiDigitalIO0 mode:KonashiPinModePullup]; - } else { - [Konashi pinPullup:KonashiDigitalIO0 mode:KonashiPinModeNoPulls]; - } - } - else if(pin==self.pullup1){ - if(pin.on){ - [Konashi pinPullup:KonashiDigitalIO1 mode:KonashiPinModePullup]; - } else { - [Konashi pinPullup:KonashiDigitalIO1 mode:KonashiPinModeNoPulls]; - } - } - else if(pin==self.pullup1){ - if(pin.on){ - [Konashi pinPullup:KonashiDigitalIO1 mode:KonashiPinModePullup]; - } else { - [Konashi pinPullup:KonashiDigitalIO1 mode:KonashiPinModeNoPulls]; - } - } - else if(pin==self.pullup2){ - if(pin.on){ - [Konashi pinPullup:KonashiDigitalIO2 mode:KonashiPinModePullup]; - } else { - [Konashi pinPullup:KonashiDigitalIO2 mode:KonashiPinModeNoPulls]; - } - } - else if(pin==self.pullup3){ - if(pin.on){ - [Konashi pinPullup:KonashiDigitalIO3 mode:KonashiPinModePullup]; - } else { - [Konashi pinPullup:KonashiDigitalIO3 mode:KonashiPinModeNoPulls]; - } - } - else if(pin==self.pullup4){ - if(pin.on){ - [Konashi pinPullup:KonashiDigitalIO4 mode:KonashiPinModePullup]; - } else { - [Konashi pinPullup:KonashiDigitalIO4 mode:KonashiPinModeNoPulls]; - } - } - else if(pin==self.pullup5){ - if(pin.on){ - [Konashi pinPullup:KonashiDigitalIO5 mode:KonashiPinModePullup]; - } else { - [Konashi pinPullup:KonashiDigitalIO5 mode:KonashiPinModeNoPulls]; - } - } - else if(pin==self.pullup6){ - if(pin.on){ - [Konashi pinPullup:KonashiDigitalIO6 mode:KonashiPinModePullup]; - } else { - [Konashi pinPullup:KonashiDigitalIO6 mode:KonashiPinModeNoPulls]; - } - } - else if(pin==self.pullup7){ - if(pin.on){ - [Konashi pinPullup:KonashiDigitalIO7 mode:KonashiPinModePullup]; - } else { - [Konashi pinPullup:KonashiDigitalIO7 mode:KonashiPinModeNoPulls]; - } - } -} - - -///////////////////////////////////// -// 入力の変化 - -- (void)updatePioInput -{ - self.in0.on = [Konashi digitalRead:KonashiDigitalIO0]; - self.in1.on = [Konashi digitalRead:KonashiDigitalIO1]; - self.in2.on = [Konashi digitalRead:KonashiDigitalIO2]; - self.in3.on = [Konashi digitalRead:KonashiDigitalIO3]; - self.in4.on = [Konashi digitalRead:KonashiDigitalIO4]; - self.in5.on = [Konashi digitalRead:KonashiDigitalIO5]; - self.in6.on = [Konashi digitalRead:KonashiDigitalIO6]; - self.in7.on = [Konashi digitalRead:KonashiDigitalIO7]; -} - -@end diff --git a/samples/TestAllFunctions/TestAllFunctions/PwnViewController.h b/samples/TestAllFunctions/TestAllFunctions/PwnViewController.h deleted file mode 100644 index 15b8cb7..0000000 --- a/samples/TestAllFunctions/TestAllFunctions/PwnViewController.h +++ /dev/null @@ -1,35 +0,0 @@ -// -// PwnViewController.h -// TestAllFunctions -// -// Copyright (c) 2013 Yukai Engineering. All rights reserved. -// - -#import - -@interface PwnViewController : UIViewController - -@property (weak, nonatomic) IBOutlet UISwitch *pwmSetting0; -@property (weak, nonatomic) IBOutlet UISwitch *pwmSetting1; -@property (weak, nonatomic) IBOutlet UISwitch *pwmSetting2; -@property (weak, nonatomic) IBOutlet UISwitch *pwmSetting3; -@property (weak, nonatomic) IBOutlet UISwitch *pwmSetting4; -@property (weak, nonatomic) IBOutlet UISwitch *pwmSetting5; -@property (weak, nonatomic) IBOutlet UISwitch *pwmSetting6; -@property (weak, nonatomic) IBOutlet UISwitch *pwmSetting7; - -@property (weak, nonatomic) IBOutlet UISlider *pwmDuty0; -@property (weak, nonatomic) IBOutlet UISlider *pwmDuty1; -@property (weak, nonatomic) IBOutlet UISlider *pwmDuty2; -@property (weak, nonatomic) IBOutlet UISlider *pwmDuty3; -@property (weak, nonatomic) IBOutlet UISlider *pwmDuty4; -@property (weak, nonatomic) IBOutlet UISlider *pwmDuty5; -@property (weak, nonatomic) IBOutlet UISlider *pwmDuty6; -@property (weak, nonatomic) IBOutlet UISlider *pwmDuty7; - -@property (weak, nonatomic) IBOutlet UITextField *period; -@property (weak, nonatomic) IBOutlet UITextField *duty; -@property (weak, nonatomic) IBOutlet UITextField *port; -- (IBAction)pushSet:(id)sender; -- (IBAction)endEdit:(id)sender; -@end diff --git a/samples/TestAllFunctions/TestAllFunctions/PwnViewController.m b/samples/TestAllFunctions/TestAllFunctions/PwnViewController.m deleted file mode 100644 index 343c3ce..0000000 --- a/samples/TestAllFunctions/TestAllFunctions/PwnViewController.m +++ /dev/null @@ -1,206 +0,0 @@ -// -// PwnViewController.m -// TestAllFunctions -// -// Copyright (c) 2013 Yukai Engineering. All rights reserved. -// - -#import "PwnViewController.h" -#import "Konashi.h" - -@interface PwnViewController () - -@end - -@implementation PwnViewController - -- (void)viewDidLoad -{ - [super viewDidLoad]; - // Do any additional setup after loading the view. - - [self.pwmSetting0 addTarget:self action:@selector(onChangeSetting:) forControlEvents:UIControlEventValueChanged]; - [self.pwmSetting1 addTarget:self action:@selector(onChangeSetting:) forControlEvents:UIControlEventValueChanged]; - [self.pwmSetting2 addTarget:self action:@selector(onChangeSetting:) forControlEvents:UIControlEventValueChanged]; - [self.pwmSetting3 addTarget:self action:@selector(onChangeSetting:) forControlEvents:UIControlEventValueChanged]; - [self.pwmSetting4 addTarget:self action:@selector(onChangeSetting:) forControlEvents:UIControlEventValueChanged]; - [self.pwmSetting5 addTarget:self action:@selector(onChangeSetting:) forControlEvents:UIControlEventValueChanged]; - [self.pwmSetting6 addTarget:self action:@selector(onChangeSetting:) forControlEvents:UIControlEventValueChanged]; - [self.pwmSetting7 addTarget:self action:@selector(onChangeSetting:) forControlEvents:UIControlEventValueChanged]; - - [self.pwmDuty0 addTarget:self action:@selector(onChangeDuty:) forControlEvents:UIControlEventValueChanged]; - [self.pwmDuty1 addTarget:self action:@selector(onChangeDuty:) forControlEvents:UIControlEventValueChanged]; - [self.pwmDuty2 addTarget:self action:@selector(onChangeDuty:) forControlEvents:UIControlEventValueChanged]; - [self.pwmDuty3 addTarget:self action:@selector(onChangeDuty:) forControlEvents:UIControlEventValueChanged]; - [self.pwmDuty4 addTarget:self action:@selector(onChangeDuty:) forControlEvents:UIControlEventValueChanged]; - [self.pwmDuty5 addTarget:self action:@selector(onChangeDuty:) forControlEvents:UIControlEventValueChanged]; - [self.pwmDuty6 addTarget:self action:@selector(onChangeDuty:) forControlEvents:UIControlEventValueChanged]; - [self.pwmDuty7 addTarget:self action:@selector(onChangeDuty:) forControlEvents:UIControlEventValueChanged]; -} - -- (void)didReceiveMemoryWarning -{ - [super didReceiveMemoryWarning]; - // Dispose of any resources that can be recreated. -} - -- (void)onChangeSetting:(id)sender -{ - UISwitch *setting = (UISwitch *)sender; - - if(setting == self.pwmSetting0){ - if(setting.on){ - [Konashi pwmMode:KonashiDigitalIO0 mode:KonashiPWMModeEnableLED]; - [Konashi pwmLedDrive:KonashiDigitalIO0 dutyRatio:self.pwmDuty0.value * 100]; - } else { - [Konashi pwmMode:KonashiDigitalIO0 mode:KonashiPWMModeDisable]; - } - } - else if(setting == self.pwmSetting1){ - if(setting.on){ - [Konashi pwmMode:KonashiDigitalIO1 mode:KonashiPWMModeEnableLED]; - [Konashi pwmLedDrive:KonashiDigitalIO1 dutyRatio:self.pwmDuty1.value * 100]; - } else { - [Konashi pwmMode:KonashiDigitalIO1 mode:KonashiPWMModeDisable]; - } - } - else if(setting == self.pwmSetting2){ - if(setting.on){ - [Konashi pwmMode:KonashiDigitalIO2 mode:KonashiPWMModeEnableLED]; - [Konashi pwmLedDrive:KonashiDigitalIO2 dutyRatio:self.pwmDuty2.value * 100]; - } else { - [Konashi pwmMode:KonashiDigitalIO2 mode:KonashiPWMModeDisable]; - } - } - else if(setting == self.pwmSetting3){ - if(setting.on){ - [Konashi pwmMode:KonashiDigitalIO3 mode:KonashiPWMModeEnableLED]; - [Konashi pwmLedDrive:KonashiDigitalIO3 dutyRatio:self.pwmDuty3.value * 100]; - } else { - [Konashi pwmMode:KonashiDigitalIO3 mode:KonashiPWMModeDisable]; - } - } - else if(setting == self.pwmSetting4){ - if(setting.on){ - [Konashi pwmMode:KonashiDigitalIO4 mode:KonashiPWMModeEnableLED]; - [Konashi pwmLedDrive:KonashiDigitalIO4 dutyRatio:self.pwmDuty4.value * 100]; - } else { - [Konashi pwmMode:KonashiDigitalIO4 mode:KonashiPWMModeDisable]; - } - } - else if(setting == self.pwmSetting5){ - if(setting.on){ - [Konashi pwmMode:KonashiDigitalIO5 mode:KonashiPWMModeEnableLED]; - [Konashi pwmLedDrive:KonashiDigitalIO5 dutyRatio:self.pwmDuty5.value * 100]; - } else { - [Konashi pwmMode:KonashiDigitalIO5 mode:KonashiPWMModeDisable]; - } - } - else if(setting == self.pwmSetting6){ - if(setting.on){ - [Konashi pwmMode:KonashiDigitalIO6 mode:KonashiPWMModeEnableLED]; - [Konashi pwmLedDrive:KonashiDigitalIO6 dutyRatio:self.pwmDuty6.value * 100]; - } else { - [Konashi pwmMode:KonashiDigitalIO6 mode:KonashiPWMModeDisable]; - } - } - else if(setting == self.pwmSetting7){ - if(setting.on){ - [Konashi pwmMode:KonashiDigitalIO7 mode:KonashiPWMModeEnableLED]; - [Konashi pwmLedDrive:KonashiDigitalIO7 dutyRatio:self.pwmDuty7.value * 100]; - } else { - [Konashi pwmMode:KonashiDigitalIO7 mode:KonashiPWMModeDisable]; - } - } -} - -- (void)onChangeDuty:(id)sender -{ - UISlider *slider = (UISlider *)sender; - - if(slider == self.pwmDuty0){ - if(self.pwmSetting0.on){ - [Konashi pwmLedDrive:KonashiDigitalIO0 dutyRatio:slider.value * 100]; - } - } - else if(slider == self.pwmDuty1){ - if(self.pwmSetting1.on){ - [Konashi pwmLedDrive:KonashiDigitalIO1 dutyRatio:slider.value * 100]; - } - } - else if(slider == self.pwmDuty2){ - if(self.pwmSetting2.on){ - [Konashi pwmLedDrive:KonashiDigitalIO2 dutyRatio:slider.value * 100]; - } - } - else if(slider == self.pwmDuty3){ - if(self.pwmSetting3.on){ - [Konashi pwmLedDrive:KonashiDigitalIO3 dutyRatio:slider.value * 100]; - } - } - else if(slider == self.pwmDuty4){ - if(self.pwmSetting4.on){ - [Konashi pwmLedDrive:KonashiDigitalIO4 dutyRatio:slider.value * 100]; - } - } - else if(slider == self.pwmDuty5){ - if(self.pwmSetting5.on){ - [Konashi pwmLedDrive:KonashiDigitalIO5 dutyRatio:slider.value * 100]; - } - } - else if(slider == self.pwmDuty6){ - if(self.pwmSetting6.on){ - [Konashi pwmLedDrive:KonashiDigitalIO6 dutyRatio:slider.value * 100]; - } - } - else if(slider == self.pwmDuty7){ - if(self.pwmSetting7.on){ - [Konashi pwmLedDrive:KonashiDigitalIO7 dutyRatio:slider.value * 100]; - } - } -} - -- (IBAction)pushSet:(id)sender { - [Konashi pwmPeriod:[self.port.text intValue] period:[self.period.text intValue]]; - [Konashi pwmDuty:[self.port.text intValue] duty:[self.duty.text intValue]]; - [Konashi pwmMode:[self.port.text intValue] mode:KonashiPWMModeEnable]; - - /* - int period = [self.period.text intValue]; - int duty = [self.duty.text intValue]; - - [Konashi pwmPeriod:KonashiDigitalIO0 period:period]; - [Konashi pwmDuty:KonashiDigitalIO0 duty:duty]; - [Konashi pwmPeriod:KonashiDigitalIO1 period:period]; - [Konashi pwmDuty:KonashiDigitalIO1 duty:duty]; - [Konashi pwmPeriod:KonashiDigitalIO2 period:period]; - [Konashi pwmDuty:KonashiDigitalIO2 duty:duty]; - [Konashi pwmPeriod:KonashiDigitalIO3 period:period]; - [Konashi pwmDuty:KonashiDigitalIO3 duty:duty]; - [Konashi pwmPeriod:KonashiDigitalIO4 period:period]; - [Konashi pwmDuty:KonashiDigitalIO4 duty:duty]; - [Konashi pwmPeriod:KonashiDigitalIO5 period:period]; - [Konashi pwmDuty:KonashiDigitalIO5 duty:duty]; - [Konashi pwmPeriod:KonashiDigitalIO6 period:period]; - [Konashi pwmDuty:KonashiDigitalIO6 duty:duty]; - [Konashi pwmPeriod:KonashiDigitalIO7 period:period]; - [Konashi pwmDuty:KonashiDigitalIO7 duty:duty]; - - [Konashi pwmMode:KonashiDigitalIO0 mode:KONASHI_PWM_ENABLE]; - [Konashi pwmMode:KonashiDigitalIO1 mode:KONASHI_PWM_ENABLE]; - [Konashi pwmMode:KonashiDigitalIO2 mode:KONASHI_PWM_ENABLE]; - [Konashi pwmMode:KonashiDigitalIO3 mode:KONASHI_PWM_ENABLE]; - [Konashi pwmMode:KonashiDigitalIO4 mode:KONASHI_PWM_ENABLE]; - [Konashi pwmMode:KonashiDigitalIO5 mode:KONASHI_PWM_ENABLE]; - [Konashi pwmMode:KonashiDigitalIO6 mode:KONASHI_PWM_ENABLE]; - [Konashi pwmMode:KonashiDigitalIO7 mode:KONASHI_PWM_ENABLE]; - */ -} - -- (IBAction)endEdit:(id)sender { - UITextField *tf = (UITextField *)sender; - - [tf resignFirstResponder]; -} - -@end diff --git a/samples/TestAllFunctions/TestAllFunctions/TestAllFunctions-Info.plist b/samples/TestAllFunctions/TestAllFunctions/TestAllFunctions-Info.plist deleted file mode 100644 index 6e57571..0000000 --- a/samples/TestAllFunctions/TestAllFunctions/TestAllFunctions-Info.plist +++ /dev/null @@ -1,65 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleDisplayName - konashi - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIcons - - CFBundlePrimaryIcon - - CFBundleIconFiles - - icon.png - icon@2x.png - - UIPrerenderedIcon - - - - CFBundleIdentifier - com.uxux.Konashi.test.${PRODUCT_NAME:rfc1034identifier} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - LSRequiresIPhoneOS - - UIMainStoryboardFile - MainStoryboard - UIPrerenderedIcon - - UIRequiredDeviceCapabilities - - armv7 - - UIStatusBarTintParameters - - UINavigationBar - - Style - UIBarStyleDefault - Translucent - - - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/samples/TestAllFunctions/TestAllFunctions/TestAllFunctions-Prefix.pch b/samples/TestAllFunctions/TestAllFunctions/TestAllFunctions-Prefix.pch deleted file mode 100644 index 74c242d..0000000 --- a/samples/TestAllFunctions/TestAllFunctions/TestAllFunctions-Prefix.pch +++ /dev/null @@ -1,14 +0,0 @@ -// -// Prefix header for all source files of the 'TestAllFunctions' target in the 'TestAllFunctions' project -// - -#import - -#ifndef __IPHONE_5_0 -#warning "This project uses features only available in iOS SDK 5.0 and later." -#endif - -#ifdef __OBJC__ - #import - #import -#endif diff --git a/samples/TestAllFunctions/TestAllFunctions/aio.png b/samples/TestAllFunctions/TestAllFunctions/aio.png deleted file mode 100644 index 43762c3..0000000 Binary files a/samples/TestAllFunctions/TestAllFunctions/aio.png and /dev/null differ diff --git a/samples/TestAllFunctions/TestAllFunctions/aio@2x.png b/samples/TestAllFunctions/TestAllFunctions/aio@2x.png deleted file mode 100644 index 1502f45..0000000 Binary files a/samples/TestAllFunctions/TestAllFunctions/aio@2x.png and /dev/null differ diff --git a/samples/TestAllFunctions/TestAllFunctions/comm.png b/samples/TestAllFunctions/TestAllFunctions/comm.png deleted file mode 100755 index 3036b61..0000000 Binary files a/samples/TestAllFunctions/TestAllFunctions/comm.png and /dev/null differ diff --git a/samples/TestAllFunctions/TestAllFunctions/comm@2x.png b/samples/TestAllFunctions/TestAllFunctions/comm@2x.png deleted file mode 100755 index 09d85e3..0000000 Binary files a/samples/TestAllFunctions/TestAllFunctions/comm@2x.png and /dev/null differ diff --git a/samples/TestAllFunctions/TestAllFunctions/control.png b/samples/TestAllFunctions/TestAllFunctions/control.png deleted file mode 100755 index a451fa0..0000000 Binary files a/samples/TestAllFunctions/TestAllFunctions/control.png and /dev/null differ diff --git a/samples/TestAllFunctions/TestAllFunctions/control@2x.png b/samples/TestAllFunctions/TestAllFunctions/control@2x.png deleted file mode 100755 index fdc2081..0000000 Binary files a/samples/TestAllFunctions/TestAllFunctions/control@2x.png and /dev/null differ diff --git a/samples/TestAllFunctions/TestAllFunctions/en.lproj/InfoPlist.strings b/samples/TestAllFunctions/TestAllFunctions/en.lproj/InfoPlist.strings deleted file mode 100644 index 477b28f..0000000 --- a/samples/TestAllFunctions/TestAllFunctions/en.lproj/InfoPlist.strings +++ /dev/null @@ -1,2 +0,0 @@ -/* Localized versions of Info.plist keys */ - diff --git a/samples/TestAllFunctions/TestAllFunctions/en.lproj/MainStoryboard.storyboard b/samples/TestAllFunctions/TestAllFunctions/en.lproj/MainStoryboard.storyboard deleted file mode 100644 index 75624a4..0000000 --- a/samples/TestAllFunctions/TestAllFunctions/en.lproj/MainStoryboard.storyboard +++ /dev/null @@ -1,1248 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/TestAllFunctions/TestAllFunctions/first.png b/samples/TestAllFunctions/TestAllFunctions/first.png deleted file mode 100644 index 9300ee2..0000000 Binary files a/samples/TestAllFunctions/TestAllFunctions/first.png and /dev/null differ diff --git a/samples/TestAllFunctions/TestAllFunctions/first@2x.png b/samples/TestAllFunctions/TestAllFunctions/first@2x.png deleted file mode 100644 index 374d78e..0000000 Binary files a/samples/TestAllFunctions/TestAllFunctions/first@2x.png and /dev/null differ diff --git a/samples/TestAllFunctions/TestAllFunctions/icon-72.png b/samples/TestAllFunctions/TestAllFunctions/icon-72.png deleted file mode 100644 index 5ed4c19..0000000 Binary files a/samples/TestAllFunctions/TestAllFunctions/icon-72.png and /dev/null differ diff --git a/samples/TestAllFunctions/TestAllFunctions/icon.png b/samples/TestAllFunctions/TestAllFunctions/icon.png deleted file mode 100644 index 88c8191..0000000 Binary files a/samples/TestAllFunctions/TestAllFunctions/icon.png and /dev/null differ diff --git a/samples/TestAllFunctions/TestAllFunctions/icon@2x.png b/samples/TestAllFunctions/TestAllFunctions/icon@2x.png deleted file mode 100644 index b620581..0000000 Binary files a/samples/TestAllFunctions/TestAllFunctions/icon@2x.png and /dev/null differ diff --git a/samples/TestAllFunctions/TestAllFunctions/main.m b/samples/TestAllFunctions/TestAllFunctions/main.m deleted file mode 100644 index 528d16e..0000000 --- a/samples/TestAllFunctions/TestAllFunctions/main.m +++ /dev/null @@ -1,17 +0,0 @@ -// -// main.m -// TestAllFunctions -// -// Copyright (c) 2013 Yukai Engineering. All rights reserved. -// - -#import - -#import "AppDelegate.h" - -int main(int argc, char *argv[]) -{ - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/samples/TestAllFunctions/TestAllFunctions/pio.png b/samples/TestAllFunctions/TestAllFunctions/pio.png deleted file mode 100644 index 5a6bfb8..0000000 Binary files a/samples/TestAllFunctions/TestAllFunctions/pio.png and /dev/null differ diff --git a/samples/TestAllFunctions/TestAllFunctions/pio@2x.png b/samples/TestAllFunctions/TestAllFunctions/pio@2x.png deleted file mode 100644 index a76f36e..0000000 Binary files a/samples/TestAllFunctions/TestAllFunctions/pio@2x.png and /dev/null differ diff --git a/samples/TestAllFunctions/TestAllFunctions/pwm.png b/samples/TestAllFunctions/TestAllFunctions/pwm.png deleted file mode 100644 index caad413..0000000 Binary files a/samples/TestAllFunctions/TestAllFunctions/pwm.png and /dev/null differ diff --git a/samples/TestAllFunctions/TestAllFunctions/pwm@2x.png b/samples/TestAllFunctions/TestAllFunctions/pwm@2x.png deleted file mode 100644 index b9f597b..0000000 Binary files a/samples/TestAllFunctions/TestAllFunctions/pwm@2x.png and /dev/null differ diff --git a/samples/UartSample/UartSample.xcodeproj/project.pbxproj b/samples/UartSample/UartSample.xcodeproj/project.pbxproj index 56ee927..e941e1b 100644 --- a/samples/UartSample/UartSample.xcodeproj/project.pbxproj +++ b/samples/UartSample/UartSample.xcodeproj/project.pbxproj @@ -154,7 +154,7 @@ 08284B7916AEF7DA00693B45 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0510; + LastUpgradeCheck = 0700; ORGANIZATIONNAME = "Yukai Engineering"; }; buildConfigurationList = 08284B7C16AEF7DA00693B45 /* Build configuration list for PBXProject "UartSample" */; @@ -236,6 +236,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; @@ -286,6 +287,7 @@ "-all_load", "-ObjC", ); + PRODUCT_BUNDLE_IDENTIFIER = "com.ux-xu.konashi.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; USER_HEADER_SEARCH_PATHS = "$(BUILT_PRODUCTS_DIR)/** $(PROJECT_DIR)/../../**"; WRAPPER_EXTENSION = app; @@ -303,6 +305,7 @@ "-all_load", "-ObjC", ); + PRODUCT_BUNDLE_IDENTIFIER = "com.ux-xu.konashi.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; USER_HEADER_SEARCH_PATHS = "$(BUILT_PRODUCTS_DIR)/** $(PROJECT_DIR)/../../**"; WRAPPER_EXTENSION = app; diff --git a/samples/UartSample/UartSample/UartSample-Info.plist b/samples/UartSample/UartSample/UartSample-Info.plist index 9d3468f..71d280d 100644 --- a/samples/UartSample/UartSample/UartSample-Info.plist +++ b/samples/UartSample/UartSample/UartSample-Info.plist @@ -22,7 +22,7 @@ CFBundleIdentifier - com.uxux.monaka.uart.${PRODUCT_NAME:rfc1034identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/samples/UartSample/UartSample/ViewController.m b/samples/UartSample/UartSample/ViewController.m index 66e8bf0..756c764 100644 --- a/samples/UartSample/UartSample/ViewController.m +++ b/samples/UartSample/UartSample/ViewController.m @@ -18,12 +18,20 @@ - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. - - [Konashi initialize]; - - [Konashi addObserver:self selector:@selector(connected) name:KonashiEventConnectedNotification]; - [Konashi addObserver:self selector:@selector(ready) name:KonashiEventReadyToUseNotification]; - [Konashi addObserver:self selector:@selector(recvUartRx) name:KonashiEventUartRxCompleteNotification]; + [[Konashi shared] setConnectedHandler:^{ + NSLog(@"CONNECTED"); + }]; + [[Konashi shared] setReadyHandler:^{ + NSLog(@"READY"); + + self.statusMessage.hidden = NO; + + [Konashi uartBaudrate:KonashiUartBaudrateRate9K6]; + [Konashi uartMode:KonashiUartModeEnable]; + }]; + [[Konashi shared] setUartRxCompleteHandler:^(NSData *data) { + NSLog(@"UartRx %@", [data description]); + }]; } - (void)didReceiveMemoryWarning @@ -32,31 +40,11 @@ - (void)didReceiveMemoryWarning // Dispose of any resources that can be recreated. } -- (void) connected -{ - NSLog(@"CONNECTED"); -} - -- (void) ready -{ - NSLog(@"READY"); - - self.statusMessage.hidden = FALSE; - - [Konashi uartBaudrate:KonashiUartBaudrateRate9K6]; - [Konashi uartMode:KonashiUartModeEnable]; -} - -- (void) recvUartRx -{ - NSLog(@"UartRx %d", [Konashi uartRead]); -} - - (IBAction)find:(id)sender { [Konashi find]; } -- (IBAction)send:(id)sender { +- (IBAction)send:(id)sender { [Konashi uartWrite:'A']; } @end diff --git a/samples/UartSample/UartSample/en.lproj/MainStoryboard.storyboard b/samples/UartSample/UartSample/en.lproj/MainStoryboard.storyboard index 5e34ce3..4b90a00 100644 --- a/samples/UartSample/UartSample/en.lproj/MainStoryboard.storyboard +++ b/samples/UartSample/UartSample/en.lproj/MainStoryboard.storyboard @@ -1,34 +1,37 @@ - + - + + + + + + - +