{"id":3775,"date":"2025-04-21T09:25:26","date_gmt":"2025-04-21T09:25:26","guid":{"rendered":"https:\/\/webprojects.cloud\/wordpress\/splatco\/?post_type=spl_knowledgebase&#038;p=3775"},"modified":"2025-06-10T05:48:13","modified_gmt":"2025-06-10T05:48:13","slug":"connecteventeveventhandler-hash-function","status":"publish","type":"spl_knowledgebase","link":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/connecteventeveventhandler-hash-function\/","title":{"rendered":"# ConnectEvent(ev:EventHandler) hash function"},"content":{"rendered":"\n<p>Valid for use with hash command:\u00a0<code><a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/\">HMI<\/a><\/code><\/p>\n\n\n\n<p>Implemented on the following platforms: HMi430, Android, Windows.<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">HMI430<\/h6>\n\n\n\n<p>The HMI430 does not have a concepts of connected or not connected. Instead the Connect event is used to signal two other status changes that are unique to the HMi430:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Pressing the screen while powering up the device, and<\/li>\n\n\n\n<li>Changes in the backlight status<\/li>\n<\/ul>\n\n\n\n<h6 class=\"wp-block-heading\">Screen press during power-up<\/h6>\n\n\n\n<p>The intention is for this to be used to force the controller into screen calibrate mode. If the screen module itself has had to be replaced, the touch function needs to be re-calibrated.<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">Change in backlight status<\/h6>\n\n\n\n<p>The Connect event gives you an opportunity to perform some external action, say turn on a room light.<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">HMI430 sample program<\/h6>\n\n\n\n<p>When the Connect event is triggered, there will be some additional bytes of data available that you can use to tell what triggered the event. The following code extracts that data and actions accordingly.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">COMHMI            EQU   251                           ;\"Port\" number for the display\nevConnected:\n   LoadX          5                                   ;does the buffer hold a..\n   aCOMRx_FindXInBuf COMHMI                           ; .. end of message (5)?\n   GoIfXeq        255,Return                          ;jump if not\n\n   aCOMRx_ReadOne COMHMI                              ;get the message id from the comms buffer\n   Push\n;Test what kind of event it was ...\n   GoIfXeq        0,_UIProcessBacklight               ;jump if message is backlight message\n   GoIfXeq        1,_UIPowerOnTouch                   ;jump if user has been touching the screen since power on\nReturn:\n   Return\n\n_UIProcessBacklight:\n   aCOMRx_ReadOne COMHMI                              ;get the separator\n   GoIfXne        2,Return                            ;abort if not separator\n   aCOMRx_ReadOne COMHMI                              ;get the backlight state. TRUE = ON\n   aCOMRx_ReadOne COMHMI                              ;get the terminator\n   GoIfXne        5,Return                            ;abort if not terminator\n....  insert your code to action backlight status change. <a href=\"https:\/\/www.splatco.com\/skb\/352.htm#o3808\">X<\/a> is TRUE if the light is on\n   Return\n\n_UIPowerOnTouch:\n   aCOMRx_ReadOne COMHMI                              ;get the endhdr\n   GoIfXne        5,Return                            ;abort if not endhdr\n   SPxCmd0        0,10                                ;go perform cal, won't return until complete\n   GoSub          UIsubScreenShowIdle                 ;redraw the idle screen\n   Return<\/pre>\n\n\n\n<h6 class=\"wp-block-heading\">Android and Windows<\/h6>\n\n\n\n<p>This function specifies an\u00a0<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/glossary-of-terms\/#o4952\">Event<\/a>\u00a0handler that is to be called when the\u00a0<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/glossary-of-terms\/#o5243\">HMI<\/a>\u00a0reports it has become connected. The typical scenario is an Android device that is not normally connected to a SPLat controller. When the Android HMI app is first launched, the user has to enable Bluetooth, make sure it is paired with the Bluetooth on the SPLat, and select the SPLat Bluetooth to connect to. All this while the HMI in the Android is displaying a default screen. Once the Bluetooth connection is successfully established, the Android HMI app sends a special code to the SPLat. The\u00a0<code>ConnectEvent<\/code>\u00a0function detects this and does a\u00a0<code>GoSub<\/code>\u00a0to your Event handler. Your event handler then draws the initial screen applicable to your SPLat application.<\/p>\n\n\n\n<p>The HMI function in SPLat\/PC has a Connect button that generates the same code to the SPLat.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Valid for use with hash command:\u00a0HMI Implemented on the following platforms: HMi430, Android, Windows. HMI430 The HMI430 does not have a concepts of connected or&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":3768,"menu_order":5,"template":"","class_list":["post-3775","spl_knowledgebase","type-spl_knowledgebase","status-publish","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title># ConnectEvent(ev:EventHandler) hash function - SPLat Controls<\/title>\n<meta name=\"robots\" content=\"noindex, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"# ConnectEvent(ev:EventHandler) hash function - SPLat Controls\" \/>\n<meta property=\"og:description\" content=\"Valid for use with hash command:\u00a0HMI Implemented on the following platforms: HMi430, Android, Windows. HMI430 The HMI430 does not have a concepts of connected or...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/connecteventeveventhandler-hash-function\/\" \/>\n<meta property=\"og:site_name\" content=\"SPLat Controls\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-10T05:48:13+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/connecteventeveventhandler-hash-function\/\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/connecteventeveventhandler-hash-function\/\",\"name\":\"# ConnectEvent(ev:EventHandler) hash function - SPLat Controls\",\"isPartOf\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website\"},\"datePublished\":\"2025-04-21T09:25:26+00:00\",\"dateModified\":\"2025-06-10T05:48:13+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/connecteventeveventhandler-hash-function\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/connecteventeveventhandler-hash-function\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/connecteventeveventhandler-hash-function\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Deprecated\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"# HMI Android &#038; Windows\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"# ConnectEvent(ev:EventHandler) hash function\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/\",\"name\":\"SPLat Controls\",\"description\":\"OEM Embedded Machine Controllers\",\"publisher\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#organization\",\"name\":\"SPLat Controls\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2024\/10\/logo.svg\",\"contentUrl\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2024\/10\/logo.svg\",\"caption\":\"SPLat Controls\"},\"image\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"# ConnectEvent(ev:EventHandler) hash function - SPLat Controls","robots":{"index":"noindex","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"og_locale":"en_US","og_type":"article","og_title":"# ConnectEvent(ev:EventHandler) hash function - SPLat Controls","og_description":"Valid for use with hash command:\u00a0HMI Implemented on the following platforms: HMi430, Android, Windows. HMI430 The HMI430 does not have a concepts of connected or...","og_url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/connecteventeveventhandler-hash-function\/","og_site_name":"SPLat Controls","article_modified_time":"2025-06-10T05:48:13+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/connecteventeveventhandler-hash-function\/","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/connecteventeveventhandler-hash-function\/","name":"# ConnectEvent(ev:EventHandler) hash function - SPLat Controls","isPartOf":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website"},"datePublished":"2025-04-21T09:25:26+00:00","dateModified":"2025-06-10T05:48:13+00:00","breadcrumb":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/connecteventeveventhandler-hash-function\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/connecteventeveventhandler-hash-function\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/connecteventeveventhandler-hash-function\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/"},{"@type":"ListItem","position":2,"name":"Deprecated","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/"},{"@type":"ListItem","position":3,"name":"# HMI Android &#038; Windows","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/"},{"@type":"ListItem","position":4,"name":"# ConnectEvent(ev:EventHandler) hash function"}]},{"@type":"WebSite","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/","name":"SPLat Controls","description":"OEM Embedded Machine Controllers","publisher":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webprojects.cloud\/wordpress\/splatco\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#organization","name":"SPLat Controls","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#\/schema\/logo\/image\/","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2024\/10\/logo.svg","contentUrl":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2024\/10\/logo.svg","caption":"SPLat Controls"},"image":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/spl_knowledgebase\/3775","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/spl_knowledgebase"}],"about":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/types\/spl_knowledgebase"}],"author":[{"embeddable":true,"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/users\/1"}],"up":[{"embeddable":true,"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/spl_knowledgebase\/3768"}],"wp:attachment":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/media?parent=3775"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}