import IM920

if __name__ == "__main__":
    args = sys.argv

    if (args[1] == "RDCH"):
        data = IM920.Rdch()
    elif (args[1] == "STCH"):
        data = IM920.Stch(args[2])
    elif (args[1] == "ENWR"):
        data = IM920.Enwr()
    elif (args[1] == "RDID"):
        data = IM920.Rdid()
    #elif(args[1] == "SBRT"):
    #	data = IM920.Sbrt(args[2])
    elif (args[1] == "RDRT"):
        data = IM920.Rdrt()
    elif (args[1] == "SRID"):
        data = IM920.Srid(args[2])
    elif (args[1] == "RRID"):
        data = IM920.Rrid()
    elif (args[1] == "STRT"):
        data = IM920.Strt(args[2])
    elif (args[1] == "RDRT"):
        data = IM920.Rdrt(args[2])
    elif (args[1] == "RPRM"):
        data = IM920.Rprm()
    else:
        data = "None"
    print(data)
Пример #2
0
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#IM920のデバッグ用プログラム
import IM920

#ペアリング
IM920.Srid(19200, '3AB3')

#削除
#IM920.Erid(19200)

#文字列送信
IM920.Send(19200, "Hallo")

#文字列受信
print(IM920.Reception(19200))

#中継機化
#IM920.Repeater(19200)

#固有ID
#IM920.Rdid(19200)

#ボーレート設定
#IM920.Sbrt(19200, '4')