Aura SDK provided RESTful API for developer to easily control Aura-sync devices.
You can download the HTML examples showing how to use these RESTful API to control Aura-sync devices.
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.
Acquire LED control
URL
/AuraSDK
Method
POST
JSON
| Field | Description | Type |
|---|---|---|
"category" | Should be set to "SDK". | String |
Return
| Field | Description | Type |
|---|---|---|
"result" | Return code, defined in Appendix C | String |
Release control of all Aura devices. The LED effects of all Aura devices will be set to default effect.
URL
/AuraSDK
Method
DELETE
| Field | Description | Type |
|---|---|---|
"result" | Return code, defined in Appendix C | String |
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 |
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 |
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.
If POST following JSON, it will use the color stored in cached buffer to light keyboard key.
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.
Return
| Field | Description | Type |
|---|---|---|
"result" | Return code, defined in Appendix C | String |
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.
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.
Acquire LED control
URL
/AuraSDK
Method
POST
JSON
| Field | Description | Type |
|---|---|---|
"category" | Need to set "GameEvent" | String |
Return
| Field | Description | Type |
|---|---|---|
"result" | Return code, defined in Appendix C | String |
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 |
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.
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.
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.
Continued with above JSON, following JSON will stop J, K and L key flashing on keyboard.
Return
| Field | Description | Type |
|---|---|---|
"result" | Return code, defined in Appendix C | String |
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.
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.
| Field | Description | Type |
|---|---|---|
"result" | Return code, defined in Appendix C | String |
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.
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.
| Field | Description | Type |
|---|---|---|
"result" | Return code, defined in Appendix C | String |
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.
Method
DELETE
| Field | Description | Type |
|---|---|---|
"result" | Return code, defined in Appendix C | String |