IceIAP
2 min read
2 min read
2 min read
2 min read
2 min read
2 min read
2 min read
2 min read
2 min read
IceIAP provides the iap and TLS-protected iaps transports for C++ and Swift clients on iOS. It uses Apple's External Accessory framework to communicate with Ice servers on connected accessories. The accessory must provide the server side of the connection.
Accessory Discovery
IceIAP looks for the accessory among those attached to the iOS device, through its port or over Bluetooth. The accessory must advertise the endpoint's protocol, com.zeroc.ice unless the endpoint specifies another. The endpoint can also specify a name, manufacturer, and model number; each one it specifies must equal the accessory's value.
Installing IceIAP
The IceIAP plug-in is included in all builds of the Ice C++ library for iOS. You enable (“load”) the plug-in by adding it to the pluginFactories field of InitializationData:
Ice::InitializationData initData;initData.properties = Ice::createProperties(argc, argv);initData.pluginFactories = {Ice::iapPluginFactory()};
Ice::CommunicatorPtr communicator = Ice::initialize(initData);The IceIAP plug-in is always enabled on iOS, just like the TCP and UDP transports.
Using IceIAP
An iAP endpoint in a proxy specifies attributes that are used to find and connect to a matching accessory. An iAP endpoint has the following syntax:
iap [-p protocol] [-n name] [-m manufacturer] [-o modelNumber] [-z]
For example, to invoke on a proxy for the greeter object running on an accessory that implements the com.example.visitor protocol, use the following stringified proxy:
greeter:iap -p com.example.visitor
The app's Info.plist lists the protocols the app uses, such as com.example.visitor, in the UISupportedExternalAccessoryProtocols key.
To use TLS over iAP, replace iap with iaps and configure the SSL transport.