hypweb.net
XOOPSマニア  最新情報のRSS(サイト全体)
[ 自宅サーバーWebRing |ID=54 前後5表示乱移動サイト一覧 ]

TOP » UsersWiki » nao-pon » blog » 2015-02-18 の変更点
1: 2015-02-18 (水) 20:51:00 nao-pon ソース
With "attach" plugin. (Created empty)
現: 2015-02-18 (水) 20:53:02 nao-pon ソース
Line 1: Line 1:
 +#navi
 +RIGHT:&rsslink(../);
 +#boxdate
 +* Android Tasker で指定秒間のネットワーク通信量(Kbps)計るタスクを作った [#hcff32cf]
 +RIGHT:&tag(Android,Tasker);
 +
 +Android アプリの Tasker でスリープ中で非通信時に、エアプレーンモードにしようと思い、ネットワーク通信量を計りたかったので、そんなタスクをつくってみた。
 +
 +- 要 busybox
 +-- busybox ifconfig 使用
 +-- wlan0 (Wi-Fi 専用)
 +
 +getNetKbps (3)
 +    A1: If [ %par1 Set ]
 +    A2: Variable Set [ Name:%sec To:%par1 Do Maths:Off Append:Off ]
 +    A3: Else
 +    A4: Variable Set [ Name:%sec To:10 Do Maths:Off Append:Off ]
 +    A5: End If
 +    A6: Variable Set [ Name:%tx1 To:0 Do Maths:Off Append:Off ]
 +    A7: Variable Set [ Name:%rx1 To:0 Do Maths:Off Append:Off ]
 +    <check>
 +    A8: Run Shell [ Command:busybox ifconfig wlan0 Timeout (Seconds):0 Use Root:Off Store Output In:%res Store Errors In: Store Result In: ]
 +    A9: Variable Search Replace [ Variable:%res Search:(Rx bytes:)(\d+)(.*Tx bytes:)(\d+) Ignore Case:On Multi-Line:Off One Match Only:On Store Matches In: Replace Matches:On Replace With:|$2|$4| ]
 +    A10: [X] Flash [ Text:%res Long:Off ]
 +    A11: Variable Split [ Name:%res Splitter:| Delete Base:On ]
 +    A12: If [ %rx1 eq 0 ]
 +    A13: Variable Set [ Name:%rx1 To:%res2 Do Maths:Off Append:Off ]
 +    A14: Variable Set [ Name:%tx1 To:%res3 Do Maths:Off Append:Off ]
 +    A15: Wait [ MS:0 Seconds:%sec Minutes:0 Hours:0 Days:0 ]
 +    A16: Goto [ Type:Action Label Number:1 Label:check ]
 +    A17: Else
 +    A18: Variable Set [ Name:%bps To:((%res2-%rx1)+(%res3-%tx1))/%sec/1024 Do Maths:On Append:Off ]
 +    A19: [X] Flash [ Text:((%res2-%rx1)+(%res3-%tx1))/%sec Long:On ]
 +    A20: [X] Flash [ Text:%bps Long:Off ]
 +    A21: End If
 +    A22: Return [ Value:%bps Stop:On ]
 +
 +デバグ用に Flash 入れて無効にしてあります。
 +
 +- XML: &ref(getNetKbps.tsk.xml);
 +
 +RIGHT:&font(90%){&page_comments;};
 +#navi


トップ   差分 バックアップ 複製 名前変更 リロード印刷に適した表示   ページ新規作成 全ページ一覧 単語検索 最新ページの一覧   ヘルプ   最新ページのRSS 1.0 最新ページのRSS 2.0 最新ページのRSS Atom Powered by xpWiki
Counter: 515, today: 1, yesterday: 0
このページのTopへ
メインメニュー
ログイン

ユーザー名:


パスワード:





パスワード紛失  |新規登録
最近の更新
オンライン状況
640 人のユーザが現在オンラインです。 (16 人のユーザが UsersWiki を参照しています。)

登録ユーザ: 0
ゲスト: 640

もっと...
サイト情報