最終更新: 2018/5
Lua言語で書かれたスクリプトファイルをFlashAirに保存することで、 下記のような簡易なバッチ処理が行えます。
本機能は、FlashAir W-03以上で利用できます。
Luaは、パワフルで、高速で、軽量で、埋め込み可能な、スクリプト言語です。
Luaは、シンプルな手続き型構文をと強力なデータ記述構造を、連想配列と拡張可能なセマンティクスを用いて組み合わせています。 Luaは動的型付けであり、レジスタベースの仮想マシン向けのバイトコードを解釈することによって実行されます。 また、インクリメンタルガベッジコレクションによる自動メモリ管理を備えており、 設定、スクリプティング、ラピッドプロトタイピングに最適です。
Lua言語の詳細は、関連情報をご覧ください。
FlashAirのLua機能では、下記のライブラリ関数が利用できます。
メモリ制約のため、標準ライブラリの以下の機能は使用できません。
関数名 | 機能 | ファームウェアバージョン |
---|---|---|
Bridge | インターネット同時接続モードで無線LANの有効化 | 3.00.00+ |
Connect | STAモードで無線LANの有効化 | 3.00.00+ |
ConnectedSTA | AP接続時の接続ステーション数 | 4.00.00+ |
control("fioget") | 無線LAN On/Off状態の取得 | 4.00.00+ |
control("fioset") | 無線LAN On/Off | 4.00.00+ |
New control("hid_change_pass") | 秘匿領域に設定したパスワードの変更 | 4.00.03+ |
New control("hid_clear") | パスワード、APIで保存したスクリプトファイルを全て削除 | 4.00.03+ |
New control("hid_get") | 秘匿領域に保存したスクリプトを取得 | 4.00.03+ |
New control("hid_hash") | 設定したパスワードと指定する文字列からハッシュ文字列を作成 | 4.00.03+ |
New control("hid_set_pass") | 秘匿領域への保存のためのパスワードを設定 | 4.00.03+ |
New control("hid_store") | スクリプトを秘匿領域へ保存 | 4.00.03+ |
control("time") | 日時メモ保存 | 4.00.00+ |
Disconnect | 無線LANの停止 | 3.00.00+ |
Establish | APモードで無線LANの有効化 | 3.00.00+ |
ftp | FTPを使用したファイルのアップロード、ダウンロード | 3.00.00+ |
GetScanInfo | SSIDスキャン結果の取得 | 3.00.00+ |
hash | ハッシュの計算 | 3.00.00+ |
HTTPGetFile | HTTPを使用したファイルのダウンロード | 3.00.00+ |
Update i2c | I 2C操作 | 4.00.00+ |
ip | IPアドレスを取得または設定 | 3.00.00+ |
MailSend | メールの送信 | 3.00.01+ |
deleted md5 | MD5ハッシュの計算 | 3.00.00 |
ping | 指定IPへPINGを発行 | 3.00.00+ |
pio | SDインターフェースのGPIO制御 | 3.00.00+ |
ReadStatusReg | FlashAir自身のステータスレジスタを取得 | 3.00.00+ |
remove | ファイルの削除 | 3.00.00+ |
rename | ファイル名の変更 | 3.00.00+ |
Updated request | HTTPリクエストの発行 | 3.00.00+ |
Scan | SSIDスキャンの実行 | 3.00.00+ |
search | ファイルサーチ機能 | 4.00.00+ |
SetCert | ルート証明登録 | 3.00.00+ |
SetChannel | 無線チャネルを設定する | 3.00.01+ |
sharedmemory | 共有メモリのデータを読み込み或いは書き込み | 3.00.00+ |
sleep | 指定時間だけスクリプトの実行を停止 | 3.00.00+ |
spi | SPI操作を行う | 3.00.01+ |
New spi("bit") | 転送ビット数の指定 | 4.00.03+ |
New spi("cs") | チップセレクト信号の制御 | 4.00.03+ |
New spi("init") | インターフェースを初期化し、クロック周期の変更を行う | 4.00.03+ |
New spi("mode") | SPIモードの指定 | 4.00.03+ |
New spi("read") | ライトおよびリード | 4.00.03+ |
New spi("write") | ライトおよびリード | 4.00.03+ |
strconvert | 文字列変換 | 3.00.00+ |
New watchdog("event") | WatchDogのタイマーリセット | 4.00.03+ |
New watchdog("start") | WatchDogのタイマースタート | 4.00.03+ |
New watchdog("status") | WatchDogの状態取得 | 4.00.03+ |
New watchdog("stop") | WatchDogのタイマー停止 | 4.00.03+ |
websocket | WebSocket機能 | 4.00.00+ |
WlanLink | 接続確認 | 3.00.00+ |
インターネット同時接続モードで無線LANを有効化します。
fa.Bridge(ssid, networkkey, encmode, brgssid, brgnetworkkey)
なし
STAモードで無線LANを有効化します。
fa.Connect(ssid, networkkey)
string。 接続先無線LAN APのSSID名。
string。 接続先無線LAN APのセキュリティキー。
なし
AP接続時の接続されているステーション数、ip、macを返します。
cnt,tbl = fa.ConnectedSTA()
local cnt, tbl = fa.ConnectedSTA() print(cnt,tbl) for i,t in ipairs(tbl) do for k,v in pairs(t) do print(k,v) end end
1 table: 856B1C mac 40:48:0f:7b:37:92 ip 192.168.0.11
無線LANのOn/Off状態を取得します。
result = fa.control("fioget")
無線LANのOn/Offを行います。
result = fa.control("fioset", enable)
秘匿領域に設定したパスワードを変更します。
ret = fa.control("hid_change_pass", old_password, new_password)
0
成功。
1
設定エラー。
-1
パスワード長エラー。
パスワード、APIで保存したスクリプトファイルを全て削除します。
fa.control("hid_clear")
なし
秘匿領域に保存したスクリプトを取得します。
fa.control("hid_get", filename , dstfilename, password)
なし
fa.control("hid_get", "h:sys.lua", "tmp/option.lua", "mysecret")
ホストからアクセス可能な領域で実行されたLuaスクリプトから、秘匿領域へ保存されたファイルへアクセスは出来ません。
秘匿領域に設定したパスワードと指定する文字列からハッシュ文字列を作成します。
ret = fa.control("hid_hash", string)
秘匿領域への保存のためのパスワードを設定します。
fa.control("hid_set_pass", password)
なし
スクリプトを秘匿領域へ保存します。
fa.control("hid_store", filename, password)
なし
fa.control("hid_store", "test.lua", "12345678")
保存したファイルをCONFIGで指定する
LUA_RUN_SCRIPT=H:filename LUA_SD_EVNET=H:filename
日時メモの保存または取得を行います。
result = fa.control("time"[, savetime])
result = fa.control("time", 0x4ac1645c)
result = fa.control("time") if result ~= nil then print(string.format("time: 0x%08x", result)) end
無線LANを停止します。
fa.Disconnect()
なし
なし
APモードで無線LANを有効化します。
fa.Establish(ssid, networkkey, encmode)
なし
FlashAirセキュリティモードには、下記のうち一つを指定します。
値 | 意味 |
---|---|
0
|
オープンシステム、暗号化なし |
1
|
オープンシステム、WEP |
3
|
WPA-PSK、TKIP |
4
|
WPA-PSK、AES |
5
|
WPA2-PSK、TKIP |
6
|
WPA2-PSK、AES |
FTP (File Transfer Protocol) によるファイルのダウンロードまたはアップロードを実行します。
result = fa.ftp(cmd, uri, filename)
"get"
"put"
1
nil
ftps://
とすると実行可能です。implicit, explicitモード両方とも利用可能です。result = fa.ftp("get", "ftp://user:pass@ftp.test.com:21/test.txt", "test.txt"); result = fa.ftp("put", "ftps://user:pass@ftp.test.com:990/test.txt;implicit", "test.txt"); result = fa.ftp("put", "ftps://user:pass@ftp.test.com:990/test.txt;explicit", "test.txt");
Scan関数で得られた情報を取得します。
ssid, other = fa.GetScanInfo(num)
number。 Scanリストの番号を指定。
string。 SSID。
table。 Scan結果情報。
Connect, Establish, または Bridge コマンドにより無線LANが有効になっていると利用できません。
count = fa.Scan() for i=1,count do ssid,other = fa.GetScanInfo(i) for key, val in pairs(other) do print(key, val) end end
ハッシュ値を計算します。
hash = fa.hash(name, data, key)
HTTPを使用してファイルをダウンロードします。
result = fa.HTTPGetFile(uri, filepath [, user, pass])
string。 取得元のURI。
string。 保存先ファイル名。
string。 Basic認証におけるUser文字列。
string。 Basic認証におけるPass文字列。
1
nil
FlashAirよりI 2C操作を行います。i2cはMasterとして動作します。
res, data1, data2, data3, ... = fa.i2c(table) res, string = fa.i2c(table) res, data, ctrl = fa.i2c{mode = "getpio"}
"45"
、
"100"
、
"189"
、
"400"
の4つ。省略時は
"100"
が設定されます。10
が設定されます。"read"
と
"write"
です。
"read"
を指定した場合、接続デバイスからデータを読み出します。
"write"
を指定した場合、接続デバイスへデータを送ります。0
~
255
までの値を設定できます。
"setpio"
の場合、0または1でPIOの出力を指定します。
1
が設定されます。"binary"
、
"string"
です。省略時には、
"binary"
が設定されます。デバイス初期化 | スタートコンディションの送信 | リスタートコンディションの送信 | 接続デバイスからデータ読み出し | 接続デバイスへデータ書き込み | ストップコンディションを送信し、コネクションを閉じる |
4.00.03
PIO設定 |
4.00.03
PIO取得 |
|
---|---|---|---|---|---|---|---|---|
mode |
"init"
|
"start"
|
"restart"
|
"read"
|
"write"
|
"stop"
|
"setpio"
|
"getpio"
|
freq | 省略可 | 不要 | 不要 | 不要 | 不要 | 不要 | 不要 | 不要 |
timeout | 省略可 | 不要 | 不要 | 不要 | 不要 | 不要 | 不要 | 不要 |
address | 不要 | 必須 | 必須 | 不要 | 不要 | 不要 | 不要 | 不要 |
direction | 不要 | 必須 | 必須 | 不要 | 不要 | 不要 | 不要 | 不要 |
data | 不要 | 不要 | 不要 | 不要 | 必須 | 不要 | 必須 | 不要 |
bytes | 不要 | 不要 | 不要 | 省略可 | 省略可 | 不要 | 不要 | 不要 |
type | 不要 | 不要 | 不要 | 省略可 | 不要 | 不要 | 不要 | 不要 |
ctrl | 不要 | 不要 | 不要 | 不要 | 不要 | 不要 | 必須 | 不要 |
SCL/SDAはプルアップしてください。
CLKはプルダウンしてください。
4.00.03
"setpio"
/
"getpio"
ではD1が使用できます。
"OK"
を返します。失敗時はそれ以外の文字列を返します。0
~
255
までの値が格納されます。接続デバイスからデータ読み出し、
type = "binary"
指定時のみ使用します。type = "string"
指定時のみ使用します。type = "getpio"
指定時のみ使用します。
0
のとき入力、
1
のとき出力となります。
type = "getpio"
指定時のみ使用します。
res = fa.i2c{mode = "init", freq = "100"} res = fa.i2c{mode = "start", address = 50, direction = "write"} res = fa.i2c{mode = "restart", address = 50, direction = "read"} res, data1, data2, data3, ... = fa.i2c{mode = "read", type = "binary"} res, string = fa.i2c{mode = "read", type = "string"} res = fa.i2c{mode = "write", data = 0} res = fa.i2c{mode = "stop"}
res = fa.i2c{mode = "init", freq = "100"} res = fa.i2c{mode = "start", address = 50, direction = "read"} res, r0, r1, r2, r3, r4, r5 = fa.i2c{mode = "read", bytes = 5, type = "binary"} res = fa.i2c{mode = "stop"}
res = fa.i2c{mode = "init", freq = "100"} res = fa.i2c{mode = "start", address = 50, direction = "write"} res = fa.i2c{mode = "write", data = 0} res = fa.i2c{mode = "restart", address = 50, direction = "read"} res, data = fa.i2c{mode = "read", bytes = 1, type = "binary"} fa.i2c{mode = "stop"}
res = fa.i2c {mode ="init", freq="100"} res = fa.i2c {mode ="setpio", data=1, ctrl=1} -- 出力High res = fa.i2c {mode ="setpio", data=0, ctrl=1} -- 出力Low res = fa.i2c {mode ="setpio", data=0, ctrl=0} -- 入力 res, data, ctrl = fa.i2c {mode="getpio"}
FlashAir自身のIPアドレスを取得または設定します。
ip, mask, gw = fa.ip(ipaddress, subnetmask, gateway)
-- 値取得時 ip, mask, gw = fa.ip() -- 値設定時 fa.ip("192.168.11.2", "255.255.255.0", "192.168.11.1")
Flashairよりメール送信を行う(ファイルの添付も可能)。
fa.MailSend(from,headers,body,server,user,password, attachment, ContentType)
成功: MailSend is success.
失敗: Error: It failed to send.
from = "fromaddr@yahoo.co.jp" rcpt = "toaddr@gmail.com" a = fa.MailSend { from = from, headers = "To: "..rcpt.."\r\nFrom: "..from.."\r\nSubject: test", body = "HELLO HELLO", server = "smtp.mail.yahoo.co.jp", user = "flashair", password ="1234567890", attachment = "FBYF.jpg", ContentType = "image/jpg" }
hash(ハッシュの計算)へ統合されました。
指定IPへPINGを発行します。
result = fa.ping(ip)
1
nil
result = fa.ping("192.168.130.1")
SDインターフェースのPIO (Programmed Input/Output) 制御を行います。
s, indata = fa.pio(ctrl, data)
0
を、 書き込みたい端子に対応するビットに
1
を指定します。
0
を設定するとLow、
1
を設定するとHighを出力します。
1
0
ビット割当
FlashAir自身のステータスレジスタを取得する。
reg = fa.ReadStatusReg()
なし
無線LAN機能ステータスレジスタの内容を、文字列として返します。内容は 無線LAN機能ステータスレジスタ(Application Status for Wireless LAN)を参照してください。
IPアドレスを取得する場合
local ipaddress = string.sub(fa.ReadStatusReg(),160,168)
指定されたファイルを削除します。
fa.remove(filepath)
なし
fa.remove("/DCIM/100__TSB/DSC_100.JPG")>
指定されたファイルのパスを変更します。
fa.rename(oldfile, newfile)
なし
fa.rename("/DCIM/100__TSB/DSC_100.JPG","/DCIM/100__TSB/DSC_101.JPG")
HTTP (Hyper Text Transfer Protocol) リクエストを発行します。
b, c, h = fa.request(url [, method [, headers [, file [, body [, bufsize [, redirect [, rcvbuff [, rcvfile]]]]]]]])
"GET"
とみなします。
<!--WLANSDFILE-->
をファイルに置換して送信します。bodyが指定されていない場合は、単にfileが送信されます。
true
を指定したものとみなします。
string。Luaのスタック上にメモリを確保し、受信データを確保したメモリに保存します。
boundary = "--61141483716826" contenttype = "multipart/form-data; boundary=" .. boundary filepath = "sample.txt" mes = "--".. boundary .. "¥r¥n" .."Content-Disposition: form-data; name=¥"file¥"; filename=¥""..file .."¥"¥r¥n" .."Content-Type: text/plain¥r¥n" .."¥r¥n" .."<!--WLANSDFILE-->¥r¥n" .."--" .. boundary .. "--¥r¥n" blen = lfs.attributes(file,"size") + string.len(mes) - 17 b,c,h = fa.request{url = "http://192.168.0.1/upload.cgi:8080", method = "POST", headers = {["Content-Length"] = tostring(blen), ["Content-Type"] = contenttype}, file = filepath, body = mes }
Scan開始コマンド。結果はGetScanInfo()で取得します。
count = fa.Scan([ssid])
number。 スキャンで見つかったAP数。
Connect, Establish, または Bridge コマンドにより無線LANが有効になっていると利用できません。
指定したディレクトリ内で、更新日時によるファイル検索を行います。更新日時が最新であるファイルの検索、または引数で指定した更新日時によるファイルの検索が可能です。
result, filelist, time = fa.search(type, path, searchtime)
1 | 正常終了 |
---|---|
-1 | ファイルリストの作成時にオーバーフロー
|
-2 | ファイルリストの作成時にオーバーフロー(searchtimeに-1以外を指定した場合のみ返す可能性がある)
|
-3 | ディレクトリオープンエラー |
-4 | ディレクトリリードエラー |
local result, filelist, time = fa.search("file", "/DCIM", -1) if result ~= 1 then print("error: ", result) end if filelist ~= nil then for f in string.gmatch(filelist, '(.-),') do print(f) end end if time ~= nil then print(string.format("time: 0x%08x", time)) end
local result, filelist, time = fa.search("file", "/DCIM", 0x4ac1645c) if result ~= 1 then print("error: ", result) end if filelist ~= nil then for f in string.gmatch(filelist, '(.-),') do print(f) end end if time ~= nil then print(string.format("time: 0x%08x", time)) end
local function StringToFatDateTime(datetime_str) local pattern = '(%d+)/(%d+)/(%d+)%s+(%d+):(%d+):(%d+)' local year,month,day,hour,min,sec = string.match(datetime_str, pattern) year = year - 1980 sec = bit32.rshift(sec, 1) local date_fat = bit32.bor(bit32.lshift(year, 9), bit32.lshift(month, 5), day) local time_fat = bit32.bor(bit32.lshift(hour, 11), bit32.lshift(min, 5), sec) local datetime_fat = bit32.bor(bit32.lshift(date_fat, 16), time_fat) return datetime_fat end
local function FatDateTimeToString(datetime_fat) local function getbits(x, from, to) local mask = bit32.lshift(1, to - from + 1) - 1 local shifted = bit32.rshift(x, from) return bit32.band(shifted, mask) end local fatdate = bit32.rshift(datetime_fat, 16) local day = getbits(fatdate, 0, 4) local month = getbits(fatdate, 5, 8) local year = getbits(fatdate, 9, 15) + 1980 local fattime = getbits(datetime_fat, 0, 15) local sec = getbits(fattime, 0, 4) * 2 local min = getbits(fattime, 5, 10) local hour = getbits(fattime, 11, 15) return string.format('%02d/%02d/%02d %02d:%02d:%02d', year, month, day, hour, min, sec) end
証明書のクリアor登録(X.509 binary encode with DER)を行います。
fa.SetCert(filename)
1
nil
lres = fa.SetCert("DerSha256.cer") if (res == nil) then print("cert err") end
無線チャネルを設定する。
fa.SetChannel(channelNo)
なし
fa.Disconnect() fa.SetChannel("0xB") fa.Establish("flashair3", "12345678", "6")
共有メモリからデータを読み込み或いは書き込みを行います。
fa.sharedmemory(command, addr, len, wdata)
write時 | ⇒ | 成功:1 | 失敗:nil |
read時 | ⇒ | 成功:読み出し文字列 | 失敗:nil |
res1 = fa.sharedmemory("write", 0, 8, "12345678") res2 = fa.sharedmemory("read", 1, 4, 0) print("res=",res2) 結果:res=2345
指定時間だけスクリプトの実行を停止します。
sleep(msec)
なし
FlashAirよりSPI操作を行う。
result = fa.spi(command, data)
write | : | ライトコマンド発行時の受信データ。 |
read | : | リードコマンド発行時の受信データ。 |
otherwise | : | ステータス |
fa.spi("init", 1001)
転送ビット数を指定します。(デフォルト値:8)
res = fa.spi("bit", bit)
1
~
32
。転送ビット数。
number。
1
0
spi("write") で文字列を指定する場合、bit指定との併用は不可となります。
チップセレクト信号を制御します。
fa.spi("cs", cs_level)
local CS_ASSERT=0 local CS_NEGATE=1 fa.spi("mode", 2) fa.spi("init", 1000) fa.spi("cs", CS_ASSERT) fa.spi("write", "hello", 5) fa.spi("cs", CS_NEGATE)
インターフェースを初期化し、クロック周期の変更を行う(デフォルト値:1000)。CSはHighとなる。
res = fa.spi("init"[, period])
1
0
SPIモードを指定します。(デフォルト値:3)
res = fa.spi("mode", mode)
number。範囲
0
~
3
。SPIモード。
1
成功。
0
失敗。
spi("init") の実行前にspi("mode")を実行してください。
ライトおよびリード。複数回転送でき、全てのリード結果を取得できます。送信データはダミーデータを繰り返し送信します。
res_num = fa.spi("read") res_tbl = fa.spi("read", xfer_num, data_num)
fa.spi("read") の書式では、ダミーデータとして全ビット0が送信されます。
fa.spi("read", xfer_num, data_num) の書式では、ダミーデータとしてdata_numが送信されます。
res_num = fa.spi("read") print(res_num) res_tbl = fa.spi("read", 10, 0xff) for i, v in ipairs(res_tbl) do print(i, v) end
ライトおよびリード。複数回転送できますが、リード結果は最後の1回のみ取得できます。
res = fa.spi("write", data_num) res = fa.spi("write", data_str, xfer_num)
res = fa.spi("write", 0x12) result = fa.spi("write", "hello", 8)
data_strを使用する場合、bit指定との併用は不可となります。
SJIS文字をUTF-8文字へ変換とutf8文字をSJIS文字へ変換する。
fa.strconvert(format, orgstr)
成功:変換文字列
失敗:nil
str = "あかさたなはまやらわ" print("testStr=", str) a = fa.strconvert("sjis2utf8", str ) print("toUTF8=", a) b = fa.strconvert("utf82sjis", a) print("toSJIS=", b)
WatchDogのタイマーをリセットします。
result = fa.watchdog("event")
1
タイマー再始動。
0
watchdogをスタートしていない(タイマー待ち時間未設定)。
WatchDogのタイマーをスタートさせます。
result = fa.watchdog("start", cycle)
number。 watchdogを発行を秒単位で指定します。
1
タイマー開始。
0
タイマー待ち時間未設定。
WatchDogとは、システムが機能し続けていることを確認するためのタイマーのことです。WatchDogのタイマーをスタートした後システムに異常事態が起こり、WatchDogのタイマーをリセットできなかった場合FlashAirを再起動させます。
使用例
LUA_RUN_SCRIPT=/HelloWorld.lua
を追加します。
こちらのチュートリアルで使用した
HelloWorld.lua
をFlashAirルート上に保存します。すでにHello.txtがルート上にある場合はリネームまたは削除してください。fa.watchdog("start", 10)
print("watchdog start")
for i = 1, 30 do
result = fa.watchdog("status")
print("watchdog status:"..result)
end
result, filelist, time = fa.search("file", "/DCIM", -1)
if filelist ~= nill then
result = fa.watchdog("event")
print("watchdog restart")
else
fa.watchdog("stop")
print("watchdog stop")
end
while 0 ~= fa.watchdog("status") do
result = fa.watchdog("status")
print("watchdog status:"..result)
end
このスクリプトはWatchdogタイマーを10秒間隔でスタートさせ、Watchdogステータスを数回確認、
/DCIM
上にファイルが存在したらWatchdogタイマーを再起動させ、Watchdogステータスが0になるまでprintし続けます。
HelloWorld.lua
により作成されたHello.txtを確認します。(Hello There!が1行表示されている状態です)WatchDog.lua
を実行します。LUA_RUN_SCRIPT
が実行されていることが確認できます。WatchDogの状態を取得します。
result = fa.watchdog("status")
0
以上
watchdogタイマー発動までの残り時間。
0
発動までの残り時間が1秒未満。
-1
watchdogタイマー待機中。
WatchDogのタイマーを停止します。
result = fa.watchdog("stop")
0
タイマー停止。
WebSocket通信をします。
res, type, payload = fa.websocket(table)
1
、バイナリ=
2
、PING=
9
、 省略時=自動判別)。
オープン | メッセージ送信 | メッセージ受信 | クローズ | |
---|---|---|---|---|
mode |
"open"
|
"send"
|
"recv"
|
"close"
|
address | 必須 | 不要 | 不要 | 不要 |
payload | 不要 | 必須 | 不要 | 不要 |
type | 不要 | 省略可 | 不要 | 不要 |
length | 不要 | 省略可 | 不要 | 不要 |
tout | 不要 | 不要 | 省略可 | 不要 |
0
もしくは正数を返します。受信失敗時は負数を返します。
1
、バイナリ=
2
)。受信失敗時は
nil
を返します。メッセージ受信のときのみ使用します。
nil
を返します。メッセージ受信のときのみ使用します。
res = fa.websocket{mode = "open", address = "ws://localhost/socket"} res = fa.websocket{mode = "send", payload = "hello!", type = 1} res, type, payload = fa.websocket{mode = "recv", tout = 5000} fa.websocket{mode = "close"}
ネットワークに無線接続されているかを確認します。
result = fa.WlanLink()
なし
1
0
第2パーティションへアクセスを行うことが出来ます。第2パーティションはLuaの内部ログなどを保存し、ホスト機器からのファイルアクセスによる影響がない領域のことです。
ドライブレターにより、パーティションを指定することが可能です。
"p" --1stパーティション(省略化) "s" --2ndパーティション "h" --秘匿領域
パーティションの作成は、Linux、Win10などのホスト機器を使用して分割することが可能です。
local file = io.open("s:\flashair.log", "a")