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

[WIP] Add support for other APCI services #253

Closed
wants to merge 6 commits into from

Conversation

basilfx
Copy link
Contributor

@basilfx basilfx commented Dec 9, 2019

This PR adds support for additional APCI services. APCI services are the actual payloads to communicate with actors. These payloads can be used for broadcast messages such as GroupValueWrite, but also for unicast messages such as MemoryRead. I need this to perform low(er)-level operations on my custom actors.

The main focus of this library was GroupValue payloads, so I had to refactor several parts of this library to make it more extensible. Fortunately, most of the higher-level API is still the same. In short:

  • Telegram.group_address got replaced by Telegram.address (APCI supports both types)
  • Telegram.payload should be a class that extends knx.telegram.apci.APCI. For instance, to write a DPT to a group address, you now use Telegram(.., payload=GroupValueWrite(DPTArray(..))).
  • Telegram.telegramtype is now encoded in knx.telegram.apci.APCI.code.

I've added two examples (example_info.py and example_restart.py) to demonstate the new features.

Current limitation is that payloads can only be used in connectionless mode. This is not different from before, but several unicast messages are typically used with an active connection (that also supports sequencing and ACK/NACK on transport level). This would require more changes.

Current state is WIP and should not yet be merged. It's here to show and share my interest in this feature, and collect preliminary feedback. I'll continue on this one, but it needs a bit more time to fix the last part.

@basilfx
Copy link
Contributor Author

basilfx commented Dec 9, 2019

The example_info.py output looks like below:

image

@basilfx
Copy link
Contributor Author

basilfx commented Nov 25, 2020

I've rebased this PR, and split the first part of the commits into #510. If that one gets merged, I'll update this PR accordingly, and open another one for the next changes.

At this point, four unit tests still fail, but the rest seems to work OK.

This becomes unnecessary if the telegram type can be derrived from the
payload.
Thi adds payload classes that represent APCI messages, such as
GroupValueRead/Write/Response.
This adapts all Telegram payload objects to the corresponding APCI
payload objects. It removes the need for `Telegram.telegramtype`.
This can be derived from the payload of the telegram.
@basilfx basilfx force-pushed the feature/apci_payload branch from 505d237 to d815caf Compare November 30, 2020 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant