BIDS_Server(v011c)公開のお知らせ

ども。早いことでもうハロウィンシーズンですね(遅い
だんだんとやる気が低下し、なかなか進捗が出せずにいます。

そういえば、最近は接点状態を読んでBVEに情報を送出するArduinoスケッチがよく求められてるような気がします。一応、昨年作成したものがあるので、私からはそちらのご利用をご提案しています…が。なんとBIDS_Serverのv011bとは接続できないという。というわけで、今回はその辺の修正を含むBIDS_Serverのv011cを公開します。

更新内容

なんかまだまだ不十分っぽいですが、一応下記の修正 / 機能追加を行いました。

  • Panel / Sound ArrayのAutoSend機能のバグ修正
  • 実行時引数によるコマンドプリセットファイルのロード機能の追加
  • 実行時引数によるコマンドプリセットの対応
  • Serial modにおいて、「\r」を改行記号として認識できるように改修
  • (communication.dll規格の対応)

commit logを見た限り、たぶんこれぐらいです。

command preset fileについて

拡張子は「bsvcmd」です。「(/・ω・)/.bsvcmd」みたいな感じでファイルを作り、そこまでのパス(絶対/相対両方OKです)を引数に入れることで、自動で読んでくれます。
実行するコマンドは、ファイル内に1行1コマンドで書いてください。

ファイル内容

BIDS_Server.exe D:\test.bsvcmd D:\TR\test2.bsvcmd test3.bsvcmd
lsmods
man
man auto

close
man serial

test.bat実行結果

BIDS Server Application
ver : 011c
SMemLib Started
args[0] :: D:\test.bsvcmd
args[1] :: D:\TR\test2.bsvcmd
args[2] :: test3.bsvcmd
args[0] : D:\test.bsvcmd => BIDS_Server Command preset file
do D:\test.bsvcmd[0] : lsmods
do D:\test.bsvcmd[1] : man
 LibUsbDotNet : LibUsbDotNet.dll
 communication : TR.BIDSsv.communication.dll
 serial : TR.BIDSsv.serial.dll
 tcpcl : TR.BIDSsv.tcpcl.dll
 tcpsv : TR.BIDSsv.tcpsv.dll
 udp : TR.BIDSsv.udp.dll
 dgoctrlusb : TR.BIDSsvMOD.dgoctrlusb.dll
BIDS Server Application
ver : 011c

auto : Set the Auto Sending Function
close: Close the connection.
exit : close this program.
ls : Print the list of the Name of alive connection.
lsmods : Print the list of the Name of mods you can use.
man : Print the mannual of command.
  If you want to check the manual of each mod, please check the mod name and type "man + (mod name)"
args[1] : D:\TR\test2.bsvcmd => BIDS_Server Command preset file
do D:\TR\test2.bsvcmd[0] : man auto
auto sending process turn on command : auto send will start when this command is entered.
do D:\TR\test2.bsvcmd[1] : close
  Option : bve5, common, const, handle, obve, panel, sound
Close Complete.
args[2] : test3.bsvcmd => BIDS_Server Command preset file
do test3.bsvcmd[0] : man serial
BIDS Server Program Serial Interface
Version : 202
Copyright (C) Tetsu Otter 2019
Argument Format ... [Header("-" or "/")][SettingName(B, P etc...)][Separater(":")][Setting(38400, 2 etc...)]
  -B or -BaudRate : Set BaudRate.  If you don't set this command, the BaudRate is set to 19200.
  -DataBits : Set the DataBit Count Option.  Default:8  If you want More info about this argument, please read the source code.
  -DTR : Set the RTS (Data Terminal Ready) Signal Option.  Default:1  0:Disabled, 1:Enabled
  -E or -Encoding : Set the Encoding Option.  Default:0  If you want More info about this argument, please read the source code.
  -HandShake : Set the HandShake Option.  Default:0  If you want More info about this argument, please read the source code.
  -N or -Name : Set the Instance Name.  Default:"serial"  If you don't set this option, this program maybe cause some bugs.
  -P or -PortName : Set PortName.  You must set this option.  "COM" is unneeded in the Setting.  Only Number is allowed in the setting.
  -Parity : Set the Parity Option.  Default:0  If you want More info about this argument, please read the source code.
  -RTO or ReadTimeout : Set the ReadTimeout time option.  Default:100
  -RTS : Set the RTS (Request to Send) Signal Option.  Default:1  0:Disabled, 1:Enabled
  -StopBits : Set the StopBits Option.  Default:0  If you want More info about this argument, please read the source code.
  -WTO or WriteTimeOut : Set the WriteTimeout time option  Default:1000
serial :

command presetについて

実行時引数にてコマンドを入力した場合、初期処理終了後にそのコマンドが実行されます。なお、「"」でコマンドを括ることにより、空白のあるコマンドも使用可能になります。

使用例

BIDS_Server.exe man serial
BIDS_Server.exe "man serial"

usecase1では「man」コマンド実行後に「serial」コマンドが実行されます。
usecase2では「man serial」コマンドが実行されます。

面倒なので、実行例は省略します。

Serial modのGIPI互換機能について

今まで散々「BIDSではGIPIのプログラムとも通信できますよ!」とか言っておきながら、実は設定ミスで通信ができない状態になっていたという…大変申し訳ないです…
互換機能周りのバグ修正に当たって、改行記号を変更する機能が追加されました。
「serial -NL:0」や「serial -NewLine:1」だとか入力すると、改行記号の変更が行えます。

改行記号と番号の対応は、以下の通りです。

NumCharcomment
0\nBIDS標準 デフォルト設定
1\rGIPI標準
2\r\n念のため用意

communication.dll規格への対応について

Rock_on氏の開発したcommunication.dllと、あるいはそれに対応したソフトウェアとの通信が可能となるように、communication.dll規格のByte ArrayとBIDSの構造体とを変換する機能を実装しました。

なお、本機能はベータサポート段階であり、確実な動作は保証できません。また、専用の通信モジュール以外では本機能を呼び出しておらず、使用できませんので、ご注意ください。

ライセンス

MIT Licenseを適用しています。

ダウンロード

GitHubのrelease機能を用いて公開しています。こちらよりダウンロードしてください

なお、v011cではSerial通信modも同梱して配布しています。

BIDS,BVE,お知らせ

Posted by Tetsu Otter