Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix default transport #686

Merged
merged 3 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES_NEXT_RELEASE
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
- Use config.defaultTransport (from config.js or IOTA_DEFAULT_TRANSPORT env var) instead of magic 'HTTP' at provision device
fgalan marked this conversation as resolved.
Show resolved Hide resolved
- Add: X-Processing-Time response header with processing time (in milliseconds) expended by current HTTP measure (iotagent-node-lib#1650)
9 changes: 5 additions & 4 deletions docs/usermanual.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,9 @@ Robot1@turn|left

##### Time processing

HTTP bindig is returning in a HTTP header named `X-Processing-Time` processing time (in milliseconds) expended by current HTTP measure
request. For example:
HTTP bindig is returning in a HTTP header named `X-Processing-Time` processing time (in milliseconds) expended by
current HTTP measure request. For example:

```
X-Processing-Time: 38
```
Expand Down Expand Up @@ -378,8 +379,8 @@ commands and a topic to receive configuration information. This mechanism can be
configuration flag, `configRetrieval`.

In case of MQTT to retrieve configuration parameters from the Context Broker, it is required that the device should be
provisioned using "MQTT" as transport key, at device or group level. By default it will be considered "HTTP" as
transport.
provisioned using "MQTT" as transport key, at device or group level. By default it will be considered "MQTT" as
transport if none transport is defined at device or group level or IOTA_DEFAULT_TRANSPORT env var.

The parameter will be given as follows:

Expand Down
2 changes: 1 addition & 1 deletion lib/bindings/HTTPBindings.js
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ function setPollingAndDefaultTransport(device, group, callback) {
context = fillService(context, device);
config.getLogger().debug(context, 'httpbinding.setPollingAndDefaultTransport device %j group %j', device, group);
if (!device.transport) {
device.transport = group && group.transport ? group.transport : 'HTTP';
device.transport = group && group.transport ? group.transport : config.getConfig().defaultTransport;
}

if (device.transport === 'HTTP') {
Expand Down
Loading