External Accessory

RSS for tag

Communicate with accessories connected to a device by the Apple Lightning connector or through Bluetooth using External Accessory.

Posts under External Accessory tag

44 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Horizontal and Vertical Accuracy for CoreLocation
We’re implementing a feature in our app that allows a certified MFi GPS device to act as the default location source for user positioning, replacing the internal GPS when connected. However, we’re noticing a significant discrepancy between the accuracy values reported by iOS and those directly available from the GPS device. Here’s the issue: When the MFi GPS is in use, it transmits standard NMEA messages (GGA, GSA, RMC, etc.) to the iOS device (providing HDOP and VDOP). However, the accuracy reported by iOS for this “location-system” seems to be less precise than what the GPS device itself reports. For example, here are the readings we observe: Location from iOS device (systemLocation): Position: <+41.4, +1.8> +/- 5.00m (speed 0.05 m/s / course 329.40) Timestamp: 6/11/24, 12:01:50 Central European Standard Time Horizontal Accuracy (from systemLocation): 5.0 meters (16 ft) Vertical Accuracy (from systemLocation): 9.5 meters (31 ft) Location from GPS device directly: Horizontal Accuracy: 9.1 ft Vertical Accuracy: 10.3 ft It’s evident that the accuracy values displayed by iOS differ from the values available from the GPS device, especially in terms of horizontal and vertical accuracy. Question: Is there a known reason for this discrepancy in accuracy values? Is there a way to obtain the GPS device’s native accuracy values in iOS, or is iOS applying additional filtering or adjustments that might explain this difference? If additional filtering is applied can be disabled? Any insights would be greatly appreciated, as accurate location reporting is critical for our app’s functionality.
1
0
114
2w
InputStream and OutputStream from EASession is not ready for use if accessory was connected when app is not launched
Hi everyone. I have an iOS application for work with an MFi-certified device connected to the iPhone via USB-C. When I launch the app and attach the device, I can create an EASession and use the InputStream and OutputStream as usual. But if I attach the device before launching the app I can't use the InputStream and OutputStream, because the hasBytesAvailable and hasSpaceAvailable properties are always false. The NSStreamEventHasBytesAvailable and NSStreamEventHasSpaceAvailable events will never be triggered. After I re-attach the device, the streams open fine and I can interact with the device. What can be wrong with the case of attaching the device before the app launches?
1
0
187
2w
Battery Displays for Custom Hardware
I am having difficulty figuring out two indicators for a custom piece of battery hardware. Firstly, on the home screen, scrolling all the way to the left in the widget screen, you can see the battery for connected wireless devices, electronic pencils, etc. Additionally, when you use Apple battery packs, you can see the battery for it on the top right of your phone I am wondering where I should look to see how I could integrate both of these. I have searched the documentation for a while, and I am having a hard time knowing where to start. If anyone can point me to something, it would be very appreciated. Thank you!
0
0
160
Oct ’24
EASession return nil on iOS18
On iOS 18.x when try to create EASession we get nil, but on iOS 17.x everything works. We have app which use USB cable for connecting external accessories. Scenario is when we have fresh instal, connecting with accessory work fine, EASession is created, streams are opened. When we unplug USB, we close streams, remove any reference to session and accessory, remove accessory delegate. When plug it again, creating EASession is returning nil. Only after restarting iPhone, we can create new EASession with appropriate protocol and accessory. Every next attempt without reseting iPhone is failing. Logs from accessory is following: 00:05:51.811000 : onUSBDeviceFound(pDevice=0xffc818)) iPhone USB device already in the device list w/id=1 -> update status now[21;1H 00:05:51.830000 : setConnectionStatus(status=connected) [devId=1] state updated -> forward[21;1H Capabilities indicate HostMode possibility => role switch is triggered 00:05:52.848000 : updateDIPODeviceConnections() iPhoneUSB w/caps=5 (=CarPlay or HostMode), deviceTag=2 in Device mode -> request role switch[21;1H Role switch seems to be successful 00:05:54.914000 : setSwitching('stable') changed[21;1H 00:05:54.915000 : updateDIPODeviceConnections() iPhoneUSB w/caps=2, id=1, deviceTag=2 and native transport -> request app launch and call connectUSB[21;1H 00:05:54.967000 : ConnectiAP2(05ac:12a8, s/n='00008101000160921E90801E', writeFD='/dev/ffs/ep3', readFD='/dev/ffs/ep4', hostMode){3}[21;1H Native transport should become available but does not (the following line is not present for failed case. Taken from successful case) 00:05:24.983000 : OnDBusPropChanged_NativeTransport(): deviceId=2, started=1, iAP2iOSAppIdentifier=1, sinkEndpoint=3, sourceEndpoint=4, TransactionID=1 EAP Start event not received (trace line from success try) 00:05:25.057000 : EAPSessionStart(ctx=0x74e0b800){2} called[21;1H Is there any braking change on iOS 18 considering EASession? Also what is strange is that it works on fresh instal/restart iPhone, but not working on second attempt?
8
7
372
2w
EAAccessoryManager crashes
Hi, The company produces MFI-certified devices. A lot of users are affected. it happens when users are in the background. The crash happens in NSArray; it looks like the array is out of bounds to which EAAccessoryManager tries to access. The only assumption I have is that something is wrong with Threads. Maybe we are blocking a Thread somewhere, or EAAccessory should always work on the Main Thread but we switch streams to another thread. It is hard to believe that Apple could have such a simple bug. If it were Apple's bug, other companies who produce MFI devices could also experience the identical bug, but I don't see anyone raising the identical issue. The issues don't have a relation to iOS versions; it happens for us from iOS 13 till iOS 18. Thanks in advance, Eugene.
7
0
391
Oct ’24
Bluetooth pairing problems (iPhone 16 Pro with Sony WH-1000XM5)
Upgraded from an iPhone 13 Pro Max to an iPhone 16 Pro a week ago. Both running on latest iOS 18 and data transfer was done manually Bluetooth pairing seems to be facing a problem. I have been trying to pair up with my Sony WH-1000XM5 but somehow the phone fails to detect the headphones on Bluetooth. Today I tested with my spare earbuds Bose Soundsport Wireless and faced exactly the same problem. Strange Carplay and my home JVC home player don‘t have this problem
3
1
852
Oct ’24
Unexpected behavior when iPad is unlock and the application goes to Foreground. something happens and the application goes to background and foreground in a small period of time.
I have the our device connected , with Assistive Touch enabled and the application running in the foreground. At this point, I place the screen on standby and leave the device unattended for 10 minutes. After this period, I return, unlock the screen, and observe that our app is still running, and the connection with the device is re-initiated. However, something occurs at this stage that causes the application to briefly switch to the background and then immediately return to the foreground. This behavior leads to system instability. Ideally, once the application is running in the foreground, it should not transition to the background automatically. However, it seems to be doing so for a short duration—momentarily switching from the foreground to the background, then back to the foreground—which is causing the observed instability. OK, the iPad screen is unlocked AND App Appears. 2024-10-01 13:15:55 LOG: APP > Scene did become active 2024-10-01 13:15:55 LOG: APP > Init device Suddenly the application goes to background by itself?!?!?! 2024-10-01 13:15:55 LOG: APP > Scene will change from Foreground to Background 2024-10-01 13:15:55 LOG: APP > Scene changed to Background 2024-10-01 13:15:56 LOG: APP > Scene Will Enter to Foreground 2024-10-01 13:15:56 LOG: APP > Nib Name previous load : Home Other example OK, the iPad screen is unlocked AND App Appears. 2024-10-01 11:23:55 LOG: APP > Scene Will Enter to Foreground 2024-10-01 11:23:56 LOG: APP > Scene did become active 2024-10-01 11:23:56 LOG: APP > Init connection Suddenly the application goes to background by itself?!?!?! 2024-10-01 11:23:56 LOG: APP > Scene will change from Foreground to Background 2024-10-01 11:23:56 LOG: APP > Scene changed to Background 2024-10-01 11:23:56 LOG: APP > Scene Will Enter to Foreground 2024-10-01 11:23:56 LOG: APP > Scene did become active 2024-10-01 11:23:56 LOG: APP > Scene will change from Foreground to Background 2024-10-01 11:23:56 LOG: APP > Scene changed to Background 2024-10-01 11:23:56 LOG: APP > Scene Will Enter to Foreground 2024-10-01 11:23:56 LOG: APP > Nib Name previous load : Home FA FB15345245 this is happening under iPadOS18.1 beta5 and iPad12.9" 6th gen. Would you mind taking a look at this issue ?
2
0
331
Oct ’24
BLE Scanning stops when phone is in locked mode
I have a solution where my application should scan the Bluetooth enabled Beacon devices in the foreground, background, locked mode for the iphone. Currently we have built the project, which is working fine in foreground mode. We have tried exploring multiple options to enable the feature in background and locked mode. As of now, we have come up with the solution which implements Picture in Picture mode in the application and once the application is minimized. The PIP window opens which solves our problem. But the problem stays with locked mode. The scanning is not working in locked mode. So can we know how the bluetooth scanning will work in background and locked mode. Please also mention the alternative solutions to the problem statement if background and locked mode scanning is not possible. I have attached the project source code for reference. This project is being built for Google, so it is bit urgent. Can I expect a quick response to this query?
4
0
417
Sep ’24
Matter development - Matter Accessory - Apple Ecosystem
Apple developer support could not answer my question which is the following: How are Matter developers supposed to test accessory pairing, accessory communication and accessory discovery if the Console logs provided by Apple (iOS, MacOS, iPadOS) are encrypted, incomplete or straight up non-existent. Current issue is mDNS-SD discovery, pairing and PAKE requests initialisation. Impossible to figure out why X or Y stopped on the Apple Device. Chip-tool (provided by PROJECT-CHIP) acts 100% differently than iOS (Home) or iPadOS(Home). Thank you
0
0
328
Sep ’24
Specific Bluetooth speaker issue
Are there any cases where when connected to a specific Bluetooth device on an iPhone or iPad, the Bluetooth device connected at the same time is frequently disconnected or the app connected via CoreBluetooth is disconnected? Our app connects to an iPhone or iPad and connects to CoreBluetooth API to perform specific functions or operations. When a JBL Bluetooth speaker is connected, the connection is automatically disconnected during operation. When the JBL Bluetooth speaker is disconnected, the Bluetooth connection between our apps is not disconnected. It does not happen on all iPhones or iPads, but it seems to happen on some devices. Our app users are experiencing this issue with JBL Bluetooth speakers. So we are trying to replicate this phenomenon with our Bluetooth speaker, but it doesn't work. Has anyone else experienced something similar? I am wondering if this phenomenon can occur.
0
0
370
Jul ’24
External Accessory App Launch doesn't work
After the 'IdentificationAccepted' message, I sent 'RequestAppLaunch' with 'AppBundleID' and 'AppLaunchMethod'. However, the app isn't launched by the external accessory. I checked it with ATS and saw the error message: 'Error: accessory sent a message that the Apple device did not acknowledge during identification. Section: Section 28.2.2 Sent/Received iAP2 Control Session Messages. Source: Accessory Interface Specification R42.' Do you have any idea how to fix it? Thank you in advance.
1
0
434
Jul ’24
ANCS registration failing repeatedly
We have BLE on a vehicle that acts as a peripheral and pairs with the user's iOS device as a central device. As we understand, the only way for a peripheral to be "remembered" for the next connection is registration with ANCS. If we don't register while being connected and then the user goes away, when he next time is in range, fresh pairing has to happen. Is that the right understanding? Before we register, we are discovering the ANCS on an iOS device, with UID for ANCS and connection handle as arguments. There are times when discovering API returns 0x06 (implying service not available). At times, we are able to discover the service and are able to register. We wanted to know if there is a deterministic way to ensure ANCS to be discoverable from the peripheral side? If not, is there another way (say any other service) by which the peripheral can take some action to be remembered?
1
0
446
Jul ’24
Unable to connect to Wifi AP with AccessorySetupKit
Hi, I'm trying to connect to a Wifi access point with the new AccessorySetupKit framework. At first i thought that ASK would establish the connection to the access point but then it was mentioned in the session that I need to do that myself with NEHotspotConfigurationManager. I tried to do that but every time I get this error: NEHotspotConfigurationErrorDomain Code=17 "system denied configuration of the accessory network." My AP is just a small ESP32 but I get the same results with any other AP. Looking at the logs in Console.app for my device, I see some interesting logs such as these: Subsystem: com.apple.AccessorySetup, Category: ASAccessorySession Received event: DADeviceEvent: type DeviceChangedDADeviceEvent: device DADevice: ID D0A7B5FB-6800-4B73-9DC4-697DDE791D2B, name 'Printer Emulator', flags AccessorySetup, SSID 'ESP32-AP', type Hi-Fi Speaker, { DADeviceAppAccessInfo: com.criboe.GBPE, ID D0A7B5FB-6800-4B73-9DC4-697DDE791D2B, state Authorized, < WiFi >, Time 2024-07-10-11:16:40.389, disConfig asID 6CC66EF2-9D12-4071-92E4-7038D741D5E5, btSv [], com.criboe.GBPE, flags 0x8 < RenameSSID >, hSPs [ "ESP32" ] } Subsystem: com.apple.DeviceAccess, Category: DADaemonServer [WiFi] profile not found for SSID = 'ESP32-AP' [WiFi] profile not found for SSID = 'ESP32-AP' [WiFi] profile not found for SSID = 'ESP32-AP' ...and many more... Subsystem: --, Category: (wifid) WiFiManagerAddNetworkAsync: Request to add network with content: ESP32-AP: isHidden=0, isEAP=0, isSAE=0, isWPA=0, isWEP=0, WAPI=0, type=0, enabled=(null), saveData=(null), responsiveness=(null) ((null)) isHome=Unknown, isForceFixed=0, transitionDisabledFlags=(null), foundNanIe=0, isPH=0, isPublicAirPlayNetwork=0, is6EDisabled=0, hs20=0, Channel=0 WiFiManagerAddNetworkAsync: adding ssid='ESP32-AP' bundleId='com.criboe.GBPE' appName='Camera Boy' originator='3rd Party' HS20=0 __GetNetworkWithSameSsid: network ESP32-AP not found WiFiManagerAddNetworkAsync: 'com.criboe.GBPE' is authorized to join 'ESP32-AP: isHidden=0, isEAP=0, isSAE=0, isWPA=0, isWEP=0, WAPI=0, type=0, enabled=(null), saveData=(null), responsiveness=(null) ((null)) isHome=Unknown, isForceFixed=0, transitionDisabledFlags=(null), foundNanIe=0, isPH=0, isPublicAirPlayNetwork=0, is6EDisabled=0, hs20=0, Channel=0' What is weird is that if I don't use ASK to first find my accessory and simply call NEHotspotConfigurationManager.shared.apply(_: ) I can connect to the AP just fine. Any suggestions to what might be wrong here?
3
0
633
Jul ’24