{"id":45,"date":"2016-08-25T20:30:51","date_gmt":"2016-08-25T20:30:51","guid":{"rendered":"http:\/\/r.jander.me.uk\/?p=45"},"modified":"2016-08-26T09:44:10","modified_gmt":"2016-08-26T09:44:10","slug":"update-on-my-bluetooth-ev3-mailbox-testing","status":"publish","type":"post","link":"https:\/\/r.jander.me.uk\/index.php\/2016\/08\/25\/update-on-my-bluetooth-ev3-mailbox-testing\/","title":{"rendered":"Update on my Bluetooth EV3 Mailbox testing."},"content":{"rendered":"<p>I managed to focus some more time on tidying up my AI2 app for sending Mailbox messages via Bluetooth from my Android phone to an EV3. The EV3 code is really simple and looks like this:<\/p>\n<p><a href=\"http:\/\/r.jander.me.uk\/wp-content\/uploads\/2016\/08\/Screen-Shot-2016-08-24-at-21.23.05.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-44 size-medium\" src=\"http:\/\/r.jander.me.uk\/wp-content\/uploads\/2016\/08\/Screen-Shot-2016-08-24-at-21.23.05-300x91.png\" alt=\"Screen Shot 2016-08-24 at 21.23.05\" width=\"300\" height=\"91\" srcset=\"https:\/\/r.jander.me.uk\/wp-content\/uploads\/2016\/08\/Screen-Shot-2016-08-24-at-21.23.05-300x91.png 300w, https:\/\/r.jander.me.uk\/wp-content\/uploads\/2016\/08\/Screen-Shot-2016-08-24-at-21.23.05-768x232.png 768w, https:\/\/r.jander.me.uk\/wp-content\/uploads\/2016\/08\/Screen-Shot-2016-08-24-at-21.23.05.png 1009w\" sizes=\"auto, (max-width: 300px) 85vw, 300px\" \/><\/a><\/p>\n<p>The AI2 code provides two BT related buttons, Connect &amp; Disconnect, a text box and a Go button to send the text:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-46 aligncenter\" src=\"http:\/\/r.jander.me.uk\/wp-content\/uploads\/2016\/08\/Screenshot_20160825-211129-169x300.png\" alt=\"Screenshot_20160825-211129\" width=\"169\" height=\"300\" srcset=\"https:\/\/r.jander.me.uk\/wp-content\/uploads\/2016\/08\/Screenshot_20160825-211129-169x300.png 169w, https:\/\/r.jander.me.uk\/wp-content\/uploads\/2016\/08\/Screenshot_20160825-211129-576x1024.png 576w, https:\/\/r.jander.me.uk\/wp-content\/uploads\/2016\/08\/Screenshot_20160825-211129.png 720w\" sizes=\"auto, (max-width: 169px) 85vw, 169px\" \/><\/p>\n<p>When the text is entered and Go pressed it is sent as a Mailbox message with the name &#8220;beep&#8221; to the EV3, and displayed on its screen. The code to send it has to construct a message in the form:<\/p>\n<p>MLenL, MLenH, 0x01, 0x00, 0x81, 0x9E, NLen, NameBytes, 0x00, TLenL, TLenH, TextBytes, 0x00<\/p>\n<p>Which breakdown as:<\/p>\n<ul>\n<li>MLenL, MLenH = 16 bit little endian length of the rest of the message<\/li>\n<li>0x0001 = Message counter<\/li>\n<li>0x81 = System command, no reply<\/li>\n<li>0x9E = Mailbox message<\/li>\n<li>NLen = 8 bit name length, including 0x00 termination<\/li>\n<li>NameBytes + 0x00 = The Mailbox name<\/li>\n<li>TLenL, TLenH = 16 bit little endian length of the text<\/li>\n<li>TextBytes + 0x00 = The Mailbox text<\/li>\n<\/ul>\n<p>This in terms of code looks like:<\/p>\n<p><a href=\"http:\/\/r.jander.me.uk\/wp-content\/uploads\/2016\/08\/blocks-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-49\" src=\"http:\/\/r.jander.me.uk\/wp-content\/uploads\/2016\/08\/blocks-1-224x300.png\" alt=\"blocks (1)\" width=\"224\" height=\"300\" srcset=\"https:\/\/r.jander.me.uk\/wp-content\/uploads\/2016\/08\/blocks-1-224x300.png 224w, https:\/\/r.jander.me.uk\/wp-content\/uploads\/2016\/08\/blocks-1-768x1030.png 768w, https:\/\/r.jander.me.uk\/wp-content\/uploads\/2016\/08\/blocks-1-764x1024.png 764w, https:\/\/r.jander.me.uk\/wp-content\/uploads\/2016\/08\/blocks-1-1200x1609.png 1200w, https:\/\/r.jander.me.uk\/wp-content\/uploads\/2016\/08\/blocks-1.png 1337w\" sizes=\"auto, (max-width: 224px) 85vw, 224px\" \/><\/a><\/p>\n<p>If you would like to play with the code it&#8217;s available from my resources site at:<\/p>\n<ul>\n<li><a href=\"http:\/\/www.jander.me.uk\/LEGO\/resources\/BT_Test.ev3\">BT_Test EV3 Code<\/a><\/li>\n<li><a href=\"http:\/\/www.jander.me.uk\/LEGO\/resources\/Testing_Ideas.aia\">AI2 AIA File<\/a><\/li>\n<\/ul>\n<p>The code is released under the\u00a0<a href=\"http:\/\/creativecommons.org\/licenses\/by-sa\/4.0\/\"><span class=\"s1\">Creative Commons Attribution-ShareAlike 4.0 International License<\/span><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I managed to focus some more time on tidying up my AI2 app for sending Mailbox messages via Bluetooth from my Android phone to an EV3. The EV3 code is really simple and looks like this: The AI2 code provides two BT related buttons, Connect &amp; Disconnect, a text box and a Go button to &hellip; <a href=\"https:\/\/r.jander.me.uk\/index.php\/2016\/08\/25\/update-on-my-bluetooth-ev3-mailbox-testing\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Update on my Bluetooth EV3 Mailbox testing.&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-45","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/r.jander.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/45","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/r.jander.me.uk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/r.jander.me.uk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/r.jander.me.uk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/r.jander.me.uk\/index.php\/wp-json\/wp\/v2\/comments?post=45"}],"version-history":[{"count":2,"href":"https:\/\/r.jander.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/45\/revisions"}],"predecessor-version":[{"id":50,"href":"https:\/\/r.jander.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/45\/revisions\/50"}],"wp:attachment":[{"href":"https:\/\/r.jander.me.uk\/index.php\/wp-json\/wp\/v2\/media?parent=45"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/r.jander.me.uk\/index.php\/wp-json\/wp\/v2\/categories?post=45"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/r.jander.me.uk\/index.php\/wp-json\/wp\/v2\/tags?post=45"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}