{"id":3394,"date":"2025-04-18T06:33:02","date_gmt":"2025-04-18T06:33:02","guid":{"rendered":"https:\/\/webprojects.cloud\/wordpress\/splatco\/?post_type=spl_knowledgebase&#038;p=3394"},"modified":"2025-06-10T11:06:00","modified_gmt":"2025-06-10T11:06:00","slug":"test-1-send-empty-get-receive-gmt","status":"publish","type":"spl_knowledgebase","link":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-splat-call-home-sx10509-programming\/example-splat-call-home-sandbox-program\/test-1-send-empty-get-receive-gmt\/","title":{"rendered":"Test 1: Send empty GET, receive GMT"},"content":{"rendered":"\n<p>The first test is the simplest. It uses a&nbsp;<code>DoGet<\/code>&nbsp;command to the SX10509 to make the SX10509 send a&nbsp;<code>GET<\/code>&nbsp;request to the server. The query string is empty (i.e. no query string). The server responds with an&nbsp;<a href=\"http:\/\/www.google.com\/search?q=http+status+code&amp;ie=UTF-8\">HTTP status code<\/a>&nbsp;and the GMT time. The status code is seen by the SPLat program as a response to the&nbsp;<code>DoGet<\/code>&nbsp;command to the SX10509. The GMT time is retrieved from the SX10509&#8217;s network Rx buffer using a&nbsp;<code>Read<\/code>&nbsp;command.<\/p>\n\n\n\n<p>The code checks that the status code is 200. If it is, all is well, and it reads out from the SX10509, and displays, the data returned by the server. If the code is not 200, something went wrong, and the program gives up that test. The sandbox page lets you generate a dummy 299 code, so you can test your program&#8217;s ability to detect and handle errors.<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">Send the GET<\/h6>\n\n\n\n<p>The first 6 lines of the Test1 code force the SX10509 to idle, clear its network Tx buffer (so the query string will be empty) and generate a\u00a0<code>GET<\/code>\u00a0request to the server. The server address used is the one from the server tab of the\u00a0<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-xwire-peripherals\/sx10509-ethernet-internet-splat-call-home\/sx10509-configuring-your-sch\/sx10509-server-configuration\/\">SX10509 configuration page<\/a>. After each command is sent to the SX10509, the program waits for the\u00a0<code>sSCH_GotEcho<\/code>\u00a0semaphore to get set, at which time (and not before!) it is safe to send another command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Test1:  \n        GoSub           SCH_Idle                ;Force the SCH into idle\n        WaitForST       sSCH_GotEcho            ;Wait for the command to be echoed\n        GoSub           SCH_ClearTx             ;Make sure the SX10509 Tx buffer is clear\n        WaitForST       sSCH_GotEcho            ;Wait for the command to be echoed\n        GoSub           SCH_Get                 ;Send a GET request to the server\n        WaitForST       sSCH_GotEcho            ;Wait for the command to be echoed    <\/pre>\n\n\n\n<h6 class=\"wp-block-heading\">Retrieve and check the returned status code<\/h6>\n\n\n\n<p>When the server has responded to the GET request, the status code can be found in the network Rx data block as a floating point number. The next bit of code retrieves the code and tests if it is 200 (good) or anything else (bad). If it is good it jumps to program line&nbsp;<code>Test1a<\/code>. If the code is bad, the program displays a message on the LCD and loops back to&nbsp;<code>WAFbutton<\/code>&nbsp;to wait for another button press.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">        fRecallW        abRxData                ;Get the status code -&gt; W     \n        fLoadQ          200                     ;OK code\n        fTestWeqQ                               ;OK?\n        GoIfT           Test1a                  ;g\/ good response  \n        \n        OBLCD_Cls                               ;Display the bad status code\n                        ;0123456789012345\n        OBLCD_Text      \"Error code \"    \n        OBLCD_fDispW    3,0\n        GoTo            WAFButton<\/pre>\n\n\n\n<h6 class=\"wp-block-heading\">Display the returned string<\/h6>\n\n\n\n<p>The data returned from the server is an ASCII string. It is currently sitting in the SX10509 network Rx buffer. To display it we first read it from the SX10509 to the Xwire Rx data block, then use a subroutine (one we prepared earlier) to display it.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Test1a:\n        LoadI           0                       ;Offset into SCH network Rx buffer\n        GoSub           SCH_Read                ;Read the SCH Rx buffer to the Xwire Rx data block\n        WaitForST       sSCH_GotEcho            ;Wait for the command to be echoed\n        GoSub           RxDisplay               ;Display the result\n\n        GoTo            WAFbutton<\/pre>\n\n\n\n<p>In this case we only need to read once from the SX10509 network Rx buffer, because we know it will have fewer characters for us than can fit in our Xwire Rx data block. The parameter&nbsp;<code>I = 0<\/code>&nbsp;that we send to&nbsp;<code>SCH_Read<\/code>&nbsp;causes the read to be taken from the start of the SX10509 network Rx buffer.<\/p>\n\n\n\n<p>Note: The GMT time in this example is formatted and supplied by the sandbox php code as an ASCII (human readable) text string. This is quite different to the built in Time and Date functions of the SX10509 board, which use an Internet time server and return the data to the SPLat board in a binary (non human-readable) format. The sandbox example does not use that feature of the SX10509<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The first test is the simplest. It uses a&nbsp;DoGet&nbsp;command to the SX10509 to make the SX10509 send a&nbsp;GET&nbsp;request to the server. The query string is&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":3387,"menu_order":5,"template":"","class_list":["post-3394","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>Test 1: Send empty GET, receive GMT - 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=\"Test 1: Send empty GET, receive GMT - SPLat Controls\" \/>\n<meta property=\"og:description\" content=\"The first test is the simplest. It uses a&nbsp;DoGet&nbsp;command to the SX10509 to make the SX10509 send a&nbsp;GET&nbsp;request to the server. The query string is...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-splat-call-home-sx10509-programming\/example-splat-call-home-sandbox-program\/test-1-send-empty-get-receive-gmt\/\" \/>\n<meta property=\"og:site_name\" content=\"SPLat Controls\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-10T11:06:00+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=\"3 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\/tutorials-application-notes-and-white-papers\/tutorial-splat-call-home-sx10509-programming\/example-splat-call-home-sandbox-program\/test-1-send-empty-get-receive-gmt\/\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-splat-call-home-sx10509-programming\/example-splat-call-home-sandbox-program\/test-1-send-empty-get-receive-gmt\/\",\"name\":\"Test 1: Send empty GET, receive GMT - SPLat Controls\",\"isPartOf\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website\"},\"datePublished\":\"2025-04-18T06:33:02+00:00\",\"dateModified\":\"2025-06-10T11:06:00+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-splat-call-home-sx10509-programming\/example-splat-call-home-sandbox-program\/test-1-send-empty-get-receive-gmt\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-splat-call-home-sx10509-programming\/example-splat-call-home-sandbox-program\/test-1-send-empty-get-receive-gmt\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-splat-call-home-sx10509-programming\/example-splat-call-home-sandbox-program\/test-1-send-empty-get-receive-gmt\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Tutorials, application notes and white papers\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Tutorial: SPLat Call Home (SX10509) programming\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-splat-call-home-sx10509-programming\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Example: SPLat Call Home sandbox program\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-splat-call-home-sx10509-programming\/example-splat-call-home-sandbox-program\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Test 1: Send empty GET, receive GMT\"}]},{\"@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":"Test 1: Send empty GET, receive GMT - 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":"Test 1: Send empty GET, receive GMT - SPLat Controls","og_description":"The first test is the simplest. It uses a&nbsp;DoGet&nbsp;command to the SX10509 to make the SX10509 send a&nbsp;GET&nbsp;request to the server. The query string is...","og_url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-splat-call-home-sx10509-programming\/example-splat-call-home-sandbox-program\/test-1-send-empty-get-receive-gmt\/","og_site_name":"SPLat Controls","article_modified_time":"2025-06-10T11:06:00+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-splat-call-home-sx10509-programming\/example-splat-call-home-sandbox-program\/test-1-send-empty-get-receive-gmt\/","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-splat-call-home-sx10509-programming\/example-splat-call-home-sandbox-program\/test-1-send-empty-get-receive-gmt\/","name":"Test 1: Send empty GET, receive GMT - SPLat Controls","isPartOf":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website"},"datePublished":"2025-04-18T06:33:02+00:00","dateModified":"2025-06-10T11:06:00+00:00","breadcrumb":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-splat-call-home-sx10509-programming\/example-splat-call-home-sandbox-program\/test-1-send-empty-get-receive-gmt\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-splat-call-home-sx10509-programming\/example-splat-call-home-sandbox-program\/test-1-send-empty-get-receive-gmt\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-splat-call-home-sx10509-programming\/example-splat-call-home-sandbox-program\/test-1-send-empty-get-receive-gmt\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/"},{"@type":"ListItem","position":2,"name":"Tutorials, application notes and white papers","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/"},{"@type":"ListItem","position":3,"name":"Tutorial: SPLat Call Home (SX10509) programming","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-splat-call-home-sx10509-programming\/"},{"@type":"ListItem","position":4,"name":"Example: SPLat Call Home sandbox program","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-splat-call-home-sx10509-programming\/example-splat-call-home-sandbox-program\/"},{"@type":"ListItem","position":5,"name":"Test 1: Send empty GET, receive GMT"}]},{"@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\/3394","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\/3387"}],"wp:attachment":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/media?parent=3394"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}