{"id":12627,"date":"2018-09-25T13:19:18","date_gmt":"2018-09-25T04:19:18","guid":{"rendered":"https:\/\/www.appliot.co.jp\/lazurite-jp\/?p=12627"},"modified":"2018-09-25T14:07:47","modified_gmt":"2018-09-25T05:07:47","slug":"%e3%82%89%e3%81%9a%e3%82%89%e3%81%84%e3%81%a8%e5%a7%ab%e3%81%ae%e6%8c%91%e6%88%a6%e6%97%a5%e8%a8%98%e3%80%80aes%e6%9a%97%e5%8f%b7%e5%8c%96%e9%80%9a%e4%bf%a1","status":"publish","type":"post","link":"https:\/\/www.appliot.co.jp\/lazurite-jp\/lazuriteide\/12627.html","title":{"rendered":"\u3089\u305a\u3089\u3044\u3068\u59eb\u306e\u6311\u6226\u65e5\u8a18\u3000AES\u6697\u53f7\u5316\u901a\u4fe1"},"content":{"rendered":"<p>\u7121\u7dda\u3067\u901a\u4fe1\u3092\u3059\u308b\u3068\u3044\u3046\u3053\u3068\u306f\u3001\u97f3\u58f0\u3067\u4f1a\u8a71\u3057\u3066\u3044\u308b\u306e\u3068\u540c\u3058\u3088\u3046\u306b\u96fb\u6ce2\u304c\u5c4a\u304f\u7bc4\u56f2\u5185\u3067\u3042\u308c\u3070\u8ab0\u3067\u3082\u30c7\u30fc\u30bf\u3092\u53d7\u4fe1\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3066\u3057\u307e\u3046\u305d\u3046\u3067\u3059\u3002\uff19\uff12\uff10MH\uff5a\u7121\u7dda\u3067\u3042\u308c\u3070\u534a\u5f84200~300m\u304f\u3089\u3044\u3057\u304b\u5c4a\u304d\u307e\u305b\u3093\u3057\u3001\u9244\u7b4b\u30b3\u30f3\u30af\u30ea\u30fc\u30c8\u306e\u58c1\u306a\u3069\u306f\u96fb\u6ce2\u304c\u901a\u308a\u629c\u3051\u3057\u3065\u3089\u3044\u306e\u3067\u3059\u304c\u3001\u305d\u308c\u3067\u3082\u4ed6\u306e\u4eba\u306b\u30c7\u30fc\u30bf\u3092\u898b\u3089\u308c\u305f\u304f\u306a\u3044\u3001\u805e\u304b\u308c\u305f\u304f\u306a\u3044\u3068\u3044\u3046\u6642\u304c\u3042\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>\u305d\u306e\u3088\u3046\u306a\u3068\u304d\u306b\u4f7f\u7528\u3059\u308b\u306e\u304c\u901a\u4fe1\u30c7\u30fc\u30bf\u306e\u6697\u53f7\u5316\u3067\u3059\u3002<\/p>\n<p>Lazurite\u306e\u6697\u53f7\u5316\u901a\u4fe1\u3067\u306f\u3001\u9001\u4fe1\u6a5f\u3068\u53d7\u4fe1\u6a5f\u3067\u540c\u3058\u56fa\u5b9a\u9375\u3092\u8a2d\u5b9a\u3057\u3066\u304a\u304f\u3053\u3068\u3067\u6697\u53f7\u5316\u3092\u884c\u3044\u3001\u305d\u306e\u30c7\u30fc\u30bf\u304c\u306a\u3044\u3068\u30c7\u30fc\u30bf\u3092\u53d7\u4fe1\u3057\u3066\u3082\u4e2d\u8eab\u3092\u7406\u89e3\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u306a\u3044\u72b6\u614b\u306b\u3059\u308b\u3067\u304d\u307e\u3059\u3002Lazurite\u3067\u306f\u3001AES128bit\u3092\u7528\u3044\u3066\u6697\u53f7\u5316\u3092\u3057\u3066\u3044\u308b\u305d\u3046\u3067\u3059\u3002<\/p>\n<p>\u3067\u306f\u65e9\u901f\u4f7f\u7528\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<h2>Lazurite SubGHz\/920J\u5074(\u9001\u4fe1\u6a5f)\u306bAES128bit\u306e\u9375\u60c5\u5831\u3092\u8a2d\u5b9a\u3059\u308b\u3002<\/h2>\n<p>Lazurite IDE\u306e\u4e2d\u306eBIN\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u306bAES128bit\u306e\u9375\u60c5\u5831\u3092\u751f\u6210\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u3042\u308a\u307e\u3059\u3002\u300caes_keygen.bat\u300d\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u540d\u3067\u6b21\u306e\u4e00\u884c\u3092\u8a18\u8f09\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n1\u306e\u90e8\u5206\u306f\u9001\u4fe1\u6a5f\u30fb\u53d7\u4fe1\u6a5f\u3067\u9375\u3092\u751f\u6210\u3059\u308b\u305f\u3081\u306e\u30b7\u30fc\u30ba\u306b\u306a\u308a\u307e\u3059\u306e\u3067\u3001\u9069\u5f53\u306a\u6570\u5b57\u306b\u5909\u66f4\u3057\u3066\u304f\u3060\u3055\u3044\u30021 \u301c 0xFFFFFFFF\u307e\u3067\u8a2d\u5b9a\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p>[bash]<br \/>\nc:\\LazuriteIDE\\bin\\aes_keygen.ext 1 &gt; aes_key.txt<br \/>\n[\/bash]<\/p>\n<p>\u4f5c\u6210\u3057\u305faes_key.txt\u306e\u5185\u5bb9\u3092\u898b\u308b\u3068\u3001\u3053\u306e\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>[c]<br \/>\nSeeds for Lazurite Pi Gateway::<br \/>\n07a45e454318b6d4a9d5449f3b342bda<br \/>\nSeeds for Lazurite SubGHz::<br \/>\nstatic const unsigned char key[] = {0x07,0xa4,0x5e,0x45,0x43,0x18,0xb6,0xd4,0xa9,0xd5,0x44,0x9f,0x3b,0x34,0x2b,0xda};<br \/>\n[\/c]<\/p>\n<p>\u4eca\u56de\u306f\u3001\u3053\u306e\u300c07a45e454318b6d4a9d5449f3b342bda\u300d\u3092\u6697\u53f7\u5316\u306e\u9375\u3068\u3057\u3066\u4f7f\u7528\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<h2>Lazurite SubGHz\/920J\u5074\u306b\u6697\u53f7\u5316\u306e\u9375\u60c5\u5831\u3092\u8a2d\u5b9a\u3059\u308b<\/h2>\n<p>Lazurite SubGHz\/920J\u5074\u306f\u3001\u9375\u60c5\u5831\u3092unsigned char\u578b\u306e\u914d\u5217\u306b\u3057\u3066\u3042\u308b\u3053\u306e\u60c5\u5831\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<p>static const unsigned char key[] = {0x07,0xa4,0x5e,0x45,0x43,0x18,0xb6,0xd4,0xa9,0xd5,0x44,0x9f,0x3b,0x34,0x2b,0xda};<\/p>\n<p>\u3053\u306e\u9375\u60c5\u5831\u3092\u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b0\u30e9\u30e0 Welcome_SubGHz.c\u306b\u8ffd\u52a0\u3057\u3066\u307f\u307e\u3059\u3002<br \/>\n\u8ffd\u52a0\u3057\u305f\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u306f\u4ee5\u4e0b\u306e\u3068\u304a\u308a\u3067\u3059\u300237\u884c\u76ee\u300143\u884c\u76ee\u304c\u8ffd\u52a0\u3057\u305f\u884c\u3067\u3059\u3002<\/p>\n<p>[c]<br \/>\n#include &quot;Welcome_SubGHz_ide.h&quot; \/\/ Additional Header<\/p>\n<p>\/* FILE NAME: Welcome_SubGHz.c<br \/>\n * The MIT License (MIT)<br \/>\n *<br \/>\n * Copyright (c) 2015 Lapis Semiconductor Co.,Ltd.<br \/>\n * All rights reserved.<br \/>\n *<br \/>\n * Permission is hereby granted, free of charge, to any person obtaining a copy<br \/>\n * of this software and associated documentation files (the &quot;Software&quot;), to deal<br \/>\n * in the Software without restriction, including without limitation the rights<br \/>\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell<br \/>\n * copies of the Software, and to permit persons to whom the Software is<br \/>\n * furnished to do so, subject to the following conditions:<br \/>\n *<br \/>\n * The above copyright notice and this permission notice shall be included in<br \/>\n * all copies or substantial portions of the Software.<br \/>\n *<br \/>\n * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br \/>\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br \/>\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE<br \/>\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER<br \/>\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,<br \/>\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN<br \/>\n * THE SOFTWARE.<br \/>\n*\/<\/p>\n<p>#define LED 26 \/\/ pin number of Blue LED<br \/>\n#define SUBGHZ_CH 36 \/\/ channel number (frequency)<br \/>\n#define SUBGHZ_PANID 0xabcd \/\/ panid<br \/>\n#define HOST_ADDRESS 0x8e6d \/\/ distination address<\/p>\n<p>unsigned char send_data[] = {&quot;Welcome to Lazurite Sub-GHz\\r\\n&quot;};<\/p>\n<p>\/\/\u4ee5\u4e0b\u306e\u4e00\u884c\u3092\u8ffd\u52a0<br \/>\nstatic const unsigned char key[] = {0x07,0xa4,0x5e,0x45,0x43,0x18,0xb6,0xd4,0xa9,0xd5,0x44,0x9f,0x3b,0x34,0x2b,0xda};<\/p>\n<p>void setup(void)<br \/>\n{<\/p>\n<p> SubGHz.init(); \/\/ initializing Sub-GHz<br \/>\n\/\/ \u4ee5\u4e0b\u306e\u4e00\u884c\u3092\u8ffd\u52a0<br \/>\n SubGHz.setKey(key);<br \/>\n Serial.begin(115200);<br \/>\n pinMode(LED,OUTPUT); \/\/ setting of LED<br \/>\n digitalWrite(LED,HIGH); \/\/ setting of LED<br \/>\n}<\/p>\n<p>void loop(void)<br \/>\n{<br \/>\n SUBGHZ_MSG msg;<br \/>\n \/\/ Initializing<br \/>\n SubGHz.begin(SUBGHZ_CH, SUBGHZ_PANID, SUBGHZ_100KBPS, SUBGHZ_PWR_20MW); \/\/ start Sub-GHz<\/p>\n<p> \/\/ preparing data<br \/>\n digitalWrite(LED,LOW); \/\/ LED ON<br \/>\n msg=SubGHz.send(SUBGHZ_PANID, HOST_ADDRESS, &amp;amp;amp;send_data, sizeof(send_data),NULL);\/\/ send data<br \/>\n digitalWrite(LED,HIGH); \/\/ LED off<br \/>\n SubGHz.msgOut(msg);<\/p>\n<p> \/\/ close<br \/>\n SubGHz.close(); \/\/ Sub-GHz module sets into power down mode.<\/p>\n<p> sleep(1000); \/\/ sleep<\/p>\n<p> return;<br \/>\n}<\/p>\n<p>[\/c]<\/p>\n<h2>Raspberry Pi\u5074\u3067\u9375\u60c5\u5831\u3092\u751f\u6210\u3059\u308b<\/h2>\n<p>Raspberry Pi\u5074\u306f\u3001\u6b21\u306e\u3068\u3053\u308d\u306b\u9375\u60c5\u5831\u3092\u751f\u6210\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u304c\u4fdd\u5b58\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u30d3\u30eb\u30c9\u3057\u3066\u5b9f\u884c\u53ef\u80fd\u306a\u30d5\u30a1\u30a4\u30eb\u3092\u751f\u6210\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u305d\u3057\u3066\u3001\u540c\u3058\u304f\u300c1\u300d\u3092\u9375\u60c5\u5831\u306e\u30b7\u30fc\u30ba\u3068\u3057\u3066AES\u306e\u9375\u60c5\u5831\u3092\u751f\u6210\u3057\u307e\u3059\u3002<\/p>\n<p>[bash]<br \/>\ncd ~\/driver\/LazDriver\/aes_keygen\/<br \/>\nmake<br \/>\n.\/aes_keygen 1 &gt; aes_key.txt<br \/>\n[\/bash]<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>~\/driver\/LazDriver\/aes_keygen\/aes_key.txt\u306b\u3001\u540c\u3058\u9375\u60c5\u5831\u304c\u8a18\u9332\u3055\u308c\u3066\u3044\u308b\u306f\u305a\u3067\u3059\u3002<\/p>\n<h2>Ruby\u3067\u53d7\u4fe1\u3059\u308b<\/h2>\n<p>ruby\u306e\u53d7\u4fe1\u7528\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n<p>[bash]<br \/>\ncd ~\/driver\/LazGem\/sample<br \/>\n.\/sample_rx.rb 36<br \/>\n[\/bash]<\/p>\n<p>\u305d\u3046\u3059\u308b\u3068\u3001\u6b21\u306e\u3088\u3046\u306bpayload\u306e\u90e8\u5206\u304c\u3088\u304f\u308f\u304b\u3089\u306a\u3044\u60c5\u5831\u306b\u306a\u3063\u3066\u3044\u308b\u306e\u304c\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>{&#8220;header&#8221;=&gt;43049, &#8220;dst_addr_type&#8221;=&gt;2, &#8220;frame_ver&#8221;=&gt;2, &#8220;src_addr_type&#8221;=&gt;2, &#8220;ielist&#8221;=&gt;0, &#8220;seq_comp&#8221;=&gt;0, &#8220;panid_comp&#8221;=&gt;0, &#8220;ack_req&#8221;=&gt;1, &#8220;pending&#8221;=&gt;0, &#8220;sec_enb&#8221;=&gt;1, &#8220;frame_type&#8221;=&gt;1, &#8220;addr_type&#8221;=&gt;6, &#8220;dst_panid&#8221;=&gt;43981, &#8220;src_panid&#8221;=&gt;nil, &#8220;dst_addr&#8221;=&gt;36461, &#8220;src_addr&#8221;=&gt;17706, &#8220;seq_num&#8221;=&gt;60, <span style=\"color: #ff0000;\">&#8220;payload&#8221;=&gt;&#8221;\\xF0\\xE7\\x95\\x9FT\\x9A\\xA8\\xBA\\x90Z\\x7F\\xFE\\x94\\xCB\\b\\x8C\\xEF)nD\\x8B7\\x19\\x809\\xC0,*\\x01l\\xCDg&#8221;<\/span>, &#8220;sec&#8221;=&gt;1537843237, &#8220;nsec&#8221;=&gt;349094568, &#8220;rssi&#8221;=&gt;224}<\/p>\n<p>ruby\u306e\u30b5\u30f3\u30d7\u30eb\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306b\u3001AES\u306e\u9375\u60c5\u5831\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002~\/driver\/LazGem\/sample_rx.rb\u306e48\u884c\u76ee\u4ed8\u8fd1\u306bLaz.setKey(&#8220;xxxxxx&#8221;)\u306e\u4e00\u884c\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<p>[ruby]<br \/>\n#! \/usr\/bin\/ruby<br \/>\n# -*- coding: utf-8; mode: ruby -*-<br \/>\n# Function:<br \/>\n# Lazurite Sub-GHz\/Lazurite Pi Gateway Sample program<br \/>\n# SerialMonitor.rb<br \/>\nrequire &#8216;LazGem&#8217;<\/p>\n<p>laz = LazGem::Device.new<\/p>\n<p># Halt process when CTRL+C is pushed.<br \/>\nfinish_flag=0<br \/>\nSignal.trap(:INT){<br \/>\n finish_flag=1<br \/>\n}<\/p>\n<p>if ARGV.size == 0<br \/>\n printf(&quot;please input argument of ch at least\\n&quot;)<br \/>\n printf(&quot;command format is shown below&#8230;\\n&quot;)<br \/>\n printf(&quot;.\/sample_rx.rb ch panid baud pwr\\n&quot;)<br \/>\n printf(&quot; ch: 24-61\\n&quot;)<br \/>\n printf(&quot; panid: 0-0xffff\\n&quot;)<br \/>\n printf(&quot; baud: 50 or 100\\n&quot;)<br \/>\n printf(&quot; pwr: 1 or 20\\n&quot;)<br \/>\n exit 0<br \/>\nend<\/p>\n<p># open device deriver<\/p>\n<p>dst_addr = 0xffff<br \/>\nch = 36<br \/>\npanid = 0xabcd<br \/>\nbaud = 100<br \/>\npwr = 20<\/p>\n<p>if ARGV.size &gt; 0<br \/>\n ch=Integer(ARGV[0])<br \/>\nend<br \/>\nif ARGV.size &gt; 1<br \/>\n panid = Integer(ARGV[1])<br \/>\nend<br \/>\nif ARGV.size &gt; 2<br \/>\n baud = Integer(ARGV[2])<br \/>\nend<br \/>\nif ARGV.size &gt; 3<br \/>\n pwr = Integer(ARGV[3])<br \/>\nend<\/p>\n<p>laz.init()<br \/>\nlaz.setKey(&quot;07a45e454318b6d4a9d5449f3b342bda&quot;)<\/p>\n<p>print(sprintf(&quot;myAddress=0x%016x\\n&quot;,laz.getMyAddr64()))<br \/>\nprint(sprintf(&quot;myAddress=0x%04x\\n&quot;,laz.getMyAddress()))<\/p>\n<p>laz.begin(ch,panid,baud,pwr)<br \/>\nlaz.rxEnable()<\/p>\n<p># printing header of receiving log<br \/>\nprint(sprintf(&quot;time\\t\\t\\t\\t\\t[ns]\\trxPanid\\trxAddr\\ttxAddr\\trssi\\tpayload\\n&quot;))<br \/>\nprint(sprintf(&quot;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;\\n&quot;))<\/p>\n<p># main routine<br \/>\nwhile finish_flag == 0 do<br \/>\n if laz.available() &lt;= 0<br \/>\n sleep 0.01<br \/>\n next<br \/>\n end<br \/>\n rcv = laz.read()<br \/>\n # printing data<br \/>\n p rcv<br \/>\nend<\/p>\n<p># finishing process<br \/>\nlaz.remove()<br \/>\n[\/ruby]<\/p>\n<p>\u305d\u3057\u3066\u3001\u3082\u3046\u4e00\u5ea6 sample_rx.rb\u3092\u8d77\u52d5\u3057\u3066\u307f\u308b\u3068\u3001\u6b21\u306e\u3088\u3046\u306bpayload\u306e\u90e8\u5206\u304c\u6b63\u3057\u304f\u8aad\u3081\u308b\u30c7\u30fc\u30bf\u306b\u306a\u3063\u3066\u3044\u308b\u306e\u304c\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>{&#8220;header&#8221;=&gt;43049, &#8220;dst_addr_type&#8221;=&gt;2, &#8220;frame_ver&#8221;=&gt;2, &#8220;src_addr_type&#8221;=&gt;2, &#8220;ielist&#8221;=&gt;0, &#8220;seq_comp&#8221;=&gt;0, &#8220;panid_comp&#8221;=&gt;0, &#8220;ack_req&#8221;=&gt;1, &#8220;pending&#8221;=&gt;0, &#8220;sec_enb&#8221;=&gt;1, &#8220;frame_type&#8221;=&gt;1, &#8220;addr_type&#8221;=&gt;6, &#8220;dst_panid&#8221;=&gt;43981, &#8220;src_panid&#8221;=&gt;nil, &#8220;dst_addr&#8221;=&gt;36461, &#8220;src_addr&#8221;=&gt;17706, &#8220;seq_num&#8221;=&gt;191, &#8220;payload&#8221;=&gt;<span style=\"color: #ff0000;\">&#8220;Welcome to Lazurite Sub-GHz\\r\\n\\x00&#8221;<\/span>, &#8220;sec&#8221;=&gt;1537846994, &#8220;nsec&#8221;=&gt;13026693, &#8220;rssi&#8221;=&gt;201}<\/p>\n<p>&nbsp;<\/p>\n<h2>C\u8a00\u8a9e\u3067\u53d7\u4fe1\u3059\u308b<\/h2>\n<p>\u7d9a\u3044\u3066C\u8a00\u8a9e\u3067\u52d5\u4f5c\u3055\u305b\u3066\u307f\u307e\u3059\u3002<\/p>\n<p>[bash]<br \/>\ncd ~\/driver\/liblazurite\/sample\/<br \/>\n.\/sample_rx_raw 36<br \/>\n[\/bash]<\/p>\n<p>\u9375\u60c5\u5831\u3092\u8a2d\u5b9a\u3057\u306a\u3044\u72b6\u614b\u3067\u306f\u3053\u306e\u3088\u3046\u306b\u6587\u5b57\u5316\u3051\u3057\u3066\u3057\u307e\u3044\u307e\u3057\u305f\u3002<\/p>\n<p><a href=\"https:\/\/www.appliot.co.jp\/lazurite-jp\/lapis_admin\/wp-content\/uploads\/set_nokey.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-12632\" src=\"https:\/\/www.appliot.co.jp\/lazurite-jp\/lapis_admin\/wp-content\/uploads\/set_nokey-300x43.png\" alt=\"set_nokey\" width=\"300\" height=\"43\" srcset=\"https:\/\/www.appliot.co.jp\/lazurite-jp\/lapis_admin\/wp-content\/uploads\/set_nokey-300x43.png 300w, https:\/\/www.appliot.co.jp\/lazurite-jp\/lapis_admin\/wp-content\/uploads\/set_nokey-640x92.png 640w, https:\/\/www.appliot.co.jp\/lazurite-jp\/lapis_admin\/wp-content\/uploads\/set_nokey.png 855w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>sample_rx_raw.cpp\u306e58\u884c\u76ee\u306869\u884c\u76ee\u4ed8\u8fd1\u306b\u3001\u9375\u60c5\u5831\u3092\u8a2d\u5b9a\u3059\u308b\u884c\u306e\u8ffd\u52a0\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<p>[c]<br \/>\n\/*!<br \/>\n @file test_rx.cpp<br \/>\n @brief about test_raw &lt;br&gt;<br \/>\n sample code to read raw data that is received.<\/p>\n<p> @subsection how to use &lt;br&gt;<\/p>\n<p> paramete can be ommited.<\/p>\n<p> (ex)<br \/>\n @code<br \/>\n test_raw 36 0xabcd 100 20<br \/>\n test_raw 36 0xabcd<br \/>\n @endcode<\/p>\n<p> when push Ctrl+C, process is quited.<br \/>\n *\/<br \/>\n#include &lt;string.h&gt;<br \/>\n#include &lt;stdio.h&gt;<br \/>\n#include &lt;stdlib.h&gt;<br \/>\n#include &lt;stdint.h&gt;<br \/>\n#include &lt;signal.h&gt;<br \/>\n#include &lt;time.h&gt;<br \/>\n#include &lt;unistd.h&gt;<br \/>\n#include &quot;..\/lib\/liblazurite.h&quot; <\/p>\n<p>using namespace lazurite;<br \/>\nbool bStop;<\/p>\n<p>\/*!<br \/>\n signal handler &lt;br&gt;<br \/>\n this process is executed, when Ctrl+C is pushed.<br \/>\n *\/<br \/>\nvoid sigHandle(int sigName)<br \/>\n{<br \/>\n bStop = true;<br \/>\n printf(&quot;sigHandle = %d\\n&quot;,sigName);<br \/>\n return;<br \/>\n}<br \/>\n\/*!<br \/>\n set signal handler for Ctrl+C<br \/>\n *\/<\/p>\n<p>int setSignal(int sigName)<br \/>\n{<br \/>\n if(signal(sigName,sigHandle)==SIG_ERR) return -1;<br \/>\n return 0;<br \/>\n}<br \/>\nint main(int argc, char **argv)<br \/>\n{<br \/>\n int result;<br \/>\n char* en;<br \/>\n uint8_t ch=36;<br \/>\n uint8_t rate=100;<br \/>\n uint8_t pwr=20;<br \/>\n uint16_t panid=0xabcd;<br \/>\n uint8_t myaddr_be[8];<br \/>\n static char key[] = &quot;07a45e454318b6d4a9d5449f3b342bda&quot;;<\/p>\n<p> \/\/ set Signal Trap<br \/>\n setSignal(SIGINT);<\/p>\n<p> timespec rxTime;<\/p>\n<p> if((result=lazurite_init())!=0) {<br \/>\n printf(&quot;liblzgw_open fail = %d\\n&quot;,result);<br \/>\n return EXIT_FAILURE;<br \/>\n }<br \/>\n lazurite_setKey(key);<\/p>\n<p> bStop = false;<br \/>\n if(argc&gt;1) {<br \/>\n ch = strtol(argv[1],&amp;en,0);<br \/>\n }<br \/>\n if(argc&gt;2) {<br \/>\n panid = strtol(argv[2],&amp;en,0);<br \/>\n }<br \/>\n if(argc&gt;3) {<br \/>\n rate = strtol(argv[3],&amp;en,0);<br \/>\n }<br \/>\n if(argc&gt;4) {<br \/>\n pwr = strtol(argv[4],&amp;en,0);<br \/>\n }<\/p>\n<p> printf(&quot;short address:: %04x\\n&quot;,lazurite_getMyAddress());<br \/>\n result = lazurite_getMyAddr64(myaddr_be);<br \/>\n printf(&quot;mac address:: %02x%02x%02x%02x %02x%02x%02x%02x\\n&quot;,<br \/>\n myaddr_be[0],<br \/>\n myaddr_be[1],<br \/>\n myaddr_be[2],<br \/>\n myaddr_be[3],<br \/>\n myaddr_be[4],<br \/>\n myaddr_be[5],<br \/>\n myaddr_be[6],<br \/>\n myaddr_be[7]<br \/>\n );<\/p>\n<p> result = lazurite_begin(ch,panid,rate,pwr);<br \/>\n if(result &lt; 0) {<br \/>\n printf(&quot;lazurite_begin fail = %d\\n&quot;,result);<br \/>\n return EXIT_FAILURE;<br \/>\n }<br \/>\n result = lazurite_rxEnable();<br \/>\n if(result &lt; 0) {<br \/>\n printf(&quot;lazurite_rxEnable fail = %d\\n&quot;,result);<br \/>\n return EXIT_FAILURE;<br \/>\n }<\/p>\n<p> while(bStop == false)<br \/>\n {<br \/>\n uint16_t size;<br \/>\n uint8_t rssi;<br \/>\n SUBGHZ_MAC mac;<br \/>\n char raw[256];<br \/>\n memset(raw,0,sizeof(raw));<br \/>\n result = lazurite_read(raw,&amp;size);<br \/>\n if(result &gt; 0 ) {<br \/>\n result = lazurite_decMac(&amp;mac,raw,size);<br \/>\n printf(&quot;%02x\\t%04x\\t%02x%02x%02x%02x%02x%02x%02x%02x\\t%04x\\t%02x%02x%02x%02x%02x%02x%02x%02x\\t&quot;,<br \/>\n mac.seq_num,<br \/>\n mac.dst_panid,<br \/>\n mac.dst_addr[7],<br \/>\n mac.dst_addr[6],<br \/>\n mac.dst_addr[5],<br \/>\n mac.dst_addr[4],<br \/>\n mac.dst_addr[3],<br \/>\n mac.dst_addr[2],<br \/>\n mac.dst_addr[1],<br \/>\n mac.dst_addr[0],<br \/>\n mac.dst_panid,<br \/>\n mac.src_addr[7],<br \/>\n mac.src_addr[6],<br \/>\n mac.src_addr[5],<br \/>\n mac.src_addr[4],<br \/>\n mac.src_addr[3],<br \/>\n mac.src_addr[2],<br \/>\n mac.src_addr[1],<br \/>\n mac.src_addr[0]<br \/>\n );<br \/>\n printf(&quot;%s\\n&quot;, raw+mac.payload_offset);<br \/>\n }<br \/>\n usleep(100000);<br \/>\n }<\/p>\n<p> if((result = lazurite_close()) !=0) {<br \/>\n printf(&quot;fail to stop RF %d&quot;,result);<br \/>\n }<br \/>\n usleep(100000);<br \/>\n if((result = lazurite_remove()) !=0) {<br \/>\n printf(&quot;remove driver from kernel %d&quot;,result);<br \/>\n }<br \/>\n return 0;<br \/>\n}<br \/>\n[\/c]<\/p>\n<p>&nbsp;<\/p>\n<p>\u7de8\u96c6\u3057\u305f\u3089\u3001\u30b3\u30f3\u30bd\u30fc\u30eb\u753b\u9762\u3067make\u3068\u3046\u3061\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u30d3\u30eb\u30c9\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>[bash]<br \/>\nmake<br \/>\n[\/bash]<\/p>\n<p>\u65b0\u3057\u3044\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u5b9f\u884c\u3057\u305f\u3089\u3001\u30c7\u30fc\u30bf\u306e\u90e8\u5206\u304c\u6b63\u3057\u304f\u8868\u793a\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p><a href=\"https:\/\/www.appliot.co.jp\/lazurite-jp\/lapis_admin\/wp-content\/uploads\/set_aeskey.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-12633\" src=\"https:\/\/www.appliot.co.jp\/lazurite-jp\/lapis_admin\/wp-content\/uploads\/set_aeskey-300x93.png\" alt=\"set_aeskey\" width=\"300\" height=\"93\" srcset=\"https:\/\/www.appliot.co.jp\/lazurite-jp\/lapis_admin\/wp-content\/uploads\/set_aeskey-300x93.png 300w, https:\/\/www.appliot.co.jp\/lazurite-jp\/lapis_admin\/wp-content\/uploads\/set_aeskey-640x199.png 640w, https:\/\/www.appliot.co.jp\/lazurite-jp\/lapis_admin\/wp-content\/uploads\/set_aeskey.png 806w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u4ee5\u4e0a\u3001\u4eca\u56de\u306fAES\u6697\u53f7\u5316\u3092Ruby, C\u3067\u52d5\u304b\u3059\u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u7d39\u4ecb\u3092\u884c\u3044\u307e\u3057\u305f\u3002\u305c\u3072\u3001\u304a\u8a66\u3057\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7121\u7dda\u3067\u901a\u4fe1\u3092\u3059\u308b\u3068\u3044\u3046\u3053\u3068\u306f\u3001\u97f3\u58f0\u3067\u4f1a\u8a71\u3057\u3066\u3044\u308b\u306e\u3068\u540c\u3058\u3088\u3046\u306b\u96fb\u6ce2\u304c\u5c4a\u304f\u7bc4\u56f2\u5185\u3067\u3042\u308c\u3070\u8ab0\u3067\u3082\u30c7\u30fc\u30bf\u3092\u53d7\u4fe1\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3066\u3057\u307e\u3046\u305d\u3046\u3067\u3059\u3002\uff19\uff12\uff10MH\uff5a\u7121\u7dda\u3067\u3042\u308c\u3070\u534a\u5f84200~300m\u304f\u3089\u3044\u3057\u304b\u5c4a\u304d\u307e\u305b\u3093\u3057\u3001\u9244\u7b4b\u30b3\u30f3\u30af\u30ea\u30fc\u30c8\u306e\u58c1\u306a\u3069\u306f\u96fb\u6ce2\u304c\u901a\u308a\u629c\u3051\u3057\u3065\u3089\u3044\u306e\u3067\u3059\u304c\u3001\u305d\u308c\u3067\u3082\u4ed6\u306e\u4eba\u306b\u30c7\u30fc\u30bf\u3092\u898b\u3089\u308c\u305f\u304f\u306a\u3044\u3001\u805e\u304b\u308c\u305f\u304f\u306a\u3044\u3068\u3044\u3046\u6642\u304c\u3042\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002 \u305d\u306e\u3088\u3046\u306a\u3068\u304d\u306b\u4f7f\u7528\u3059\u308b\u306e\u304c\u901a\u4fe1\u30c7\u30fc\u30bf\u306e\u6697\u53f7\u5316\u3067\u3059\u3002 Lazurite\u306e\u6697\u53f7\u5316\u901a\u4fe1\u3067\u306f\u3001\u9001\u4fe1\u6a5f\u3068\u53d7\u4fe1\u6a5f\u3067\u540c\u3058\u56fa\u5b9a\u9375\u3092\u8a2d\u5b9a\u3057\u3066\u304a\u304f\u3053\u3068\u3067\u6697\u53f7\u5316\u3092\u884c\u3044\u3001\u305d\u306e\u30c7\u30fc\u30bf\u304c\u306a\u3044\u3068\u30c7\u30fc\u30bf\u3092\u53d7\u4fe1\u3057\u3066\u3082\u4e2d\u8eab\u3092\u7406\u89e3\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u306a\u3044\u72b6\u614b\u306b\u3059\u308b\u3067\u304d\u307e\u3059\u3002Lazurite\u3067\u306f\u3001AES128bit\u3092\u7528\u3044\u3066\u6697\u53f7\u5316\u3092\u3057\u3066\u3044\u308b\u305d\u3046\u3067\u3059\u3002 \u3067\u306f\u65e9\u901f\u4f7f\u7528\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002 Lazurite SubGHz\/920J\u5074(\u9001\u4fe1\u6a5f)\u306bAES128bit\u306e\u9375\u60c5\u5831\u3092\u8a2d\u5b9a\u3059\u308b\u3002 Lazurite IDE\u306e\u4e2d\u306eBIN\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u306bAES128bit\u306e\u9375\u60c5\u5831\u3092\u751f\u6210\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u3042\u308a\u307e\u3059\u3002\u300caes_keygen.bat\u300d\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u540d\u3067\u6b21\u306e\u4e00\u884c\u3092\u8a18\u8f09\u3057\u3066\u304f\u3060\u3055\u3044\u3002 1\u306e\u90e8\u5206\u306f\u9001\u4fe1\u6a5f\u30fb\u53d7\u4fe1\u6a5f\u3067\u9375\u3092\u751f\u6210\u3059\u308b\u305f\u3081\u306e\u30b7\u30fc\u30ba\u306b\u306a\u308a\u307e\u3059\u306e\u3067\u3001\u9069\u5f53\u306a\u6570\u5b57\u306b\u5909\u66f4\u3057\u3066\u304f\u3060\u3055\u3044\u30021 \u301c 0xFFFFFFFF\u307e\u3067\u8a2d\u5b9a\u53ef\u80fd\u3067\u3059\u3002 [bash] c:\\LazuriteIDE\\bin\\aes_keygen.ext 1  [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"categories":[13,20],"tags":[],"class_list":["post-12627","post","type-post","status-publish","format-standard","hentry","category-lazuriteide","category-raspberry-pi"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.appliot.co.jp\/lazurite-jp\/wp-json\/wp\/v2\/posts\/12627","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appliot.co.jp\/lazurite-jp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appliot.co.jp\/lazurite-jp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appliot.co.jp\/lazurite-jp\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appliot.co.jp\/lazurite-jp\/wp-json\/wp\/v2\/comments?post=12627"}],"version-history":[{"count":0,"href":"https:\/\/www.appliot.co.jp\/lazurite-jp\/wp-json\/wp\/v2\/posts\/12627\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appliot.co.jp\/lazurite-jp\/wp-json\/wp\/v2\/media?parent=12627"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appliot.co.jp\/lazurite-jp\/wp-json\/wp\/v2\/categories?post=12627"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appliot.co.jp\/lazurite-jp\/wp-json\/wp\/v2\/tags?post=12627"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}