<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="html/html; charset=utf-8" /> <title>EMConnectionManager Class Reference</title> <meta id="xcode-display" name="xcode-display" content="render"/> <meta name="viewport" content="width=550" /> <link rel="stylesheet" type="text/css" href="../css/styles.css" media="all" /> <link rel="stylesheet" type="text/css" media="print" href="../css/stylesPrint.css" /> <meta name="generator" content="appledoc 2.2 (build 961)" /> </head> <body> <div id="em-wrapper"> <style> #utility_bar { position: relative; height: 35px; /*background: #231f20 url(../images/bg_tagline.png) no-repeat right center;*/ background: #231f20 url(http://www.emmoco.com/images/bg_tagline.png) no-repeat right center; color: #efefef; overflow: hidden; padding-left: 10px; } #utility_bar p { margin-top: 9px; margin-bottom: 0; } #utility_bar a { color: #efefef; margin-right: 15px; padding: 2px; } #utility_bar a:hover { color: #fff; } #utility_bar a.selected { text-decoration: none; background-color: #555; } </style> <!-- begin utility bar --> <div id="utility_bar"> <!-- user info / logout link --> <p> <a href="http://em-hub.com/">Em-Hub</a> <a href="http://wiki.emmoco.com/">Wiki</a> <a href="http://android.emmoco.com/">Android Docs</a> <a class="selected" href="http://ios.emmoco.com/">iOS Docs</a> <a href="http://support.emmoco.com/">Support</a> </p> </div> <!-- end utility bar --> <header id="top_header"> <div id="library" class="hideInXcode"> <h1><a id="libraryTitle" href="../index.html">iOS Framework </a></h1> <a id="developerHome" href="../index.html">Emmoco, Inc.</a> </div> <div id="title" role="banner"> <h1 class="hideInXcode">EMConnectionManager Class Reference</h1> </div> <ul id="headerButtons" role="toolbar"> <li id="toc_button"> <button aria-label="Show Table of Contents" role="checkbox" class="open" id="table_of_contents"><span class="disclosure"></span>Table of Contents</button> </li> <li id="jumpto_button" role="navigation"> <select id="jumpTo"> <option value="top">Jump To…</option> <option value="overview">Overview</option> <option value="tasks">Tasks</option> <option value="properties">Properties</option> <option value="//api/name/backgroundUpdatesEnabled"> backgroundUpdatesEnabled</option> <option value="class_methods">Class Methods</option> <option value="//api/name/sharedManager"> + sharedManager</option> <option value="instance_methods">Instance Methods</option> <option value="//api/name/addSchemaSearchForFilesInDirectory:"> - addSchemaSearchForFilesInDirectory:</option> <option value="//api/name/connectDevice:onSuccess:onFail:"> - connectDevice:onSuccess:onFail:</option> <option value="//api/name/connectDevice:timeoutInterval:onSuccess:onFail:"> - connectDevice:timeoutInterval:onSuccess:onFail:</option> <option value="//api/name/connectedDevice"> - connectedDevice</option> <option value="//api/name/disconnectWithSuccess:onFail:"> - disconnectWithSuccess:onFail:</option> <option value="//api/name/embeddedSystemProtocolLevel"> - embeddedSystemProtocolLevel</option> <option value="//api/name/forceConnectionWithDefaultSchema:"> - forceConnectionWithDefaultSchema:</option> <option value="//api/name/readResource:onSuccess:onFail:"> - readResource:onSuccess:onFail:</option> <option value="//api/name/removeSchemaSearchForFilesInDirectory:"> - removeSchemaSearchForFilesInDirectory:</option> <option value="//api/name/schemaFileNameForHashString:"> - schemaFileNameForHashString:</option> <option value="//api/name/schemaForConnectedDevice"> - schemaForConnectedDevice</option> <option value="//api/name/schemaHashForConnectedDevice"> - schemaHashForConnectedDevice</option> <option value="//api/name/updateInternalSchemaCache"> - updateInternalSchemaCache</option> <option value="//api/name/writeValue:toResource:onSuccess:onFail:"> - writeValue:toResource:onSuccess:onFail:</option> </select> </li> </ul> </header> <nav id="tocContainer" class="isShowingTOC"> <ul id="toc" role="tree"> <li role="treeitem"><span class="nodisclosure"></span><span class="sectionName"><a href="#overview">Overview</a></span></li> <li role="treeitem" id="task_treeitem"><span class="nodisclosure"></span><span class="sectionName"><a href="#tasks">Tasks</a></span><ul> </ul></li> <li role="treeitem" class="children"><span class="disclosure"></span><span class="sectionName"><a href="#properties">Properties</a></span><ul> <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/backgroundUpdatesEnabled">backgroundUpdatesEnabled</a></span></li> </ul></li> <li role="treeitem" class="children"><span class="disclosure"></span><span class="sectionName"><a href="#class_methods">Class Methods</a></span><ul> <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/sharedManager">sharedManager</a></span></li> </ul></li> <li role="treeitem" class="children"><span class="disclosure"></span><span class="sectionName"><a href="#instance_methods">Instance Methods</a></span><ul> <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/addSchemaSearchForFilesInDirectory:">addSchemaSearchForFilesInDirectory:</a></span></li> <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/connectDevice:onSuccess:onFail:">connectDevice:onSuccess:onFail:</a></span></li> <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/connectDevice:timeoutInterval:onSuccess:onFail:">connectDevice:timeoutInterval:onSuccess:onFail:</a></span></li> <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/connectedDevice">connectedDevice</a></span></li> <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/disconnectWithSuccess:onFail:">disconnectWithSuccess:onFail:</a></span></li> <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/embeddedSystemProtocolLevel">embeddedSystemProtocolLevel</a></span></li> <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/forceConnectionWithDefaultSchema:">forceConnectionWithDefaultSchema:</a></span></li> <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/readResource:onSuccess:onFail:">readResource:onSuccess:onFail:</a></span></li> <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/removeSchemaSearchForFilesInDirectory:">removeSchemaSearchForFilesInDirectory:</a></span></li> <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/schemaFileNameForHashString:">schemaFileNameForHashString:</a></span></li> <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/schemaForConnectedDevice">schemaForConnectedDevice</a></span></li> <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/schemaHashForConnectedDevice">schemaHashForConnectedDevice</a></span></li> <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/updateInternalSchemaCache">updateInternalSchemaCache</a></span></li> <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/writeValue:toResource:onSuccess:onFail:">writeValue:toResource:onSuccess:onFail:</a></span></li> </ul></li> </ul> </nav> <article> <div id="contents" class="isShowingTOC" role="main"> <a title="EMConnectionManager Class Reference" name="top"></a> <div class="main-navigation navigation-top"> <ul> <li><a href="../index.html">Index</a></li> <li><a href="../hierarchy.html">Hierarchy</a></li> </ul> </div> <div id="header"> <div class="section-header"> <h1 class="title title-header">EMConnectionManager Class Reference</h1> </div> </div> <div id="container"> <div class="section section-specification"><table cellspacing="0"><tbody> <tr> <td class="specification-title">Inherits from</td> <td class="specification-value">NSObject</td> </tr><tr> <td class="specification-title">Conforms to</td> <td class="specification-value"><a href="../Protocols/EMConnectionDelegate.html">EMConnectionDelegate</a></td> </tr><tr> <td class="specification-title">Declared in</td> <td class="specification-value">EMConnectionManager.h<br />EMConnectionManager.m</td> </tr> </tbody></table></div> <div class="section section-overview"> <a title="Overview" name="overview"></a> <h2 class="subtitle subtitle-overview">Overview</h2> <p>EMConnectionManager is a singleton class for managing a connection with a physical or mock device.</p> </div> <div class="section section-tasks"> <a title="Tasks" name="tasks"></a> <h2 class="subtitle subtitle-tasks">Tasks</h2> <ul class="task-list"> <li> <span class="tooltip"> <code><a href="#//api/name/backgroundUpdatesEnabled"> backgroundUpdatesEnabled</a></code> <span class="tooltip"><p>@property backgroundUpdatesEnabled @description If you set this flag to “YES”, the connection manager has the ability to persist while running in the background. By default, the connection manager severs connections when entering the background.</p></span> </span> <span class="task-item-suffix">property</span> </li><li> <span class="tooltip"> <code><a href="#//api/name/sharedManager">+ sharedManager</a></code> <span class="tooltip"><p>Use the +sharedManager class method to access the application-wide singleton instance of EMConnectionManager. Note: Accessing the connection manager in any way other is not recommended.</p></span> </span> </li><li> <span class="tooltip"> <code><a href="#//api/name/connectDevice:onSuccess:onFail:">– connectDevice:onSuccess:onFail:</a></code> <span class="tooltip"><p>Tells the connection manager to connect to a specific device.</p></span> </span> </li><li> <span class="tooltip"> <code><a href="#//api/name/connectDevice:timeoutInterval:onSuccess:onFail:">– connectDevice:timeoutInterval:onSuccess:onFail:</a></code> <span class="tooltip"><p>Tells the connection manager to connect to a specific device.</p></span> </span> </li><li> <span class="tooltip"> <code><a href="#//api/name/disconnectWithSuccess:onFail:">– disconnectWithSuccess:onFail:</a></code> <span class="tooltip"><p>Tells the connection manager to disconnect from a specific device</p></span> </span> </li><li> <span class="tooltip"> <code><a href="#//api/name/readResource:onSuccess:onFail:">– readResource:onSuccess:onFail:</a></code> <span class="tooltip"><p>Reads a resource from a connected device</p></span> </span> </li><li> <span class="tooltip"> <code><a href="#//api/name/writeValue:toResource:onSuccess:onFail:">– writeValue:toResource:onSuccess:onFail:</a></code> <span class="tooltip"><p>Writes a value to a resource on a connected device</p></span> </span> </li><li> <span class="tooltip"> <code><a href="#//api/name/connectedDevice">– connectedDevice</a></code> <span class="tooltip"><p>Returns an array of EMDeviceBasicDescription’s for the device that is actively connected</p></span> </span> </li><li> <span class="tooltip"> <code><a href="#//api/name/schemaHashForConnectedDevice">– schemaHashForConnectedDevice</a></code> <span class="tooltip"><p>Returns a version of the the schema hash from a connected device’s firmware as it appears on em-hub</p></span> </span> </li><li> <span class="tooltip"> <code><a href="#//api/name/addSchemaSearchForFilesInDirectory:">– addSchemaSearchForFilesInDirectory:</a></code> <span class="tooltip"><p>Tells the connection manager where it should look for schemas other than the NSBundle’s mainBundle</p></span> </span> </li><li> <span class="tooltip"> <code><a href="#//api/name/removeSchemaSearchForFilesInDirectory:">– removeSchemaSearchForFilesInDirectory:</a></code> <span class="tooltip"><p>Tells the connection manager to no longer look in the specified path for schemas</p></span> </span> </li><li> <span class="tooltip"> <code><a href="#//api/name/forceConnectionWithDefaultSchema:">– forceConnectionWithDefaultSchema:</a></code> <span class="tooltip"><p>Forces the connection manager to connect to a device with the default schema</p></span> </span> </li><li> <span class="tooltip"> <code><a href="#//api/name/updateInternalSchemaCache">– updateInternalSchemaCache</a></code> <span class="tooltip"><p>Tells EMConnectionManager to update its internal cache of schemas used for connection. @description EMConnectionManager uses this method internally. It is very rare taht you will need to call this method directly.</p></span> </span> </li><li> <span class="tooltip"> <code><a href="#//api/name/schemaFileNameForHashString:">– schemaFileNameForHashString:</a></code> <span class="tooltip"><p>Gives the schema name in the application bundle for a given hash string</p></span> </span> </li><li> <span class="tooltip"> <code><a href="#//api/name/schemaForConnectedDevice">– schemaForConnectedDevice</a></code> <span class="tooltip"><p>Gets the schema for the connected device. @description Returns nil if no device is connected.</p></span> </span> </li><li> <span class="tooltip"> <code><a href="#//api/name/embeddedSystemProtocolLevel">– embeddedSystemProtocolLevel</a></code> <span class="tooltip"><p>Gets the embedded system protocol level from the schema used to connect to the device @description This call does not send a message down to the board - the protocol level is pulled directly from the schema that was used to connect to the device.</p></span> </span> </li> </ul> </div> <div class="section section-methods"> <a title="Properties" name="properties"></a> <h2 class="subtitle subtitle-methods">Properties</h2> <div class="section-method"> <a name="//api/name/backgroundUpdatesEnabled" title="backgroundUpdatesEnabled"></a> <h3 class="subsubtitle method-title">backgroundUpdatesEnabled</h3> <div class="method-subsection brief-description"> <p>@property backgroundUpdatesEnabled @description If you set this flag to “YES”, the connection manager has the ability to persist while running in the background. By default, the connection manager severs connections when entering the background.</p> </div> <div class="method-subsection method-declaration"><code>@property (nonatomic) BOOL backgroundUpdatesEnabled</code></div> <div class="method-subsection discussion-section"> <h4 class="method-subtitle">Discussion</h4> <p>@property backgroundUpdatesEnabled @description If you set this flag to “YES”, the connection manager has the ability to persist while running in the background. By default, the connection manager severs connections when entering the background.</p> </div> <div class="method-subsection declared-in-section"> <h4 class="method-subtitle">Declared In</h4> <code class="declared-in-ref">EMConnectionManager.h</code><br /> </div> </div> </div> <div class="section section-methods"> <a title="Class Methods" name="class_methods"></a> <h2 class="subtitle subtitle-methods">Class Methods</h2> <div class="section-method"> <a name="//api/name/sharedManager" title="sharedManager"></a> <h3 class="subsubtitle method-title">sharedManager</h3> <div class="method-subsection brief-description"> <p>Use the +sharedManager class method to access the application-wide singleton instance of EMConnectionManager. Note: Accessing the connection manager in any way other is not recommended.</p> </div> <div class="method-subsection method-declaration"><code>+ (EMConnectionManager *)sharedManager</code></div> <div class="method-subsection discussion-section"> <h4 class="method-subtitle">Discussion</h4> <p>Use the +sharedManager class method to access the application-wide singleton instance of EMConnectionManager. Note: Accessing the connection manager in any way other is not recommended.</p> </div> <div class="method-subsection declared-in-section"> <h4 class="method-subtitle">Declared In</h4> <code class="declared-in-ref">EMConnectionManager.h</code><br /> </div> </div> </div> <div class="section section-methods"> <a title="Instance Methods" name="instance_methods"></a> <h2 class="subtitle subtitle-methods">Instance Methods</h2> <div class="section-method"> <a name="//api/name/addSchemaSearchForFilesInDirectory:" title="addSchemaSearchForFilesInDirectory:"></a> <h3 class="subsubtitle method-title">addSchemaSearchForFilesInDirectory:</h3> <div class="method-subsection brief-description"> <p>Tells the connection manager where it should look for schemas other than the NSBundle’s mainBundle</p> </div> <div class="method-subsection method-declaration"><code>- (void)addSchemaSearchForFilesInDirectory:(NSString *)<em>path</em></code></div> <div class="method-subsection arguments-section parameters"> <h4 class="method-subtitle parameter-title">Parameters</h4> <dl class="argument-def parameter-def"> <dt><em>path</em></dt> <dd><p>The path for the directory in which to search</p></dd> </dl> </div> <div class="method-subsection discussion-section"> <h4 class="method-subtitle">Discussion</h4> <p>Tells the connection manager where it should look for schemas other than the NSBundle’s mainBundle</p> </div> <div class="method-subsection declared-in-section"> <h4 class="method-subtitle">Declared In</h4> <code class="declared-in-ref">EMConnectionManager.h</code><br /> </div> </div> <div class="section-method"> <a name="//api/name/connectDevice:onSuccess:onFail:" title="connectDevice:onSuccess:onFail:"></a> <h3 class="subsubtitle method-title">connectDevice:onSuccess:onFail:</h3> <div class="method-subsection brief-description"> <p>Tells the connection manager to connect to a specific device.</p> </div> <div class="method-subsection method-declaration"><code>- (void)connectDevice:(EMDeviceBasicDescription *)<em>device</em> onSuccess:(void ( ^ ) ( void ))<em>successBlock</em> onFail:(void ( ^ ) ( NSError *error ))<em>failBlock</em></code></div> <div class="method-subsection arguments-section parameters"> <h4 class="method-subtitle parameter-title">Parameters</h4> <dl class="argument-def parameter-def"> <dt><em>device</em></dt> <dd><p>An instance of <a href="../Classes/EMDeviceBasicDescription.html">EMDeviceBasicDescription</a> the connection manager should connect to</p></dd> </dl> <dl class="argument-def parameter-def"> <dt><em>successBlock</em></dt> <dd><p>The block to run after a successful connection</p></dd> </dl> <dl class="argument-def parameter-def"> <dt><em>failBlock</em></dt> <dd><p>The block to run if the connectino fails @description The implementation of this method calls <a href="#//api/name/connectDevice:timeoutInterval:onSuccess:onFail:">connectDevice:timeoutInterval:onSuccess:onFail:</a> with a default time interval of 10 seconds</p></dd> </dl> </div> <div class="method-subsection discussion-section"> <h4 class="method-subtitle">Discussion</h4> <p>Tells the connection manager to connect to a specific device.</p> </div> <div class="method-subsection declared-in-section"> <h4 class="method-subtitle">Declared In</h4> <code class="declared-in-ref">EMConnectionManager.h</code><br /> </div> </div> <div class="section-method"> <a name="//api/name/connectDevice:timeoutInterval:onSuccess:onFail:" title="connectDevice:timeoutInterval:onSuccess:onFail:"></a> <h3 class="subsubtitle method-title">connectDevice:timeoutInterval:onSuccess:onFail:</h3> <div class="method-subsection brief-description"> <p>Tells the connection manager to connect to a specific device.</p> </div> <div class="method-subsection method-declaration"><code>- (void)connectDevice:(EMDeviceBasicDescription *)<em>device</em> timeoutInterval:(NSTimeInterval)<em>timeout</em> onSuccess:(void ( ^ ) ( void ))<em>successBlock</em> onFail:(void ( ^ ) ( NSError *error ))<em>failBlock</em></code></div> <div class="method-subsection arguments-section parameters"> <h4 class="method-subtitle parameter-title">Parameters</h4> <dl class="argument-def parameter-def"> <dt><em>device</em></dt> <dd><p>An instance of <a href="../Classes/EMDeviceBasicDescription.html">EMDeviceBasicDescription</a> the connection manager should connect to</p></dd> </dl> <dl class="argument-def parameter-def"> <dt><em>timeout</em></dt> <dd><p>The time the connection manager should allow for a successful connection. After the specified time interval passes, the fail block will be called.</p></dd> </dl> <dl class="argument-def parameter-def"> <dt><em>successBlock</em></dt> <dd><p>The block to run after a successful connection</p></dd> </dl> <dl class="argument-def parameter-def"> <dt><em>failBlock</em></dt> <dd><p>The block to run if the connection fails @description The implementation of this method calls connectDevice:timeoutInterval:onSuccess:onFail: with a default time interval of 10 seconds</p></dd> </dl> </div> <div class="method-subsection discussion-section"> <h4 class="method-subtitle">Discussion</h4> <p>Tells the connection manager to connect to a specific device.</p> </div> <div class="method-subsection declared-in-section"> <h4 class="method-subtitle">Declared In</h4> <code class="declared-in-ref">EMConnectionManager.h</code><br /> </div> </div> <div class="section-method"> <a name="//api/name/connectedDevice" title="connectedDevice"></a> <h3 class="subsubtitle method-title">connectedDevice</h3> <div class="method-subsection brief-description"> <p>Returns an array of EMDeviceBasicDescription’s for the device that is actively connected</p> </div> <div class="method-subsection method-declaration"><code>- (EMDeviceBasicDescription *)connectedDevice</code></div> <div class="method-subsection discussion-section"> <h4 class="method-subtitle">Discussion</h4> <p>Returns an array of EMDeviceBasicDescription’s for the device that is actively connected</p> </div> <div class="method-subsection declared-in-section"> <h4 class="method-subtitle">Declared In</h4> <code class="declared-in-ref">EMConnectionManager.h</code><br /> </div> </div> <div class="section-method"> <a name="//api/name/disconnectWithSuccess:onFail:" title="disconnectWithSuccess:onFail:"></a> <h3 class="subsubtitle method-title">disconnectWithSuccess:onFail:</h3> <div class="method-subsection brief-description"> <p>Tells the connection manager to disconnect from a specific device</p> </div> <div class="method-subsection method-declaration"><code>- (void)disconnectWithSuccess:(void ( ^ ) ( void ))<em>successBlock</em> onFail:(void ( ^ ) ( NSError *error ))<em>failBlock</em></code></div> <div class="method-subsection arguments-section parameters"> <h4 class="method-subtitle parameter-title">Parameters</h4> <dl class="argument-def parameter-def"> <dt><em>successBlock</em></dt> <dd><p>The block to run after a successful disconnection</p></dd> </dl> <dl class="argument-def parameter-def"> <dt><em>failBlock</em></dt> <dd><p>The block to run if the disconnection fails.</p></dd> </dl> </div> <div class="method-subsection discussion-section"> <h4 class="method-subtitle">Discussion</h4> <p>Tells the connection manager to disconnect from a specific device</p> </div> <div class="method-subsection declared-in-section"> <h4 class="method-subtitle">Declared In</h4> <code class="declared-in-ref">EMConnectionManager.h</code><br /> </div> </div> <div class="section-method"> <a name="//api/name/embeddedSystemProtocolLevel" title="embeddedSystemProtocolLevel"></a> <h3 class="subsubtitle method-title">embeddedSystemProtocolLevel</h3> <div class="method-subsection brief-description"> <p>Gets the embedded system protocol level from the schema used to connect to the device @description This call does not send a message down to the board - the protocol level is pulled directly from the schema that was used to connect to the device.</p> </div> <div class="method-subsection method-declaration"><code>- (NSNumber *)embeddedSystemProtocolLevel</code></div> <div class="method-subsection discussion-section"> <h4 class="method-subtitle">Discussion</h4> <p>Gets the embedded system protocol level from the schema used to connect to the device @description This call does not send a message down to the board - the protocol level is pulled directly from the schema that was used to connect to the device.</p> </div> <div class="method-subsection declared-in-section"> <h4 class="method-subtitle">Declared In</h4> <code class="declared-in-ref">EMConnectionManager.h</code><br /> </div> </div> <div class="section-method"> <a name="//api/name/forceConnectionWithDefaultSchema:" title="forceConnectionWithDefaultSchema:"></a> <h3 class="subsubtitle method-title">forceConnectionWithDefaultSchema:</h3> <div class="method-subsection brief-description"> <p>Forces the connection manager to connect to a device with the default schema</p> </div> <div class="method-subsection method-declaration"><code>- (void)forceConnectionWithDefaultSchema:(EMDeviceBasicDescription *)<em>device</em></code></div> <div class="method-subsection arguments-section parameters"> <h4 class="method-subtitle parameter-title">Parameters</h4> <dl class="argument-def parameter-def"> <dt><em>device</em></dt> <dd><p>The device for the forced connection @description Use this method with extreme caution. Many undefined behaviors can come from using this method with a schema that isn’t an exact match for the specified device. EMConnectionManager uses this method internally. It is very rare that you will need to call this method directly.</p></dd> </dl> </div> <div class="method-subsection discussion-section"> <h4 class="method-subtitle">Discussion</h4> <p>Forces the connection manager to connect to a device with the default schema</p> </div> <div class="method-subsection declared-in-section"> <h4 class="method-subtitle">Declared In</h4> <code class="declared-in-ref">EMConnectionManager.h</code><br /> </div> </div> <div class="section-method"> <a name="//api/name/readResource:onSuccess:onFail:" title="readResource:onSuccess:onFail:"></a> <h3 class="subsubtitle method-title">readResource:onSuccess:onFail:</h3> <div class="method-subsection brief-description"> <p>Reads a resource from a connected device</p> </div> <div class="method-subsection method-declaration"><code>- (void)readResource:(NSString *)<em>resourceName</em> onSuccess:(void ( ^ ) ( id readValue ))<em>successBlock</em> onFail:(void ( ^ ) ( NSError *error ))<em>failBlock</em></code></div> <div class="method-subsection arguments-section parameters"> <h4 class="method-subtitle parameter-title">Parameters</h4> <dl class="argument-def parameter-def"> <dt><em>resourceName</em></dt> <dd><p>The name of the resource to read. This is the name of the resource in the device’s schema.</p></dd> </dl> <dl class="argument-def parameter-def"> <dt><em>successBlock</em></dt> <dd><p>The block to call when a read occurs successfully. Connection manager will call this block with the value read.</p></dd> </dl> <dl class="argument-def parameter-def"> <dt><em>failBlock</em></dt> <dd><p>The block to call when a read fails.</p></dd> </dl> </div> <div class="method-subsection discussion-section"> <h4 class="method-subtitle">Discussion</h4> <p>Reads a resource from a connected device</p> </div> <div class="method-subsection declared-in-section"> <h4 class="method-subtitle">Declared In</h4> <code class="declared-in-ref">EMConnectionManager.h</code><br /> </div> </div> <div class="section-method"> <a name="//api/name/removeSchemaSearchForFilesInDirectory:" title="removeSchemaSearchForFilesInDirectory:"></a> <h3 class="subsubtitle method-title">removeSchemaSearchForFilesInDirectory:</h3> <div class="method-subsection brief-description"> <p>Tells the connection manager to no longer look in the specified path for schemas</p> </div> <div class="method-subsection method-declaration"><code>- (void)removeSchemaSearchForFilesInDirectory:(NSString *)<em>path</em></code></div> <div class="method-subsection arguments-section parameters"> <h4 class="method-subtitle parameter-title">Parameters</h4> <dl class="argument-def parameter-def"> <dt><em>path</em></dt> <dd><p>The path to no longer search @description Note: This method will never ignore the current bundle’s mainBundle</p></dd> </dl> </div> <div class="method-subsection discussion-section"> <h4 class="method-subtitle">Discussion</h4> <p>Tells the connection manager to no longer look in the specified path for schemas</p> </div> <div class="method-subsection declared-in-section"> <h4 class="method-subtitle">Declared In</h4> <code class="declared-in-ref">EMConnectionManager.h</code><br /> </div> </div> <div class="section-method"> <a name="//api/name/schemaFileNameForHashString:" title="schemaFileNameForHashString:"></a> <h3 class="subsubtitle method-title">schemaFileNameForHashString:</h3> <div class="method-subsection brief-description"> <p>Gives the schema name in the application bundle for a given hash string</p> </div> <div class="method-subsection method-declaration"><code>- (NSString *)schemaFileNameForHashString:(NSString *)<em>hashString</em></code></div> <div class="method-subsection arguments-section parameters"> <h4 class="method-subtitle parameter-title">Parameters</h4> <dl class="argument-def parameter-def"> <dt><em>hashString</em></dt> <dd><p>A full or partial schema hash string @description This method takes either a full hash or partial hash. If any schema begins with ‘hash string’, the file name in the bundle is returned. Returns nil if no matching schema was found in the bundle. If one or more schemas share ‘hashString’ at the beginning of their hash, the first path will be returned.</p></dd> </dl> </div> <div class="method-subsection discussion-section"> <h4 class="method-subtitle">Discussion</h4> <p>Gives the schema name in the application bundle for a given hash string</p> </div> <div class="method-subsection declared-in-section"> <h4 class="method-subtitle">Declared In</h4> <code class="declared-in-ref">EMConnectionManager.h</code><br /> </div> </div> <div class="section-method"> <a name="//api/name/schemaForConnectedDevice" title="schemaForConnectedDevice"></a> <h3 class="subsubtitle method-title">schemaForConnectedDevice</h3> <div class="method-subsection brief-description"> <p>Gets the schema for the connected device. @description Returns nil if no device is connected.</p> </div> <div class="method-subsection method-declaration"><code>- (EMSchema *)schemaForConnectedDevice</code></div> <div class="method-subsection discussion-section"> <h4 class="method-subtitle">Discussion</h4> <p>Gets the schema for the connected device. @description Returns nil if no device is connected.</p> </div> <div class="method-subsection declared-in-section"> <h4 class="method-subtitle">Declared In</h4> <code class="declared-in-ref">EMConnectionManager.h</code><br /> </div> </div> <div class="section-method"> <a name="//api/name/schemaHashForConnectedDevice" title="schemaHashForConnectedDevice"></a> <h3 class="subsubtitle method-title">schemaHashForConnectedDevice</h3> <div class="method-subsection brief-description"> <p>Returns a version of the the schema hash from a connected device’s firmware as it appears on em-hub</p> </div> <div class="method-subsection method-declaration"><code>- (NSString *)schemaHashForConnectedDevice</code></div> <div class="method-subsection discussion-section"> <h4 class="method-subtitle">Discussion</h4> <p>Returns a version of the the schema hash from a connected device’s firmware as it appears on em-hub</p> </div> <div class="method-subsection declared-in-section"> <h4 class="method-subtitle">Declared In</h4> <code class="declared-in-ref">EMConnectionManager.h</code><br /> </div> </div> <div class="section-method"> <a name="//api/name/updateInternalSchemaCache" title="updateInternalSchemaCache"></a> <h3 class="subsubtitle method-title">updateInternalSchemaCache</h3> <div class="method-subsection brief-description"> <p>Tells EMConnectionManager to update its internal cache of schemas used for connection. @description EMConnectionManager uses this method internally. It is very rare taht you will need to call this method directly.</p> </div> <div class="method-subsection method-declaration"><code>- (void)updateInternalSchemaCache</code></div> <div class="method-subsection discussion-section"> <h4 class="method-subtitle">Discussion</h4> <p>Tells EMConnectionManager to update its internal cache of schemas used for connection. @description EMConnectionManager uses this method internally. It is very rare taht you will need to call this method directly.</p> </div> <div class="method-subsection declared-in-section"> <h4 class="method-subtitle">Declared In</h4> <code class="declared-in-ref">EMConnectionManager.h</code><br /> </div> </div> <div class="section-method"> <a name="//api/name/writeValue:toResource:onSuccess:onFail:" title="writeValue:toResource:onSuccess:onFail:"></a> <h3 class="subsubtitle method-title">writeValue:toResource:onSuccess:onFail:</h3> <div class="method-subsection brief-description"> <p>Writes a value to a resource on a connected device</p> </div> <div class="method-subsection method-declaration"><code>- (void)writeValue:(id)<em>resourceValue</em> toResource:(NSString *)<em>resource</em> onSuccess:(void ( ^ ) ( void ))<em>successBlock</em> onFail:(void ( ^ ) ( NSError *error ))<em>failBlock</em></code></div> <div class="method-subsection arguments-section parameters"> <h4 class="method-subtitle parameter-title">Parameters</h4> <dl class="argument-def parameter-def"> <dt><em>resourceValue</em></dt> <dd><p>The value to write to the resource. This should be an instance of NSString, NSData, NSArray, NSNumber, or NSDictionary</p></dd> </dl> <dl class="argument-def parameter-def"> <dt><em>resource</em></dt> <dd><p>The name of the resource for writing. This is the name of the resource in the schema.</p></dd> </dl> <dl class="argument-def parameter-def"> <dt><em>successBlock</em></dt> <dd><p>The block to call when the write occurs successfully.</p></dd> </dl> <dl class="argument-def parameter-def"> <dt><em>failBlock</em></dt> <dd><p>The block to call when the write fails.</p></dd> </dl> </div> <div class="method-subsection discussion-section"> <h4 class="method-subtitle">Discussion</h4> <p>Writes a value to a resource on a connected device</p> </div> <div class="method-subsection declared-in-section"> <h4 class="method-subtitle">Declared In</h4> <code class="declared-in-ref">EMConnectionManager.h</code><br /> </div> </div> </div> </div> <div class="main-navigation navigation-bottom"> <ul> <li><a href="../index.html">Index</a></li> <li><a href="../hierarchy.html">Hierarchy</a></li> </ul> </div> <div id="footer"> <hr /> <style> #em-footer { background-color: #fff; height: 100px; font-size: 90%; overflow: hidden; } #em-footer_logo_container { position: relative; background-color: #d2d2d2; height: 70px; margin-bottom: 3px; } #em-footer_logo_container a { position: absolute; right: 7px; top: 7px; } </style> <!-- begin em-footer --> <div id="em-footer"> <div id="em-footer_logo_container"><a href="http://www.emmoco.com/"><img src="http://www.emmoco.com/images/logo_emhub_footer.png" alt="" width="85" height="57" alt="EMMOCO LOGO" /></a></div> </div> <div class="footer-copyright"> <p><span class="copyright">© 2014 Emmoco, Inc.. All rights reserved. (Last updated: 2014-02-21)</span><br /> <span class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2 (build 961)</a>.</span></p> </div> </div> </div> </article> <script type="text/javascript"> function jumpToChange() { window.location.hash = this.options[this.selectedIndex].value; } function toggleTOC() { var contents = document.getElementById('contents'); var tocContainer = document.getElementById('tocContainer'); if (this.getAttribute('class') == 'open') { this.setAttribute('class', ''); contents.setAttribute('class', ''); tocContainer.setAttribute('class', ''); window.name = "hideTOC"; } else { this.setAttribute('class', 'open'); contents.setAttribute('class', 'isShowingTOC'); tocContainer.setAttribute('class', 'isShowingTOC'); window.name = ""; } return false; } function toggleTOCEntryChildren(e) { e.stopPropagation(); var currentClass = this.getAttribute('class'); if (currentClass == 'children') { this.setAttribute('class', 'children open'); } else if (currentClass == 'children open') { this.setAttribute('class', 'children'); } return false; } function tocEntryClick(e) { e.stopPropagation(); return true; } function init() { var selectElement = document.getElementById('jumpTo'); selectElement.addEventListener('change', jumpToChange, false); var tocButton = document.getElementById('table_of_contents'); tocButton.addEventListener('click', toggleTOC, false); var taskTreeItem = document.getElementById('task_treeitem'); if (taskTreeItem.getElementsByTagName('li').length > 0) { taskTreeItem.setAttribute('class', 'children'); taskTreeItem.firstChild.setAttribute('class', 'disclosure'); } var tocList = document.getElementById('toc'); var tocEntries = tocList.getElementsByTagName('li'); for (var i = 0; i < tocEntries.length; i++) { tocEntries[i].addEventListener('click', toggleTOCEntryChildren, false); } var tocLinks = tocList.getElementsByTagName('a'); for (var i = 0; i < tocLinks.length; i++) { tocLinks[i].addEventListener('click', tocEntryClick, false); } if (window.name == "hideTOC") { toggleTOC.call(tocButton); } } window.onload = init; </script> </body> </html>