我該如何搜索連接的藍牙/無線設備,例如一個魔術鼠標?我怎樣才能得到電池的百分比?如何獲得魔術鼠標的電池狀態? (以%計)
請張貼我的一些代碼,並解釋它,因爲我發現了一些東西,但我真的不明白它。
非常感謝您的幫助。
我該如何搜索連接的藍牙/無線設備,例如一個魔術鼠標?我怎樣才能得到電池的百分比?如何獲得魔術鼠標的電池狀態? (以%計)
請張貼我的一些代碼,並解釋它,因爲我發現了一些東西,但我真的不明白它。
非常感謝您的幫助。
我相信這可以通過回答以下幾點:
How to get the battery life of mac os x macbooks programatically?
Getting iPhone's battery level
How to get the Battery Charge Level specifically in mWh (not percentage) for Mac (Cocoa or C)
希望它有幫助。你已經問過幾次了,你可以看到。
更新
我知道這不是對象 - 原生API的,但如果你不能找出IOPowerSources你可以做到這一點,並解析結果
ioreg -l | grep BatteryPercent
現在的問題是如何我可以得到鼠標的狀態嗎? 4.鏈接幫助了我一點,但我怎麼能得到鼠標? – cocos2dbeginner 2011-01-07 16:39:57