Document
Everything about obniz

obniz WebSocket Formats

Javascript以外からも,WebSocketを使うことでobnizを使うことができます.

WebSocketではJSONでデータのやり取りを行います.

ws

request: reset_obniz_on_ws_disconnection

path type conditions description
ws.reset_obniz_on_ws_disconnection boolean
  • required
 
// Json Example
[
    {
        "ws": {
            "reset_obniz_on_ws_disconnection": false
        }
    }
]

response: ready

all things ready

path type conditions description
ws.ready boolean
  • required
  • const true
 
//Response Example
[
    {
        "ws": {
            "ready": true
        }
    }
]

response: redirect

If the server required you to connect other endpoint to communicate with your obniz. This json will be sent.

path type conditions description
ws.redirect string
  • required
The url you should redirect to. 
//Response Example
[
    {
        "ws": {
            "redirect": "wss://ws1.obniz.io"
        }
    }
]

system

request: wait

path type conditions description
system.wait integer
  • required
wait time (ms) 
// Json Example
[
    {
        "system": {
            "wait": 500
        }
    }
]

request: reset

path type conditions description
system.reset boolean
  • required
  • const true
 
// Json Example
[
    {
        "system": {
            "reset": true
        }
    }
]

request: reboot

path type conditions description
system.reboot boolean
  • required
  • const true
 
// Json Example
[
    {
        "system": {
            "reboot": true
        }
    }
]

request: selfCheck

circuit IO check

path type conditions description
system.self_check boolean
  • required
  • const true
 
// Json Example
[
    {
        "system": {
            "self_check": true
        }
    }
]

request: keepWorkingAtOffline

reset obniz when obniz gone to offline.

path type conditions description
system.keep_working_at_offline boolean
  • required
 
// Json Example
[
    {
        "system": {
            "keep_working_at_offline": true
        }
    }
]

request: ping

path type conditions description
system.ping.key dataArray
  • required
 
// Json Example
[
    {
        "system": {
            "ping": {
                "key": [16, 34, 242]
            }
        }
    }
]

response: pong

path type conditions description
system.pong.key dataArray
  • required
 
//Response Example
[
    {
        "system": {
            "pong": {
                "key": [16, 34, 242]
            }
        }
    }
]

io

General purpose IO available on each io (io0 to io11).

request: input

Related item

path type conditions description
ioX string
  • required
  • const "get"
 
// Json Example
[
    {
        "io0": "get"
    }
]

request: input_detail

Related item

path type conditions description
ioX.direction string
  • required
  • const "input"
 
ioX.stream boolean   enable stream callback when value change 
// Json Example
[
    {
        "io0": {
            "direction": "input",
            "stream": false
        }
    }
]

request: output

path type conditions description
ioX boolean
  • required
 
// Json Example
[
    {
        "io0": true
    }
]

request: output_detail

path type conditions description
ioX.direction string
  • required
  • const "output"
 
ioX.value boolean
  • required
 
// Json Example
[
    {
        "io0": {
            "direction": "output",
            "value": true
        }
    }
]

request: output_type

path type conditions description
ioX.output_type string
  • required
  • enum
    • "push-pull5v"
    • "push-pull3v"
    • "open-drain"
drive type 
// Json Example
[
    {
        "io0": {
            "output_type": "push-pull5v"
        }
    }
]

request: pull_type

path type conditions description
ioX.pull_type string
  • required
  • enum
    • "pull-up5v"
    • "pull-up3v"
    • "pull-down"
    • "float"
 
// Json Example
[
    {
        "io0": {
            "pull_type": "pull-up5v"
        }
    }
]

request: deinit

path type conditions description
ioX null
  • required
 
// Json Example
[
    {
        "io0": null
    }
]

response: get

path type conditions description
ioX boolean
  • required
 
//Response Example
[
    {
        "io0": true
    }
]

ioAnimation

io animation is hardware acceleration for serial sequence change of io. now 'loop' animation is available. it loop io changes regarding json array.

request: init

path type conditions description
io.animation.animation.name string
  • required
  • 1 ≤ length ≤ 254
Animation name to use pause/resume 
io.animation.animation.status string
  • required
  • const "loop"
 
io.animation.animation.states[].duration integer
  • required
  • 0 ≤ value ≤ 60000
State duration time(ms) 
io.animation.animation.states[].state object,array   io/pwm commands. 
// Json Example
[
    {
        "io": {
            "animation": {
                "animation": {
                    "name": "animation-1",
                    "status": "loop",
                    "states": [
                        {
                            "duration": 500,
                            "state": {
                                "io0": true
                            }
                        },
                        {
                            "duration": 500,
                            "state": {
                                "io0": false
                            }
                        }
                    ]
                }
            }
        }
    }
]

request: changeState

path type conditions description
io.animation.animation.name string
  • required
  • 1 ≤ length ≤ 254
 
io.animation.animation.status string
  • required
  • enum
    • "pause"
    • "resume"
 
// Json Example
[
    {
        "io": {
            "animation": {
                "animation": {
                    "name": "animation-1",
                    "status": "pause"
                }
            }
        }
    }
]

available ad0~ad11

request: get

Related item

path type conditions description
adX.stream boolean
  • required
true to continuous notifying on voltage change. 
// Json Example
[
    {
        "ad0": {
            "stream": false
        }
    }
]

request: deinit

path type conditions description
adX null
  • required
 
// Json Example
[
    {
        "ad0": null
    }
]

response: get

current value (volt)

path type conditions description
adX number
  • required
  • 0 ≤ value ≤ 5
current value (volt) 
//Response Example
[
    {
        "ad0": 3.3
    }
]

pwm

available 0 to 5

request: init

path type conditions description
pwmX.io pinSetting
  • required
 
// Json Example
[
    {
        "pwm0": {
            "io": 0
        }
    }
]

request: freq

path type conditions description
pwmX.freq integer
  • required
  • 1 ≤ value ≤ 80000000
frequency (Hz) 
// Json Example
[
    {
        "pwm0": {
            "freq": 40000000
        }
    }
]

request: pulse

path type conditions description
pwmX.pulse number
  • required
  • 0 ≤ value
pulse width (ms) 
// Json Example
[
    {
        "pwm0": {
            "pulse": 500
        }
    }
]

request: modulate

path type conditions description
pwmX.modulate.type string
  • required
  • const "am"
 
pwmX.modulate.symbol_length number
  • required
  • 0.05 ≤ value ≤ 1000
symbol width (ms) 
pwmX.modulate.data bitArray
  • required
 
// Json Example
[
    {
        "pwm0": {
            "modulate": {
                "type": "am",
                "symbol_length": 500,
                "data": [0, 1, 1, 0, 0, 1, 1, 0]
            }
        }
    }
]

request: deinit

path type conditions description
pwmX null
  • required
 
// Json Example
[
    {
        "pwm0": null
    }
]

uart

request: init

available 0 to 1

path type conditions description
uartX.rx pinSetting
  • required
 
uartX.tx pinSetting
  • required
 
uartX.baud integer
  • default 115200
  • 1 ≤ value ≤ 5000000
baud rate (bps) 
uartX.stop number
  • default 1
  • enum
    • 1
    • 1.5
    • 2
stop bit width 
uartX.bits integer
  • default 8
  • enum
    • 5
    • 6
    • 7
    • 8
 
uartX.parity string
  • default off
  • enum
    • "off"
    • "odd"
    • "even"
 
uartX.flowcontrol string
  • default off
  • enum
    • "off"
    • "rts"
    • "cts"
    • "rts-cts"
 
uartX.rts pinSetting    
uartX.cts pinSetting    
// Json Example
[
    {
        "uart0": {
            "rx": 0,
            "tx": 1,
            "baud": 115200,
            "stop": 1,
            "bits": 8,
            "parity": "off",
            "flowcontrol": "off",
            "rts": 2,
            "cts": 3
        }
    }
]

request: send

path type conditions description
uartX.data dataArray
  • required
 
// Json Example
[
    {
        "uart0": {
            "data": [16, 34, 242]
        }
    }
]

request: deinit

path type conditions description
uartX null
  • required
 
// Json Example
[
    {
        "uart0": null
    }
]

response: receive

path type conditions description
uartX.data dataArray    
//Response Example
[
    {
        "uart0": {
            "data": [16, 34, 242]
        }
    }
]

spi

available spi0, spi1

request: init_master

clk, miso, mosi are optional, but at least one are required

path type conditions description
spiX.mode string
  • required
  • const "master"
 
spiX.clk pinSetting    
spiX.mosi pinSetting    
spiX.miso pinSetting    
spiX.clock integer
  • required
  • 1 ≤ value ≤ 26000000
 
// Json Example
[
    {
        "spi0": {
            "mode": "master",
            "clk": 0,
            "mosi": 1,
            "miso": 2,
            "clock": 115200
        }
    }
]

request: deinit

path type conditions description
spiX null
  • required
 
// Json Example
[
    {
        "spi0": null
    }
]

request: write

Related item

path type conditions description
spiX.data dataArray1024
  • required
 
spiX.read boolean
  • required
If false, write without receive 
// Json Example
[
    {
        "spi0": {
            "data": [100, 255, 21, 0, 21],
            "read": true
        }
    }
]

response: read

path type conditions description
spiX.data dataArray
  • required
 
//Response Example
[
    {
        "spi0": {
            "data": [16, 34, 242]
        }
    }
]

i2c

available only i2c0

request: init_master

internal pull-up is available. But, We recommend use external pull-up resistor.

path type conditions description
i2cX.mode string
  • required
  • const "master"
 
i2cX.sda pinSetting
  • required
 
i2cX.scl pinSetting
  • required
 
i2cX.clock integer
  • required
  • 1 ≤ value ≤ 1000000
frequency (Hz) 
// Json Example
[
    {
        "i2c0": {
            "mode": "master",
            "sda": 0,
            "scl": 1,
            "clock": 500000
        }
    }
]

request: init_slave

Related item

path type conditions description
i2cX.mode string
  • required
  • enum
    • "master"
    • "slave"
 
i2cX.sda pinSetting
  • required
 
i2cX.scl pinSetting
  • required
 
i2cX.slave_address integer
  • required
  • 0 ≤ value ≤ 1023
 
i2cX.slave_address_length integer
  • default 7
  • const 7
 
i2cX.address integer
  • 0 ≤ value ≤ 1023
 
i2cX.address_bits integer
  • default 7
  • const 7
 
i2cX.data dataArray    
i2cX.read integer
  • 0 ≤ value
 
// Json Example
[
    {
        "i2c0": {
            "mode": "master",
            "sda": 0,
            "scl": 1,
            "slave_address": 511,
            "slave_address_length": 7,
            "address": 511,
            "address_bits": 7,
            "data": [16, 34, 242],
            "read": 500
        }
    }
]

request: write

if address over 0b01111111; then address treated as 10bit address automatically. or specify address_bits: 10 to force 10bit address mode.

path type conditions description
i2cX.address integer
  • required
  • 0 ≤ value ≤ 1023
 
i2cX.address_bits integer
  • default 7
  • const 7
 
i2cX.data dataArray1024
  • required
 
// Json Example
[
    {
        "i2c0": {
            "address": 511,
            "address_bits": 7,
            "data": [100, 255, 21, 0, 21]
        }
    }
]

request: read

if address over 0b01111111; then address treated as 10bit address automatically. or specify address_bits: 10 to force 10bit address mode.

Related item

path type conditions description
i2cX.address integer
  • required
  • 0 ≤ value ≤ 1023
 
i2cX.address_bits integer
  • default 7
  • const 7
 
i2cX.read integer
  • required
  • 0 ≤ value ≤ 1024
 
// Json Example
[
    {
        "i2c0": {
            "address": 511,
            "address_bits": 7,
            "read": 512
        }
    }
]

request: deinit

path type conditions description
i2cX null
  • required
 
// Json Example
[
    {
        "i2c0": null
    }
]

response: master

path type conditions description
i2cX.mode string
  • required
  • const "master"
 
i2cX.address integer
  • required
  • 0 ≤ value ≤ 1023
 
i2cX.data dataArray
  • required
 
//Response Example
[
    {
        "i2c0": {
            "mode": "master",
            "address": 511,
            "data": [16, 34, 242]
        }
    }
]

response: slave

path type conditions description
i2cX.mode string
  • required
  • const "slave"
 
i2cX.address integer
  • required
  • 0 ≤ value ≤ 1023
 
i2cX.is_fragmented boolean
  • required
 
i2cX.data dataArray
  • required
 
//Response Example
[
    {
        "i2c0": {
            "mode": "slave",
            "address": 511,
            "is_fragmented": true,
            "data": [16, 34, 242]
        }
    }
]

logicAnalyzer

Monitor io logic level changes by sampling io.

request: init

path type conditions description
logic_analyzer.io[] pinSetting
  • required
 
logic_analyzer.interval number
  • required
  • 0 < value
 
logic_analyzer.duration integer
  • required
  • 0 < value
 
logic_analyzer.trigger.value boolean
  • required
start value 
logic_analyzer.trigger.samples integer
  • required
  • 0 ≤ value
how that values consists 

With below sample code, you will receive only data which start with 'false, false, false' 3bit.

// Json Example
[
    {
        "logic_analyzer": {
            "io": [ 0],
            "interval": 500,
            "duration": 500,
            "trigger": {
                "value": false,
                "samples": 3
            }
        }
    }
]

request: deinit

path type conditions description
logic_analyzer null
  • required
 
// Json Example
[
    {
        "logic_analyzer": null
    }
]

response: data

path type conditions description
logic_analyzer.data bitArray
  • required
 
//Response Example
[
    {
        "logic_analyzer": {
            "data": [0, 1, 1, 0, 0, 1, 1, 0]
        }
    }
]

measure

request: echo

It measures pulse response.

Related item

path type conditions description
measure.echo.io_pulse pinSetting
  • required
 
measure.echo.io_echo pinSetting
  • required
 
measure.echo.pulse string
  • default positive
  • enum
    • "positive"
    • "negative"
 
measure.echo.pulse_width number
  • required
  • 0.001 ≤ value ≤ 1000
 
measure.echo.measure_edges integer
  • 1 ≤ value ≤ 4
 
measure.echo.timeout number
  • default 1000
  • 0.001 ≤ value ≤ 1000
 
// Json Example
[
    {
        "measure": {
            "echo": {
                "io_pulse": 0,
                "io_echo": 1,
                "pulse": "positive",
                "pulse_width": 500,
                "measure_edges": 2,
                "timeout": 1000
            }
        }
    }
]

response: echo

path type conditions description
measure.echo[].edge boolean
  • required
rising = true 
measure.echo[].timing number
  • required
milliseconds from end of pulse 
//Response Example
[
    {
        "measure": {
            "echo": [
                {
                    "edge": true,
                    "timing": 500
                }
            ]
        }
    }
]

display

request: text

path type conditions description
display.text string
  • required
 
// Json Example
[
    {
        "display": {
            "text": "Hello, obniz!"
        }
    }
]

request: clear

path type conditions description
display.clear boolean
  • required
  • const true
 
// Json Example
[
    {
        "display": {
            "clear": true
        }
    }
]

request: qr

path type conditions description
display.qr.text string
  • required
 
display.qr.correction string
  • default M
  • enum
    • "L"
    • "M"
    • "Q"
    • "H"
 
// Json Example
[
    {
        "display": {
            "qr": {
                "text": "Hello, obniz!",
                "correction": "M"
            }
        }
    }
]

request: raw

1 bit represents 1 dot. 1=white, 0=black. 1 byte is part of one line. Order is same like.
{1byte} {2byte} {3byte}...{16byte}
{17byte} {18byte} {19byte}...
.....
.....................{1024byte}

path type conditions description
display.raw imageData128x64
  • required
 
// Json Example
[
    {
        "display": {
            "raw": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 240, 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 255, 224, 120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 255, 192, 240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 255, 129, 248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 255, 255, 3, 254, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 255, 254, 7, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 255, 252, 15, 255, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 255, 248, 31, 255, 192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 255, 240, 63, 255, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 255, 224, 127, 255, 240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 255, 192, 255, 255, 248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 129, 255, 255, 252, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 255, 255, 3, 255, 255, 254, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 255, 254, 7, 255, 255, 254, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 255, 252, 15, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 255, 248, 31, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 255, 240, 63, 255, 255, 255, 128, 0, 0, 0, 0, 0, 0, 0, 0, 7, 255, 224, 127, 193, 255, 255, 128, 0, 0, 0, 0, 0, 0, 0, 0, 15, 252, 64, 255, 128, 255, 255, 128, 0, 0, 0, 0, 0, 0, 0, 0, 15, 240, 1, 255, 0, 127, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 224, 3, 254, 0, 127, 254, 14, 0, 0, 0, 0, 0, 0, 0, 0, 31, 224, 7, 254, 0, 63, 252, 30, 0, 0, 0, 0, 0, 0, 0, 0, 31, 224, 7, 254, 0, 63, 248, 60, 0, 0, 0, 0, 0, 0, 0, 0, 31, 192, 7, 254, 0, 63, 240, 120, 0, 0, 0, 0, 0, 0, 0, 0, 31, 192, 7, 254, 0, 127, 224, 240, 0, 0, 0, 0, 0, 0, 0, 0, 31, 224, 7, 252, 0, 127, 193, 224, 0, 0, 0, 0, 0, 0, 0, 0, 31, 224, 15, 248, 0, 255, 131, 224, 0, 0, 0, 0, 0, 0, 0, 0, 31, 240, 31, 240, 39, 255, 7, 224, 0, 0, 0, 0, 0, 0, 0, 0, 31, 252, 63, 224, 127, 254, 15, 224, 0, 0, 0, 0, 0, 0, 0, 0, 31, 255, 255, 192, 255, 252, 31, 224, 0, 0, 0, 0, 0, 0, 0, 0, 31, 255, 255, 129, 255, 248, 63, 224, 0, 0, 0, 0, 0, 0, 0, 0, 31, 255, 255, 3, 255, 240, 127, 224, 0, 0, 0, 0, 0, 0, 0, 0, 31, 255, 254, 7, 255, 224, 255, 224, 0, 0, 0, 0, 0, 0, 0, 0, 31, 255, 252, 15, 255, 193, 255, 192, 0, 0, 0, 0, 0, 0, 0, 0, 15, 255, 248, 31, 255, 131, 255, 192, 0, 0, 0, 0, 0, 0, 0, 0, 15, 255, 240, 63, 255, 7, 255, 192, 0, 0, 0, 0, 0, 0, 0, 0, 15, 255, 224, 127, 254, 15, 255, 192, 0, 0, 0, 0, 0, 0, 0, 0, 15, 255, 192, 255, 252, 31, 255, 128, 0, 0, 0, 0, 0, 0, 0, 0, 7, 255, 129, 255, 0, 63, 255, 128, 0, 0, 0, 0, 0, 0, 0, 0, 7, 255, 3, 254, 0, 127, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 254, 7, 252, 0, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 252, 15, 252, 0, 255, 254, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 248, 31, 252, 0, 255, 254, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 240, 63, 252, 0, 255, 252, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 127, 252, 0, 255, 252, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 255, 252, 0, 255, 248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 255, 254, 1, 255, 240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 255, 255, 3, 255, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 255, 255, 255, 255, 192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 255, 255, 255, 255, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 255, 255, 255, 254, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 255, 255, 255, 252, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 255, 255, 240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 255, 255, 192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
        }
    }
]

request: pin_assign

path type conditions description
display.pin_assign.X.module_name string    
display.pin_assign.X.pin_name string    
// Json Example
[
    {
        "display": {
            "pin_assign": {
                "0": {
                    "module_name": "io",
                    "pin_name": "output"
                }
            }
        }
    }
]

switch

the switch embed on obniz itself. If it's state is changed, notification will be fired.

request: get

Related item

path type conditions description
switch string
  • required
  • const "get"
 
// Json Example
[
    {
        "switch": "get"
    }
]

response: change

path type conditions description
switch.state string
  • required
  • enum
    • "none"
    • "push"
    • "left"
    • "right"
 
switch.action string
  • const "get"
this is optional and added when user request 
//Response Example
[
    {
        "switch": {
            "state": "none",
            "action": "get"
        }
    }
]

ble.central

use obniz as central

request: scan_start

Related item

path type conditions description
ble.scan.duration integer
  • default 30
 
// Json Example
[
    {
        "ble": {
            "scan": {
                "duration": 30
            }
        }
    }
]

request: scan_stop

path type conditions description
ble.scan null
  • required
 
// Json Example
[
    {
        "ble": {
            "scan": null
        }
    }
]

request: connect

Related item

path type conditions description
ble.connect.address deviceAddress
  • required
 
// Json Example
[
    {
        "ble": {
            "connect": {
                "address": "77e754ab8591"
            }
        }
    }
]

request: disconnect

path type conditions description
ble.disconnect.address deviceAddress
  • required
 
// Json Example
[
    {
        "ble": {
            "disconnect": {
                "address": "77e754ab8591"
            }
        }
    }
]

request: service_get

Related item

path type conditions description
ble.get_services.address deviceAddress
  • required
 
// Json Example
[
    {
        "ble": {
            "get_services": {
                "address": "77e754ab8591"
            }
        }
    }
]

request: characteristic_get

Related item

path type conditions description
ble.get_characteristics.address deviceAddress
  • required
 
ble.get_characteristics.service_uuid uuid
  • required
 
// Json Example
[
    {
        "ble": {
            "get_characteristics": {
                "address": "77e754ab8591",
                "service_uuid": "e1cfb0d1-ae63-4d6f-b3b6-de2054f87e5e"
            }
        }
    }
]

request: characteristic_read

Related item

path type conditions description
ble.read_characteristic.address deviceAddress
  • required
 
ble.read_characteristic.service_uuid uuid
  • required
 
ble.read_characteristic.characteristic_uuid uuid
  • required
 
// Json Example
[
    {
        "ble": {
            "read_characteristic": {
                "address": "77e754ab8591",
                "service_uuid": "e1cfb0d1-ae63-4d6f-b3b6-de2054f87e5e",
                "characteristic_uuid": "8d3591bda71140fd8f9f00535fe57179"
            }
        }
    }
]

request: characteristic_write

Related item

path type conditions description
ble.write_characteristic.address deviceAddress
  • required
 
ble.write_characteristic.service_uuid uuid
  • required
 
ble.write_characteristic.characteristic_uuid uuid
  • required
 
ble.write_characteristic.data dataArray
  • required
 
ble.write_characteristic.needResponse boolean
  • default true
 
// Json Example
[
    {
        "ble": {
            "write_characteristic": {
                "address": "77e754ab8591",
                "service_uuid": "e1cfb0d1-ae63-4d6f-b3b6-de2054f87e5e",
                "characteristic_uuid": "8d3591bda71140fd8f9f00535fe57179",
                "data": [16, 34, 242],
                "needResponse": true
            }
        }
    }
]

request: characteristic_register_notify

Related item

path type conditions description
ble.register_notify_characteristic.address deviceAddress
  • required
 
ble.register_notify_characteristic.service_uuid uuid
  • required
 
ble.register_notify_characteristic.characteristic_uuid uuid
  • required
 
// Json Example
[
    {
        "ble": {
            "register_notify_characteristic": {
                "address": "77e754ab8591",
                "service_uuid": "e1cfb0d1-ae63-4d6f-b3b6-de2054f87e5e",
                "characteristic_uuid": "8d3591bda71140fd8f9f00535fe57179"
            }
        }
    }
]

request: characteristic_unregister_notify

Related item

path type conditions description
ble.unregister_notify_characteristic.address deviceAddress
  • required
 
ble.unregister_notify_characteristic.service_uuid uuid
  • required
 
ble.unregister_notify_characteristic.characteristic_uuid uuid
  • required
 
// Json Example
[
    {
        "ble": {
            "unregister_notify_characteristic": {
                "address": "77e754ab8591",
                "service_uuid": "e1cfb0d1-ae63-4d6f-b3b6-de2054f87e5e",
                "characteristic_uuid": "8d3591bda71140fd8f9f00535fe57179"
            }
        }
    }
]

request: descriptor_get

Related item

path type conditions description
ble.get_descriptors.address deviceAddress
  • required
 
ble.get_descriptors.service_uuid uuid
  • required
 
ble.get_descriptors.characteristic_uuid uuid
  • required
 
// Json Example
[
    {
        "ble": {
            "get_descriptors": {
                "address": "77e754ab8591",
                "service_uuid": "e1cfb0d1-ae63-4d6f-b3b6-de2054f87e5e",
                "characteristic_uuid": "8d3591bda71140fd8f9f00535fe57179"
            }
        }
    }
]

request: descriptor_read

Related item

path type conditions description
ble.read_descriptor.address deviceAddress
  • required
 
ble.read_descriptor.service_uuid uuid
  • required
 
ble.read_descriptor.characteristic_uuid uuid
  • required
 
ble.read_descriptor.descriptor_uuid uuid
  • required
 
// Json Example
[
    {
        "ble": {
            "read_descriptor": {
                "address": "77e754ab8591",
                "service_uuid": "e1cfb0d1-ae63-4d6f-b3b6-de2054f87e5e",
                "characteristic_uuid": "8d3591bda71140fd8f9f00535fe57179",
                "descriptor_uuid": "d822b53c"
            }
        }
    }
]

request: descriptor_write

Related item

path type conditions description
ble.write_descriptor.address deviceAddress
  • required
 
ble.write_descriptor.service_uuid uuid
  • required
 
ble.write_descriptor.characteristic_uuid uuid
  • required
 
ble.write_descriptor.descriptor_uuid uuid
  • required
 
ble.write_descriptor.data dataArray
  • required
 
ble.write_descriptor.needResponse boolean
  • default true
 
// Json Example
[
    {
        "ble": {
            "write_descriptor": {
                "address": "77e754ab8591",
                "service_uuid": "e1cfb0d1-ae63-4d6f-b3b6-de2054f87e5e",
                "characteristic_uuid": "8d3591bda71140fd8f9f00535fe57179",
                "descriptor_uuid": "d822b53c",
                "data": [16, 34, 242],
                "needResponse": true
            }
        }
    }
]

response: scan

path type conditions description
ble.scan_result.address deviceAddress
  • required
 
ble.scan_result.ble_event_type string
  • required
  • enum
    • "connectable_advertisemnt"
    • "connectable_directed_advertisemnt"
    • "scannable_advertising"
    • "non_connectable_advertising"
    • "scan_response"
 
ble.scan_result.device_type string
  • required
  • enum
    • "ble"
    • "dumo"
    • "breder"
 
ble.scan_result.address_type string
  • required
  • enum
    • "public"
    • "random"
    • "rpa_public"
    • "rpa_random"
 
ble.scan_result.flag integer
  • required
  • 0 ≤ value
 
ble.scan_result.rssi integer
  • required
  • value ≤ 0
 
ble.scan_result.adv_data bleAdvertiseData    
ble.scan_result.scan_resp bleAdvertiseData    
//Response Example
[
    {
        "ble": {
            "scan_result": {
                "address": "77e754ab8591",
                "ble_event_type": "connectable_advertisemnt",
                "device_type": "ble",
                "address_type": "public",
                "flag": 500,
                "rssi": 500,
                "adv_data": [2, 1, 26, 7, 9, 83, 97, 109, 112, 108, 101],
                "scan_resp": [7, 9, 83, 97, 109, 112, 108, 101]
            }
        }
    }
]

response: scan_finish

path type conditions description
ble.scan_result_finish boolean
  • required
  • const true
 
//Response Example
[
    {
        "ble": {
            "scan_result_finish": true
        }
    }
]

response: status_update

path type conditions description
ble.status_update.address deviceAddress
  • required
 
ble.status_update.status string
  • required
  • enum
    • "connected"
    • "disconnected"
 
//Response Example
[
    {
        "ble": {
            "status_update": {
                "address": "77e754ab8591",
                "status": "connected"
            }
        }
    }
]

response: service_get

path type conditions description
ble.get_service_result.address deviceAddress
  • required
 
ble.get_service_result.service_uuid uuid
  • required
 
//Response Example
[
    {
        "ble": {
            "get_service_result": {
                "address": "77e754ab8591",
                "service_uuid": "e1cfb0d1-ae63-4d6f-b3b6-de2054f87e5e"
            }
        }
    }
]

response: service_get_finish

path type conditions description
ble.get_service_result_finish.address deviceAddress
  • required
 
//Response Example
[
    {
        "ble": {
            "get_service_result_finish": {
                "address": "77e754ab8591"
            }
        }
    }
]

response: characteristic_get

path type conditions description
ble.get_characteristic_result.address deviceAddress
  • required
 
ble.get_characteristic_result.service_uuid uuid
  • required
 
ble.get_characteristic_result.characteristic_uuid uuid
  • required
 
ble.get_characteristic_result.properties[] string
  • enum
    • "broadcast"
    • "read"
    • "write_without_response"
    • "write"
    • "notify"
    • "indicate"
    • "auth"
    • "extended_properties"
 
//Response Example
[
    {
        "ble": {
            "get_characteristic_result": {
                "address": "77e754ab8591",
                "service_uuid": "e1cfb0d1-ae63-4d6f-b3b6-de2054f87e5e",
                "characteristic_uuid": "8d3591bda71140fd8f9f00535fe57179",
                "properties": [
                    "broadcast"
                ]
            }
        }
    }
]

response: characteristic_get_finish

path type conditions description
ble.get_characteristic_result_finish.address deviceAddress
  • required
 
ble.get_characteristic_result_finish.service_uuid uuid
  • required
 
//Response Example
[
    {
        "ble": {
            "get_characteristic_result_finish": {
                "address": "77e754ab8591",
                "service_uuid": "e1cfb0d1-ae63-4d6f-b3b6-de2054f87e5e"
            }
        }
    }
]

response: characteristic_write

path type conditions description
ble.write_characteristic_result.address deviceAddress
  • required
 
ble.write_characteristic_result.service_uuid uuid
  • required
 
ble.write_characteristic_result.characteristic_uuid uuid
  • required
 
ble.write_characteristic_result.result string
  • required
  • enum
    • "success"
    • "failed"
 
//Response Example
[
    {
        "ble": {
            "write_characteristic_result": {
                "address": "77e754ab8591",
                "service_uuid": "e1cfb0d1-ae63-4d6f-b3b6-de2054f87e5e",
                "characteristic_uuid": "8d3591bda71140fd8f9f00535fe57179",
                "result": "success"
            }
        }
    }
]

response: characteristic_read

path type conditions description
ble.read_characteristic_result.address deviceAddress
  • required
 
ble.read_characteristic_result.service_uuid uuid
  • required
 
ble.read_characteristic_result.characteristic_uuid uuid
  • required
 
ble.read_characteristic_result.result string
  • required
  • enum
    • "success"
    • "failed"
 
ble.read_characteristic_result.data dataArray
  • required
 
//Response Example
[
    {
        "ble": {
            "read_characteristic_result": {
                "address": "77e754ab8591",
                "service_uuid": "e1cfb0d1-ae63-4d6f-b3b6-de2054f87e5e",
                "characteristic_uuid": "8d3591bda71140fd8f9f00535fe57179",
                "result": "success",
                "data": [16, 34, 242]
            }
        }
    }
]

response: characteristic_register_notify

Related item

path type conditions description
ble.characteristic_register_notify_result.address deviceAddress
  • required
 
ble.characteristic_register_notify_result.service_uuid uuid
  • required
 
ble.characteristic_register_notify_result.characteristic_uuid uuid
  • required
 
ble.characteristic_register_notify_result.result boolean
  • required
 
//Response Example
[
    {
        "ble": {
            "characteristic_register_notify_result": {
                "address": "77e754ab8591",
                "service_uuid": "e1cfb0d1-ae63-4d6f-b3b6-de2054f87e5e",
                "characteristic_uuid": "8d3591bda71140fd8f9f00535fe57179",
                "result": true
            }
        }
    }
]

response: characteristic_notify

path type conditions description
ble.nofity_characteristic.address deviceAddress
  • required
 
ble.nofity_characteristic.service_uuid uuid
  • required
 
ble.nofity_characteristic.characteristic_uuid uuid
  • required
 
ble.nofity_characteristic.data dataArray
  • required
 
//Response Example
[
    {
        "ble": {
            "nofity_characteristic": {
                "address": "77e754ab8591",
                "service_uuid": "e1cfb0d1-ae63-4d6f-b3b6-de2054f87e5e",
                "characteristic_uuid": "8d3591bda71140fd8f9f00535fe57179",
                "data": [16, 34, 242]
            }
        }
    }
]

response: characteristic_notify

path type conditions description
ble.nofity_characteristic.address deviceAddress
  • required
 
ble.nofity_characteristic.service_uuid uuid
  • required
 
ble.nofity_characteristic.characteristic_uuid uuid
  • required
 
ble.nofity_characteristic.data dataArray
  • required
 
//Response Example
[
    {
        "ble": {
            "nofity_characteristic": {
                "address": "77e754ab8591",
                "service_uuid": "e1cfb0d1-ae63-4d6f-b3b6-de2054f87e5e",
                "characteristic_uuid": "8d3591bda71140fd8f9f00535fe57179",
                "data": [16, 34, 242]
            }
        }
    }
]

response: descriptor_get

path type conditions description
ble.get_descriptor_result.address deviceAddress
  • required
 
ble.get_descriptor_result.service_uuid uuid
  • required
 
ble.get_descriptor_result.characteristic_uuid uuid
  • required
 
ble.get_descriptor_result.descriptor_uuid uuid
  • required
 
//Response Example
[
    {
        "ble": {
            "get_descriptor_result": {
                "address": "77e754ab8591",
                "service_uuid": "e1cfb0d1-ae63-4d6f-b3b6-de2054f87e5e",
                "characteristic_uuid": "8d3591bda71140fd8f9f00535fe57179",
                "descriptor_uuid": "d822b53c"
            }
        }
    }
]

response: descriptor_get_finish

path type conditions description
ble.get_descriptor_result_finish.address deviceAddress
  • required
 
ble.get_descriptor_result_finish.service_uuid uuid
  • required
 
ble.get_descriptor_result_finish.characteristic_uuid uuid
  • required
 
//Response Example
[
    {
        "ble": {
            "get_descriptor_result_finish": {
                "address": "77e754ab8591",
                "service_uuid": "e1cfb0d1-ae63-4d6f-b3b6-de2054f87e5e",
                "characteristic_uuid": "8d3591bda71140fd8f9f00535fe57179"
            }
        }
    }
]

response: descriptor_write

path type conditions description
ble.write_descriptor_results.address deviceAddress
  • required
 
ble.write_descriptor_results.service_uuid uuid
  • required
 
ble.write_descriptor_results.characteristic_uuid uuid
  • required
 
ble.write_descriptor_results.descriptor_uuid uuid
  • required
 
ble.write_descriptor_results.result string
  • required
  • enum
    • "success"
    • "failed"
 
//Response Example
[
    {
        "ble": {
            "write_descriptor_results": {
                "address": "77e754ab8591",
                "service_uuid": "e1cfb0d1-ae63-4d6f-b3b6-de2054f87e5e",
                "characteristic_uuid": "8d3591bda71140fd8f9f00535fe57179",
                "descriptor_uuid": "d822b53c",
                "result": "success"
            }
        }
    }
]

response: descriptor_read

path type conditions description
ble.read_descriptor_results.address deviceAddress
  • required
 
ble.read_descriptor_results.service_uuid uuid
  • required
 
ble.read_descriptor_results.characteristic_uuid uuid
  • required
 
ble.read_descriptor_results.descriptor_uuid uuid
  • required
 
ble.read_descriptor_results.result string
  • required
  • enum
    • "success"
    • "failed"
 
ble.read_descriptor_results.data dataArray
  • required
 
//Response Example
[
    {
        "ble": {
            "read_descriptor_results": {
                "address": "77e754ab8591",
                "service_uuid": "e1cfb0d1-ae63-4d6f-b3b6-de2054f87e5e",
                "characteristic_uuid": "8d3591bda71140fd8f9f00535fe57179",
                "descriptor_uuid": "d822b53c",
                "result": "success",
                "data": [16, 34, 242]
            }
        }
    }
]

response: error

path type conditions description
ble.error.error_code integer
  • required
 
ble.error.message string
  • required
 
ble.error.address deviceAddress    
ble.error.service_uuid uuidOrNull    
ble.error.characteristic_uuid uuidOrNull    
ble.error.descriptor_uuid uuidOrNull    
//Response Example
[
    {
        "ble": {
            "error": {
                "error_code": 0,
                "message": "ERROR MESSAGE",
                "address": "77e754ab8591",
                "service_uuid": "e1cfb0d1-ae63-4d6f-b3b6-de2054f87e5e",
                "characteristic_uuid": "8d3591bda71140fd8f9f00535fe57179",
                "descriptor_uuid": "d822b53c"
            }
        }
    }
]

ble.peripheral

use obniz as peripheral

request: advertisement_start

Related item

path type conditions description
ble.advertisement.adv_data bleAdvertiseData
  • required
 
ble.advertisement.scan_resp bleAdvertiseData    
// Json Example
[
    {
        "ble": {
            "advertisement": {
                "adv_data": [2, 1, 26, 7, 9, 83, 97, 109, 112, 108, 101],
                "scan_resp": [7, 9, 83, 97, 109, 112, 108, 101]
            }
        }
    }
]

request: advertisement_stop

path type conditions description
ble.advertisement null
  • required
 
// Json Example
[
    {
        "ble": {
            "advertisement": null
        }
    }
]

request: service_start

callback of external device connected

Related item

path type conditions description
ble.peripheral.services[].uuid uuid
  • required
 
ble.peripheral.services[].characteristics[].uuid uuid
  • required
 
ble.peripheral.services[].characteristics[].data dataArray    
ble.peripheral.services[].characteristics[].properties[] string
  • enum
    • "broadcast"
    • "read"
    • "write_without_response"
    • "write"
    • "notify"
    • "indicate"
    • "auth"
    • "extended_properties"
 
ble.peripheral.services[].characteristics[].permissions[] string
  • default read,write
  • enum
    • "read"
    • "write"
 
ble.peripheral.services[].characteristics[].descriptors[].uuid uuid
  • required
 
ble.peripheral.services[].characteristics[].descriptors[].data dataArray    
ble.peripheral.services[].characteristics[].descriptors[].permissions[] string
  • default read,write
  • enum
    • "read"
    • "write"
 
// Json Example
[
    {
        "ble": {
            "peripheral": {
                "services": [
                    {
                        "uuid": "e1cfb0d1-ae63-4d6f-b3b6-de2054f87e5e",
                        "characteristics": [
                            {
                                "uuid": "8d3591bda71140fd8f9f00535fe57179",
                                "data": [16, 34, 242],
                                "properties": [
                                    "broadcast"
                                ],
                                "permissions": [
                                    [
                                        "read",
                                        "write"
                                    ]
                                ],
                                "descriptors": [
                                    {
                                        "uuid": "d822b53c",
                                        "data": [100, 255, 21, 0, 21],
                                        "permissions": [
                                            [
                                                "read",
                                                "write"
                                            ]
                                        ]
                                    }
                                ]
                            }
                        ]
                    }
                ]
            }
        }
    }
]

request: service_stop

path type conditions description
ble.peripheral.stop_service.service_uuid uuid
  • required
 
// Json Example
[
    {
        "ble": {
            "peripheral": {
                "stop_service": {
                    "service_uuid": "e1cfb0d1-ae63-4d6f-b3b6-de2054f87e5e"
                }
            }
        }
    }
]

request: service_stop_all

path type conditions description
ble.peripheral null
  • required
 
// Json Example
[
    {
        "ble": {
            "peripheral": null
        }
    }
]

request: characteristic_read

read characteristic on own service

Related item

path type conditions description
ble.peripheral.read_characteristic.service_uuid uuid
  • required
 
ble.peripheral.read_characteristic.characteristic_uuid uuid
  • required
 
// Json Example
[
    {
        "ble": {
            "peripheral": {
                "read_characteristic": {
                    "service_uuid": "e1cfb0d1-ae63-4d6f-b3b6-de2054f87e5e",
                    "characteristic_uuid": "8d3591bda71140fd8f9f00535fe57179"
                }
            }
        }
    }
]

request: characteristic_write

write characteristic on own service

Related item

path type conditions description
ble.peripheral.write_characteristic.service_uuid uuid
  • required
 
ble.peripheral.write_characteristic.characteristic_uuid uuid
  • required
 
ble.peripheral.write_characteristic.data dataArray
  • required
 
// Json Example
[
    {
        "ble": {
            "peripheral": {
                "write_characteristic": {
                    "service_uuid": "e1cfb0d1-ae63-4d6f-b3b6-de2054f87e5e",
                    "characteristic_uuid": "8d3591bda71140fd8f9f00535fe57179",
                    "data": [16, 34, 242]
                }
            }
        }
    }
]

request: descriptor_read

read descriptor on own service

Related item

path type conditions description
ble.peripheral.read_descriptor.service_uuid uuid
  • required
 
ble.peripheral.read_descriptor.characteristic_uuid uuid
  • required
 
ble.peripheral.read_descriptor.descriptor_uuid uuid    
// Json Example
[
    {
        "ble": {
            "peripheral": {
                "read_descriptor": {
                    "service_uuid": "e1cfb0d1-ae63-4d6f-b3b6-de2054f87e5e",
                    "characteristic_uuid": "8d3591bda71140fd8f9f00535fe57179",
                    "descriptor_uuid": "d822b53c"
                }
            }
        }
    }
]

request: descriptor_write

write descriptor on own service

Related item

path type conditions description
ble.peripheral.write_descriptor.service_uuid uuid
  • required
 
ble.peripheral.write_descriptor.characteristic_uuid uuid
  • required
 
ble.peripheral.write_descriptor.descriptor_uuid uuid
  • required
 
ble.peripheral.write_descriptor.data dataArray
  • required
 
// Json Example
[
    {
        "ble": {
            "peripheral": {
                "write_descriptor": {
                    "service_uuid": "e1cfb0d1-ae63-4d6f-b3b6-de2054f87e5e",
                    "characteristic_uuid": "8d3591bda71140fd8f9f00535fe57179",
                    "descriptor_uuid": "d822b53c",
                    "data": [16, 34, 242]
                }
            }
        }
    }
]

response: status

path type conditions description
ble.peripheral.connection_status.address deviceAddress
  • required
 
ble.peripheral.connection_status.status string
  • required
  • enum
    • "connected"
    • "disconnected"
 
//Response Example
[
    {
        "ble": {
            "peripheral": {
                "connection_status": {
                    "address": "77e754ab8591",
                    "status": "connected"
                }
            }
        }
    }
]

response: characteristic_read

callback of read characteristic

path type conditions description
ble.peripheral.read_characteristic_result.service_uuid uuid
  • required
 
ble.peripheral.read_characteristic_result.characteristic_uuid uuid
  • required
 
ble.peripheral.read_characteristic_result.data dataArray
  • required
 
//Response Example
[
    {
        "ble": {
            "peripheral": {
                "read_characteristic_result": {
                    "service_uuid": "e1cfb0d1-ae63-4d6f-b3b6-de2054f87e5e",
                    "characteristic_uuid": "8d3591bda71140fd8f9f00535fe57179",
                    "data": [16, 34, 242]
                }
            }
        }
    }
]

response: characteristic_write

callback of write characteristic

path type conditions description
ble.peripheral.write_characteristic_result.service_uuid uuid
  • required
 
ble.peripheral.write_characteristic_result.characteristic_uuid uuid
  • required
 
ble.peripheral.write_characteristic_result.result string
  • required
  • enum
    • "success"
    • "failed"
 
//Response Example
[
    {
        "ble": {
            "peripheral": {
                "write_characteristic_result": {
                    "service_uuid": "e1cfb0d1-ae63-4d6f-b3b6-de2054f87e5e",
                    "characteristic_uuid": "8d3591bda71140fd8f9f00535fe57179",
                    "result": "success"
                }
            }
        }
    }
]

response: characteristic_notify_read

callback of external device read characteristic

path type conditions description
ble.peripheral.notify_read_characteristic.address deviceAddress
  • required
 
ble.peripheral.notify_read_characteristic.service_uuid uuid
  • required
 
ble.peripheral.notify_read_characteristic.characteristic_uuid uuid
  • required
 
//Response Example
[
    {
        "ble": {
            "peripheral": {
                "notify_read_characteristic": {
                    "address": "77e754ab8591",
                    "service_uuid": "e1cfb0d1-ae63-4d6f-b3b6-de2054f87e5e",
                    "characteristic_uuid": "8d3591bda71140fd8f9f00535fe57179"
                }
            }
        }
    }
]

response: characteristic_notify_write

callback of external device write characteristic

path type conditions description
ble.peripheral.notify_write_characteristic.address deviceAddress
  • required
 
ble.peripheral.notify_write_characteristic.service_uuid uuid
  • required
 
ble.peripheral.notify_write_characteristic.characteristic_uuid uuid
  • required
 
ble.peripheral.notify_write_characteristic.data dataArray
  • required
 
//Response Example
[
    {
        "ble": {
            "peripheral": {
                "notify_write_characteristic": {
                    "address": "77e754ab8591",
                    "service_uuid": "e1cfb0d1-ae63-4d6f-b3b6-de2054f87e5e",
                    "characteristic_uuid": "8d3591bda71140fd8f9f00535fe57179",
                    "data": [16, 34, 242]
                }
            }
        }
    }
]

response: descriptor_read

callback of read descriptor

path type conditions description
ble.peripheral.read_descriptor_result.service_uuid uuid
  • required
 
ble.peripheral.read_descriptor_result.characteristic_uuid uuid
  • required
 
ble.peripheral.read_descriptor_result.descriptor_uuid uuid
  • required
 
ble.peripheral.read_descriptor_result.data dataArray
  • required
 
//Response Example
[
    {
        "ble": {
            "peripheral": {
                "read_descriptor_result": {
                    "service_uuid": "e1cfb0d1-ae63-4d6f-b3b6-de2054f87e5e",
                    "characteristic_uuid": "8d3591bda71140fd8f9f00535fe57179",
                    "descriptor_uuid": "d822b53c",
                    "data": [16, 34, 242]
                }
            }
        }
    }
]

response: descriptor_write

callback of write descriptor

path type conditions description
ble.peripheral.write_descriptor_result.service_uuid uuid
  • required
 
ble.peripheral.write_descriptor_result.characteristic_uuid uuid
  • required
 
ble.peripheral.write_descriptor_result.descriptor_uuid uuid
  • required
 
ble.peripheral.write_descriptor_result.result string
  • required
  • enum
    • "success"
    • "failed"
 
//Response Example
[
    {
        "ble": {
            "peripheral": {
                "write_descriptor_result": {
                    "service_uuid": "e1cfb0d1-ae63-4d6f-b3b6-de2054f87e5e",
                    "characteristic_uuid": "8d3591bda71140fd8f9f00535fe57179",
                    "descriptor_uuid": "d822b53c",
                    "result": "success"
                }
            }
        }
    }
]

response: descriptor_notify_read

callback of external device read descriptor

path type conditions description
ble.peripheral.notify_read_descriptor.address deviceAddress
  • required
 
ble.peripheral.notify_read_descriptor.service_uuid uuid
  • required
 
ble.peripheral.notify_read_descriptor.characteristic_uuid uuid
  • required
 
ble.peripheral.notify_read_descriptor.descriptor_uuid uuid
  • required
 
//Response Example
[
    {
        "ble": {
            "peripheral": {
                "notify_read_descriptor": {
                    "address": "77e754ab8591",
                    "service_uuid": "e1cfb0d1-ae63-4d6f-b3b6-de2054f87e5e",
                    "characteristic_uuid": "8d3591bda71140fd8f9f00535fe57179",
                    "descriptor_uuid": "d822b53c"
                }
            }
        }
    }
]

response: descriptor_notify_write

callback of external device write descriptor

path type conditions description
ble.peripheral.notify_write_descriptor.address deviceAddress
  • required
 
ble.peripheral.notify_write_descriptor.service_uuid uuid
  • required
 
ble.peripheral.notify_write_descriptor.characteristic_uuid uuid
  • required
 
ble.peripheral.notify_write_descriptor.descriptor_uuid uuid
  • required
 
ble.peripheral.notify_write_descriptor.data dataArray
  • required
 
//Response Example
[
    {
        "ble": {
            "peripheral": {
                "notify_write_descriptor": {
                    "address": "77e754ab8591",
                    "service_uuid": "e1cfb0d1-ae63-4d6f-b3b6-de2054f87e5e",
                    "characteristic_uuid": "8d3591bda71140fd8f9f00535fe57179",
                    "descriptor_uuid": "d822b53c",
                    "data": [16, 34, 242]
                }
            }
        }
    }
]

message

send/receive with other obniz or WebHook

request: send

Related item

path type conditions description
message.data anyType
  • required
All type of data is pass. 
message.to[] obnizId
  • required
 
// Json Example
[
    {
        "message": {
            "data": "button pressed",
            "to": [
                "1234-5678"
            ]
        }
    }
]

response: receive

Related item

path type conditions description
message.data anyType
  • required
All type of data is pass. 
message.from string,null   From obniz id. Null is used when WebHook message. 
//Response Example
[
    {
        "message": {
            "data": "button pressed",
            "from": "1234-5678"
        }
    }
]

debug

response: warning

path type conditions description
debug.warning.message string   readable message 
//Response Example
[
    {
        "debug": {
            "warning": {
                "message": "unknown command"
            }
        }
    }
]

response: error

path type conditions description
debug.error.message string   readable message 
//Response Example
[
    {
        "debug": {
            "error": {
                "message": "voltage down"
            }
        }
    }
]

type defines

bitArray

type conditions examples description
array
  • items
    • 0 ≤ value ≤ 1
  • [0, 1, 1, 0, 0, 1, 1, 0]
  • [0, 0, 1, 0, 0, 0, 0, 0]
Binary data array represented in 0 1. 

bleAdvertiseData

type conditions examples description
array
  • length ≤ 31
  • items
    • 0 ≤ value ≤ 255
  • [2, 1, 26, 7, 9, 83, 97, 109, 112, 108, 101]
  • [7, 9, 83, 97, 109, 112, 108, 101]
 

dataArray

type conditions examples description
array
  • items
    • 0 ≤ value ≤ 255
  • [16, 34, 242]
  • [100, 255, 21, 0, 21]
Binary data array. 

dataArray1024

type conditions examples description
array
  • length ≤ 1024
  • items
    • 0 ≤ value ≤ 255
  • [100, 255, 21, 0, 21]
 

deviceAddress

type conditions examples description
string
  • length = 12
  • "77e754ab8591"
Bluetooth device id. It's hexString cannot contain '0x' or '-'. 

imageData128x64

type conditions examples description
array
  • length = 1024
  • items
    • 0 ≤ value ≤ 255
  • [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 240, 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 255, 224, 120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 255, 192, 240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 255, 129, 248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 255, 255, 3, 254, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 255, 254, 7, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 255, 252, 15, 255, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 255, 248, 31, 255, 192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 255, 240, 63, 255, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 255, 224, 127, 255, 240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 255, 192, 255, 255, 248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 129, 255, 255, 252, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 255, 255, 3, 255, 255, 254, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 255, 254, 7, 255, 255, 254, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 255, 252, 15, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 255, 248, 31, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 255, 240, 63, 255, 255, 255, 128, 0, 0, 0, 0, 0, 0, 0, 0, 7, 255, 224, 127, 193, 255, 255, 128, 0, 0, 0, 0, 0, 0, 0, 0, 15, 252, 64, 255, 128, 255, 255, 128, 0, 0, 0, 0, 0, 0, 0, 0, 15, 240, 1, 255, 0, 127, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 224, 3, 254, 0, 127, 254, 14, 0, 0, 0, 0, 0, 0, 0, 0, 31, 224, 7, 254, 0, 63, 252, 30, 0, 0, 0, 0, 0, 0, 0, 0, 31, 224, 7, 254, 0, 63, 248, 60, 0, 0, 0, 0, 0, 0, 0, 0, 31, 192, 7, 254, 0, 63, 240, 120, 0, 0, 0, 0, 0, 0, 0, 0, 31, 192, 7, 254, 0, 127, 224, 240, 0, 0, 0, 0, 0, 0, 0, 0, 31, 224, 7, 252, 0, 127, 193, 224, 0, 0, 0, 0, 0, 0, 0, 0, 31, 224, 15, 248, 0, 255, 131, 224, 0, 0, 0, 0, 0, 0, 0, 0, 31, 240, 31, 240, 39, 255, 7, 224, 0, 0, 0, 0, 0, 0, 0, 0, 31, 252, 63, 224, 127, 254, 15, 224, 0, 0, 0, 0, 0, 0, 0, 0, 31, 255, 255, 192, 255, 252, 31, 224, 0, 0, 0, 0, 0, 0, 0, 0, 31, 255, 255, 129, 255, 248, 63, 224, 0, 0, 0, 0, 0, 0, 0, 0, 31, 255, 255, 3, 255, 240, 127, 224, 0, 0, 0, 0, 0, 0, 0, 0, 31, 255, 254, 7, 255, 224, 255, 224, 0, 0, 0, 0, 0, 0, 0, 0, 31, 255, 252, 15, 255, 193, 255, 192, 0, 0, 0, 0, 0, 0, 0, 0, 15, 255, 248, 31, 255, 131, 255, 192, 0, 0, 0, 0, 0, 0, 0, 0, 15, 255, 240, 63, 255, 7, 255, 192, 0, 0, 0, 0, 0, 0, 0, 0, 15, 255, 224, 127, 254, 15, 255, 192, 0, 0, 0, 0, 0, 0, 0, 0, 15, 255, 192, 255, 252, 31, 255, 128, 0, 0, 0, 0, 0, 0, 0, 0, 7, 255, 129, 255, 0, 63, 255, 128, 0, 0, 0, 0, 0, 0, 0, 0, 7, 255, 3, 254, 0, 127, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 254, 7, 252, 0, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 252, 15, 252, 0, 255, 254, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 248, 31, 252, 0, 255, 254, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 240, 63, 252, 0, 255, 252, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 127, 252, 0, 255, 252, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 255, 252, 0, 255, 248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 255, 254, 1, 255, 240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 255, 255, 3, 255, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 255, 255, 255, 255, 192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 255, 255, 255, 255, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 255, 255, 255, 254, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 255, 255, 255, 252, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 255, 255, 240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 255, 255, 192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
Image data bit array. 

obnizId

type conditions examples description
string,integer
  • 0 ≤ value ≤ 99999999
  • "1234-5678"
  • 12345678
Obniz id. It can contain '-' or not. 

pinSetting

type conditions examples description
integer
  • 0 ≤ value ≤ 11
  • 0
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
 

uuid

type conditions examples description
string
  • 4 ≤ length ≤ 36
  • "e1cfb0d1-ae63-4d6f-b3b6-de2054f87e5e"
  • "8d3591bda71140fd8f9f00535fe57179"
  • "d822b53c"
  • "de44"
Bluetooth uuid. If it contain '-', it ignored. 

uuidOrNull

type conditions examples description
string,null
  • 4 ≤ length ≤ 36
  • "e1cfb0d1-ae63-4d6f-b3b6-de2054f87e5e"
  • "8d3591bda71140fd8f9f00535fe57179"
  • "d822b53c"
  • "de44"
  • null
Bluetooth uuid. If it contain '-', it ignored.