battlecore::device
The device module exposes the device identity and configuration: its id, role, mode and volume, along with the GPS count. Include its declarations with include "./battlecore/device.bst";.
getGpsCount
Returns how many satellites the GPS has locked on to.
native int battlecore::device.getGpsCount ();getId / setId
Declared for the device id, but the firmware does not support either of them yet. Calling one returns an error. For the player's id use battlecore::player.getPlayerId.
native int battlecore::device.getId ();
native void battlecore::device.setId (int newVal);getRole / setRole
Returns the device's role in the game: 1 none, 2 host, 3 client. The role follows the lobby, so setRole is not supported and returns an error.
native int battlecore::device.getRole ();
native void battlecore::device.setRole (int newVal);getMode / setMode
Returns the operation mode: 0 Owner, 1 Operator, 2 mesh test. Changing mode restarts the device into another flow, which the app and the menu do. setMode is not supported from a script and returns an error.
native int battlecore::device.getMode ();
native void battlecore::device.setMode (int newVal);getVolume / setVolume
Gets or sets the speaker volume, 0 to 255. The app saves the owner's choice, and the device starts at that volume. A change made by a script lasts until the device restarts.
native int battlecore::device.getVolume ();
native void battlecore::device.setVolume (int newVal);