---
# System prepended metadata

title: Set iSDV Device Property

---


# Set iSDV Device Property

#### Device Settings 
- [x] Hardware
- [ ] Netwotk
- [ ] RS232
- [ ] USB
- [ ] Audio
- [ ] Firmware

`URL = http://127.0.0.1:8080/api/device/0016c04c4bd7`
### Hardware Device API
1) Claim Device
```
url = 'http://127.0.0.1:'+rest_port+'/api/device/'+device_id
Method = POST
body = {"op" : "claim/release"}
```

2) Update Device Mode

```
url = 'http://127.0.0.1:'+rest_port+'/api/device/'+device_id
Method = POST
body = {"op" : "set:property", "key" : "configuration.device_mode", "value" : "Transmitter/Receiver/Transceiver"}
```

### Network Device API
1) Enable 1G Port
```
url = 'http://127.0.0.1:'+rest_port+'/api/device/'+device_id
Method = POST
body = {"op" : "set:property","key" : "nodes[NETWORK_SWITCH:0].configuration.gigabit_port_1_enable","value" : true/false}
```
2) Set IP, Mask and gateway
```
url = 'http://127.0.0.1:'+rest_port+'/api/device/'+device_id
Method = POST
body = {"op" : "set:ip:STATIC", "address" : address, "mask" : mask, "gateway" : gateway}
```
3) **Doubt:** How to allocate IP to device
![](https://i.imgur.com/f4zBbxz.png)

---

### RS232 Device API
1) Set "baud_rate", "data_bits", "stop_bits","parity"
Note: Need to set value one by one.
- [ ] **Doubts:** *How to set value in bulk?*
- [ ] In API setting data there are 3 object for UART. Which one need to update?
- [ ] **Parity** value is ***string*** as per API, where as in specs it is define as Integer
- [ ] Does baud, data bit(5,6,7,8), stop bit value input should be as per specs only? 
- [ ] ![](https://i.imgur.com/R2HzG2d.png)
**Reference** ![](https://i.imgur.com/rDkcDuF.png)


```
url = 'http://127.0.0.1:'+rest_port+'/api/device/'+device_id
Method = POST
body = {"op" : "set:property","key" : "nodes[UART:0].configuration.baud_rate","value" : 110/300/600/1200/2400/4800/9600/14400/38400/57600/115200}
{"op" : "set:property","key" : "nodes[UART:0].configuration.data_bits","value" : 5/6/7/8}
{"op" : "set:property","key" : "nodes[UART:0].configuration.stop_bits","value" : None/Odd/Even/Mask/Space}
{"op" : "set:property","key" : "nodes[UART:0].configuration.parity","value" : 1/1.5/2}
```

---
### USB Device API (DOUBTS)
Ref. 4.15.6 ; Page no: 101
PDF doc = PDS-062326_BlueRiver_API_Developers_Reference_Guide_rev1p3.pdf
Role: [DISABLED, OTG, LOCAL, REMOTE]
```
/api/device/{target}
{
"op" : "set:usb",
"role" : String // [DISABLED, OTG, LOCAL, REMOTE]
}
```

### Audio Device API
Ref: 7.10 Page = 225
Audio mode type is integer

```
#HDMI Audio Encoder Settings
url = 'http://127.0.0.1:'+rest_port+'/api/device/'+device_id
rest_command = {"op" : "set:property", "key" : "nodes[HDMI_ENCODER:0].inputs[audio:0].configuration.source.value", "value" : audio_dest_hdmi}

```

### Firmware update Device API
Ref: ./python_commands/fw_update.py

```
 url = 'http://127.0.0.1:'+rest_port+'/api/device/'+device_id
    rest_command = {"op" : "update", "file_name" : firmware}
```