ASUS Aura Ready Game SDK Developer's Guide
Game SDK (RESTful API)

Introduction

Aura SDK provided RESTful API for developer to easily control Aura-sync devices.

Examples

You can download the HTML examples showing how to use these RESTful API to control Aura-sync devices.

SDK API

URI

The URI of Aura RESTful server is http://127.0.0.1:27339/AuraSDK. Developer only need to create JSON formatted string and POST it to this local URI to control device LED.

Initialization

Acquire LED control

  • URL

    /AuraSDK

  • Method

    POST

  • JSON

    Field Description Type
    "category" Should be set to "SDK". String
    {
    "category": "SDK"
    }
  • Return

    Field Description Type
    "result" Return code, defined in Appendix C String
    {
    "result" : "0"
    }

UnInitialization

Release control of all Aura devices. The LED effects of all Aura devices will be set to default effect.

  • URL

    /AuraSDK

  • Method

    DELETE

  • Return
    Field Description Type
    "result" Return code, defined in Appendix C String

Get connected device information

Get all connected devices information included led count, width, height.

  • URL

    /AuraSDK/AuraDevice

  • Method

    GET

  • Return

    Field Description Type
    "count" Device led count String
    "width" Device led width String
    "height" Device led height String
    "result" Return code String
    {
    "Mouse" : {
    "count" : "3",
    "width" : "3",
    "height" : "1"
    },
    "NB_Keyboard" : {
    "count" : "168",
    "width" : "21",
    "height" : "8"
    },
    "result" : "0"
    }

Get keyboard device layout

Get coordinate for all keycode. Only used for Keyboard or NB_Keyboard device
Note: device_name is defined in Appendix B, keycode is defined in Appendix A.

  • URL

    /AuraSDK/device_name/layout

  • Method

    GET

  • Return

    Field Description Type
    "x" X coordinate of keycode String
    "y" Y coordinate of keycode String
    "result" Return code, defined in Appendix C String
    {
    "ROG_Key_0" : {
    "x" : "10",
    "y" : "2"
    },
    "ROG_Key_0" : {
    "x" : "1",
    "y" : "2"
    },
    ...skipped...
    "result" : "0"
    }

Set color on specific device

Set LED color by keycode or XY coordinate

  • URL

    /AuraSDK/AuraDevice

  • Method

    PUT

  • JSON

    Field Description Type
    "data" Array of key colors Array
    "device" Defined in Appendix B. String
    "range" "all": All leds on device
    "custom": XY coordinate or keycode
    String
    "x" X coordinate String
    "y" Y coordinate String
    "keycode" Defined in Appendix A Array
    "color" Color value in BGR format String
    "apply" "true": immediately light key
    "false": cached in buffer
    String

    If POST following JSON, it make the all keyboard key as green color, but cached in buffer.

    {
    "data" : [
    {
    "device" : "Keyboard",
    "range" : "all",
    "color" : "65280",
    "apply": "false"
    }
    ]
    }

    If POST following JSON, it will use the color stored in cached buffer to light keyboard key.

    {
    "data" : [
    {
    "device" : "Keyboard",
    "apply": "true"
    }
    ]
    }

    If POST following JSON, it make the keyboard key as green color on the coordinate (4, 4), red color on the coordinate (5, 5), and make the NB keyboard F1 and F2 key as red color.

    {
    "data" : [
    {
    "device" : "Keyboard",
    "range" : "custom",
    "x" : "4",
    "y" : "4",
    "color" : "65280",
    "apply": "true"
    },
    {
    "device" : "Keyboard ",
    "range" : "custom",
    "x" : "5",
    "y" : "5",
    "color" : "255",
    "apply": "true"
    },
    {
    "device" : "NB_Keyboard",
    "range" : "custom",
    "keycode" : ["59", "60"],
    "color" : "255",
    "apply": "true"
    }
    ]
    }
  • Return

    Field Description Type
    "result" Return code, defined in Appendix C String
    {
    "result" : "0"
    }

GameEvent API

In order to simplify light effect, we used gif file to show animation on Aura device. One gif represent one event (exclude KeyEvent).

Game event had three types: loop, oneshot, keyEvent.

  • Loop event: Event always exist(ex: Game idle, enter snow scene, player dead, etc..). There is only one loop event at the same time. It could be placed by another loop event.
  • Oneshot event: Event that are triggered from some game behavior(ex: shooting, cure, skill activate, etc..).
    If it already had a loop event, oneshot event animation will overlay loop event animation. While oneshot event animation finished, the loop event should continue its animation.
  • KeyEvent: Light some keys on keyboard or NB keyboard according to certain game states(ex: health percentage, hotkey which used by user). This event can't be overlayed by another event.

KeyEvent priority is the highest, oneshot event is the medium, and loop event is the lowest. It means if you bind "U" key and set color as red, "U" key always show red color. This key color can't be overlayed by loop event or oneshot event animation unless hotkey event were deleted.

Initialization

Acquire LED control

  • URL

    /AuraSDK

  • Method

    POST

  • JSON

    Field Description Type
    "category" Need to set "GameEvent" String
    {
    "category": "GameEvent"
    }
  • Return

    Field Description Type
    "result" Return code, defined in Appendix C String
    {
    "result" : "0"
    }

UnInitialization

Release control of all Aura devices. The LED effects of all Aura devices will be set to default effect.

  • URL

    /AuraSDK

  • Method

    DELETE

  • Return

    Field Description Type
    "result" Return code, defined in Appendix C String
    {
    "result" : "0"
    }

Send game event

Send game event. It can be a registered event or a preset event.

  • URL

    /AuraSDK/Event

  • Method

    POST

  • JSON

    Field Description Type
    "event" Event name, preset event name is defined in Appendix D String
    "health_data" Only used for health event It had three values: High, Medium, Low String
    "hotkey_data" Only used for hotkey event Array
    "keycode" Only used for hotkey event. Defined in Appendix A Array
    "color" Only used for hotkey event. Color value in BGR format String
    "behavior" Only used for hotkey event. Key light behavior It had one value: flashing. If want to stop flash, set it as empty String

    If POST following JSON, all connected devices will show Scene_snow effect.

    {
    "event": "Scene_snow"
    }

    Before using health event, it needed to bind health event. Please reference bind event API.
    If POST following JSON, keyboard and NB keyboard will show medium health bar on F1~F12 key.

    {
    "event": "Health",
    "health_data": "Medium"
    }

    Need to bind hotkey event first before using hotkey event. Please reference bind event API.
    If POST following JSON, the J, L key will flash green color, the K key will flash blue color on keyboard.

    {
    "event": "Hotkey",
    "hotkey_data": [
    {
    "keycode": ["36", "38"],
    "color": "65280",
    "behavior": "flashing"
    },
    {
    "keycode": ["37"],
    "color": "16711680",
    "behavior": "flashing"
    }
    ]
    }

    Continued with above JSON, following JSON will stop J, K and L key flashing on keyboard.

    {
    "event": " Hotkey",
    "hotkey_data": [
    {
    "keycode": ["36", "38"],
    "color": "65280",
    "behavior": ""
    },
    {
    "keycode": ["37"],
    "color": "16711680",
    "behavior": ""
    }
    ]
    }
  • Return

    Field Description Type
    "result" Return code, defined in Appendix C String
    {
    "result" : "0"
    }

Bind game event

Bind game event.

  • URL

    /AuraSDK/bind_event

  • Method

    POST

  • JSON

    Field Description Type
    "event" Event name, only support hotkey and health event String
    "hotkey_data" Only used for hotkey event Array
    "keycode" Only used for hotkey event. Defined in Appendix A Array
    "color" Only used for hotkey event. Color value in BGR format String

    If POST following JSON, it will bind health event. But keyboard won't show any color until sending health_data.

    {
    "event": "Health"
    }

    If POST following JSON, it will bind hotkey event with J, K, L keys. It also make J, L key as green color and K key as blue color on keyboard and NB keyboard.

    After binding hotkey event, the color of the bind keys can be modified by sending hotkey event with hotkey_data.

    If player changed hotkey while in game, please reference delete event API section to delete hotkey event and re-bind hotkey event again.

    {
    "event": "Hotkey",
    "hotkey_data": [
    {
    "keycode": ["36", "38"],
    "color": "65280"
    },
    {
    "keycode": ["37"],
    "color": "16711680"
    }
    ]
    }
  • Return
    Field Description Type
    "result" Return code, defined in Appendix C String

Register game event

Register customized event. Need to provide gif file which fit this event.

  • URL

    /AuraSDK/register_event

  • Method

    POST

  • JSON

    Field Description Type
    "event" Event name. It can't be set as preset event name String
    "type" Event type
    It had two values: Loop, Oneshot
    String
    "data" The absolute path of gif file String

    POST following JSON will register circle event which animation is represented by circle.gif.

    After registering it, it can be triggered by sending circle event to show animation on aura devices.

    {
    "event": "circle",
    "type": "Loop",
    "data": "D:\\gif\\circle.gif"
    }

    Because only two-dimension devices (keyboard and NB keyboard) can fully show circle animation. We suggested to provide two gif files: one gif for two-dimension device, and one gif for other one-dimension devices. The gif for one-dimension device needed to add prefix 1Zone_ to the file name.

    For above example, placed circle.gif and 1Zone_circle.gif in the same folder D:\\gif\\, then keyboard and NB keyboard will use circle.gif to show light effect and other aura devices will use 1Zone_circle.gif to show light effect.

  • Return
    Field Description Type
    "result" Return code, defined in Appendix C String

Delete game event

Delete event. If event is deleted, the corresponding light effect will disappear. Note: event_name defined in Appendix D. It also can be registered event name.

  • URL /AuraSDK/Event/event_name
  • Method

    DELETE

  • Return
    Field Description Type
    "result" Return code, defined in Appendix C String