Skip to main content

mergAccessory

Type

library

Description

mergAccessory is an iOS external for connecting to and communication with accessory hardware using the External Accessory framework.

Each device in the MFi program has a name and one or more protocols it supports. For your app to see the device it needs to state what protocols it supports. To do this you need to edit the plist file which is found at /Applications/LiveCode 5.5.app/Contents/Tools/Runtime/iOS/Device-5_1/Settings.plist.

Add the protocols your application supports under the UISupportedExternalAccessoryProtocols key.

    keyUISupportedExternalAccessoryProtocols/key
array
stringcom.bluebamboo.p25i/string
/array

Your application will also need to be registered with the manufacturer and Apple.

Associated Syntax

Function

NameSummarySyntax
mergAccessoryNamesReturns the names of any devices connected to the device with protocols your supports mergAccessoryNames()
mergAccessoryProtocolsReturns a list of protocols that both the accessory and your app support mergAccessoryProtocols(<pName>)
mergAccessoryOpenSessionsGet a list of currently open sessionsmergAccessoryOpenSessions()

Command

NameSummarySyntax
mergAccessoryOpenSessionSends a message back to the calling object when the session is openmergAccessoryOpenSession <pNameAndProtocol>, <pCallbackHandler>
mergAccessoryCloseSessionCloses an open sessionmergAccessoryCloseSession <pNameAndProtocol>
mergAccessoryReadThis handler requests a read of 'pLength' of data on an active sessionmergAccessoryRead <pNameAndProtocol>, <pLength>, <pCallcackHandler>
mergAccessoryWriteThis handler requests a write of 'data' on an active sessionmergAccessoryWrite <pNameAndProtocol>, <pData>, <pCallcackHandler>
mergAccessoryRegisterForNotificationsRegisters the calling control to receive the mergAccessoryConnected and mergAccessoryDisconnected messages mergAccessoryRegisterForNotifications

Message

NameSummarySyntax
mergAccessoryConnectedSent to the control that registered for notifications when an accessory with a supported protocol connects to the device mergAccessoryConnected <pName>
mergAccessoryDisonnectedSent to the control that registered for notifications when an accessory with a supported protocol disconnects to the device mergAccessoryDisonnected <pName>
Thank you for your feedback!

Was this page helpful?