mergAccessory

Typelibrary
DictionaryLCS
LibraryLiveCode Script
Associationsmergaccessory
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.

<a href="key_LCS_glossary.html">key</a>UISupportedExternalAccessoryProtocols<b>/key</b>
<a href="array_LCS_glossary.html">array</a>
  <a href="string_LCS_glossary.html">string</a>com.bluebamboo.p25i<b>/string</b>
<b>/array</b>

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

TypeNameSummarySyntax
commandmergAccessoryCloseSession

Closes an open session

mergAccessoryCloseSession <pNameAndProtocol>

- - -mergAccessoryOpenSession

Sends a message back to the calling object when the session is open

mergAccessoryOpenSession <pNameAndProtocol>, <pCallbackHandler>

- - -mergAccessoryRead

This handler requests a read of 'pLength' of data on an active session

mergAccessoryRead <pNameAndProtocol>, <pLength>, <pCallcackHandler>

- - -mergAccessoryRegisterForNotifications

Registers the calling control to receive the mergAccessoryConnected and mergAccessoryDisconnected messages

mergAccessoryRegisterForNotifications

- - -mergAccessoryWrite

This handler requests a write of 'data' on an active session

mergAccessoryWrite <pNameAndProtocol>, <pData>, <pCallcackHandler>

functionmergAccessoryNames

Returns the names of any devices connected to the device with protocols your supports

mergAccessoryNames()

- - -mergAccessoryOpenSessions

Get a list of currently open sessions

mergAccessoryOpenSessions()

- - -mergAccessoryProtocols

Returns a list of protocols that both the accessory and your app support

mergAccessoryProtocols(<pName>)

librarymergAccessory

mergAccessoryProtocols(<pName>)

messagemergAccessoryConnected

Sent to the control that registered for notifications when an accessory with a supported protocol connects to the device

mergAccessoryConnected <pName>

- - -mergAccessoryDisonnected

Sent to the control that registered for notifications when an accessory with a supported protocol disconnects to the device

mergAccessoryDisonnected <pName>