Skip to content

Commit

Permalink
expose the http_server_timeout parameter on the SdcDevice interface (D…
Browse files Browse the repository at this point in the history
…raegerwerk#259)

<!--- Provide a general summary of your changes in the title above -->
<!--- Link the corresponding issues after you created the pull request
-->

## Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)

## Checklist:
<!--- Go over all the following points, and put an `x` in all the boxes
that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
- [x] I have updated the [changelog](../CHANGELOG.md) accordingly.
- [ ] I have added tests to cover my changes.
  • Loading branch information
maximilianpilz authored Sep 8, 2023
1 parent f70f6f4 commit 06e650c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All notable changes to the sdc11073 module will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

- http_server_timeout parameter to the SdcDevice interface in addition to it already
being a parameter in the SdcHandler interface

## [1.2.1] - 2023-09-05

### Fixed
Expand Down
11 changes: 9 additions & 2 deletions src/sdc11073/sdcdevice/sdcdeviceimpl.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,22 @@ def dispatchGetRequest(self, parseResult, headers):
""" device itself can also handle GET requests. This is the handler"""
return self._handler.dispatchGetRequest(parseResult, headers)

def startAll(self, startRealtimeSampleLoop=True, periodic_reports_interval=None, shared_http_server=None):
def startAll(self,
startRealtimeSampleLoop=True,
periodic_reports_interval=None,
shared_http_server=None,
http_server_timeout=15.0):
"""
:param startRealtimeSampleLoop: flag
:param periodic_reports_interval: if provided, a value in seconds
:param shared_http_server: id provided, use this http server. Otherwise device creates its own.
:param http_server_timeout: the timeout in seconds for waiting on the start event of
the http server thread of the underlying handler
:return:
"""
return self._handler.startAll(startRealtimeSampleLoop, periodic_reports_interval, shared_http_server)
return self._handler.startAll(startRealtimeSampleLoop, periodic_reports_interval, shared_http_server,
http_server_timeout=http_server_timeout)

def stopAll(self, closeAllConnections=True, sendSubscriptionEnd=True):
return self._handler.stopAll(closeAllConnections, sendSubscriptionEnd)
Expand Down

0 comments on commit 06e650c

Please sign in to comment.