第三代iPad Pro和Apple Pencil2即将面世,我将为绘图应用程序准备更新。但是我不打算购买新设备,问题是,如何修改新设备的Apple Pencil检测代码?
当前代码如下,
if ([central state] == CBManagerStatePoweredOn)
{
// Device information UUID
NSArray* myArray = [NSArray arrayWithObject:[CBUUID UUIDWithString:@"180A"]];
NSArray* peripherals = [m_centralManager retrieveConnectedPeripheralsWithServices:myArray];
for (CBPeripheral* peripheral in peripherals)
{
if ([[peripheral name] containSubstring:@"Apple Pencil"])
{
// The Apple pencil is connected
self.stylusType = Stylus_ApplePencil;
[self.delegate didConnectStylus:Stylus_ApplePencil];
}
}
}
第一代Apple Pencil的uuid是“ 180A”,那么新的uuid和外设名称是什么?