2010-04-04 25 views

回答

3

正方形通過耳機插孔工作,因此它不使用外部附件框架。 iPhone上的外部配件出了名的難度很大,這就是爲什麼幾乎沒有任何製造商正在創造產品。

http://www.wired.com/gadgetlab/2010/01/wither-the-dongleware

我可以用一根手指計數的第三方設備上我看到過iPhone上的基座連接器進行通信的數量。

3

ExternalAccessory.framework

糟糕。 Square不使用ExternalAccessory,而是通過耳機插孔的某種自定義界面,如@kubi所解釋的。

相關的接口看起來是這樣的:

__attribute__((visibility("hidden"))) 
@interface SKSquareInterface : NSObject { 
@private 
    ? delegate; 
    ? queue; 
    ? state; 
} 
@property(assign) ? XXEncryptedProperty_6b644; 
@property(assign) ? XXEncryptedProperty_6a1bc; 
@property(assign) ? XXEncryptedProperty_77a22; 
@property(assign) ? XXEncryptedProperty_77a39; 
@property(assign) ? XXEncryptedProperty_77a60; 
@property(assign) ? XXEncryptedProperty_77800; 
@property(assign) ? XXEncryptedProperty_7780c; 
+(?)sharedInstance; 
-(?)init; 
-(?)dealloc; 
-(?)parseState; 
-(?)triggered; 
-(?)dcOffset; 
-(?)shouldStartWhenCapable; 
-(?)setShouldStartWhenCapable:(?)startWhenCapable; 
-(?)start; 
-(?)stop; 
-(?)isAttached; 
-(?)_reset; 
-(?)_stop; 
-(?)_initializeQueues; 
-(?)_isAudioQueueRunning; 
-(?)_listenForSwipe:(?)swipe numSamps:(?)samps; 
-(?)_tryToStartAudioInterface; 
-(?)_tryToStopAudioInterface; 
-(?)_notifyDelegateDidBeginSwipe; 
-(?)_notifyDelegateSwipeFailed; 
-(?)_notifyDelegateOfRawData:(?)rawData; 
-(?)_notifyDelegateOfRawDataOnMainThread:(?)rawDataOnMainThread; 
-(?)_notifyDelegateSwipedPaymentCard:(?)card; 
-(?)_notifyDelegateSwipedPaymentCardOnMainThread:(?)thread; 
-(?)state; 
-(?)delegate; 
-(?)setDelegate:(?)delegate; 
@end 

這表明它直接從AudioQueue解析輸入。