我们有MFI认可的配件设备.我们的协议假定在UART模式下从附件读取连续读数.它在iOS 7.1之前完美运行,但在iOS 7.1上测试之后它无法正常工作.
在ATS测试套件日志中,我们可以看到成功的eap记录和一些由iPhone激活的AccessoryDataTransfer.
我们可以使用EADemo重现问题.EADSessionController在一些显示/关闭循环后停止读取数据.
只有杀死EADemo并重新启动才能让我们读取一些数据.
配置:
iPhone 4和更新版(iOS 7.0),任何iPod(iOS 6.x) - OK
iPhone 4s,iPhone 5(iOS7.1) - 失败
iOS 7.1中的EA框架会发生什么?
我可以安全地在程序地址空间中发布包含代码块的消息吗?测试有效,但这是合法的吗?
typedef void (^EmitBlock)(NSDictionary* args);
- (void) subscribe {
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(on_emit:) name:kEmit object:nil];
}
- (void) on_emit:(NSNotification*) notification
{
EmitBlock completion = [[notification userInfo] valueForKey:@"completion"];
completion(@{@"result" : @"Ok"});
}
- (void) post:(EmitBlock) completion {
[[NSNotificationCenter defaultCenter] postNotificationName:kEmit
object:nil userInfo:@{@"completion":
^(NSDictionay* args) { NSLog(@"%@", args); }
}];
}
Run Code Online (Sandbox Code Playgroud)