mergAccessoryRead

Typecommand
DictionaryLCS
LibraryLiveCode Script
Syntax
mergAccessoryRead <pNameAndProtocol>, <pLength>, <pCallcackHandler>
Associationsmergaccessory
Summary

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

Editionpro
Introduced8.0
OSios
Platformsmobile
Parameters
NameTypeDescription
pNameAndProtocol

The name as returned by mergAccessoryNames()|the protocol as returned by mergAccesoryProtocols(). For example, "p25i|com.bluebamboo.p25i"

pLength

The number of bytes to read (integer). If you specify 0 here then any available data will be read. The callback won't be sent until the length of data specified is reached.

pCallcackHandler

The handler to call when the data is read.

Description

The 'pCallbackHandler' message will be sent to the owner of the script which opened the session as soon as enough data is available; if 'pLength' is zero then it will be sent as soon as any data is available. Only one pending read request can be active at a time - if an attempt is made to read while one is pending a 'read in progress' error will be thrown. If an error occurs, or the connection is closed before the read request is satisfied a 'mergAccessoryError' or 'mergAccessoryClosed' message will be sent instead of 'pCallbackHandler' and the session closed.

Tagsexternals