Bugfix/apps update ptransfer fix deprecation - #1470
Merged
Merged
Conversation
- Updated the main application to send a ConfirmedPrivateTransfer message with multiple application values. - Removed the old ptransfer solution and source files, replacing them with a new implementation. - Introduced new handler files for ConfirmedPrivateTransfer requests and acknowledgments. - Added support for sending ConfirmedPrivateTransfer requests with a list of encoded values. - Improved error handling and response management for the ConfirmedPrivateTransfer service. - Updated service registration and initialization to accommodate the new service handlers.
… with additional options
Contributor
There was a problem hiding this comment.
Pull request overview
This PR modernizes the ptransfer demo by moving ConfirmedPrivateTransfer send/handler logic into the core stack’s basic service layer, wiring the server demo to handle confirmed private transfers, and updating build targets accordingly.
Changes:
- Add core stack support for ConfirmedPrivateTransfer request send (
s_pt.*) and confirmed request/ack handlers (h_pt.*,h_pt_a.*), and expose them viaservices.h. - Update the
apps/ptransferCLI to send one-or-more application values and rely on the new core send/handler support (removing legacy app-local implementations). - Add/adjust build entries for the new sources and a CMake app target for
ptransfer.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/bacnet/basic/services.h | Exposes new ConfirmedPrivateTransfer send/handler headers via the basic services umbrella include. |
| src/bacnet/basic/service/s_pt.h | Updates the public sender API for ConfirmedPrivateTransfer to take a value list. |
| src/bacnet/basic/service/s_pt.c | Adds a stack-level ConfirmedPrivateTransfer request sender implementation. |
| src/bacnet/basic/service/h_pt.h | Updates confirmed private transfer handler prototype and export decoration. |
| src/bacnet/basic/service/h_pt.c | Adds a stack-level confirmed private transfer request handler implementation. |
| src/bacnet/basic/service/h_pt_a.h | Updates confirmed private transfer ACK handler prototype and export decoration. |
| src/bacnet/basic/service/h_pt_a.c | Adds a stack-level confirmed private transfer ACK handler implementation. |
| apps/server/main.c | Registers the new confirmed private transfer handler in the server demo. |
| apps/ptransfer/main.c | Reworks the ptransfer CLI to encode tag/value pairs and send via the new stack sender. |
| apps/ptransfer/Makefile | Renames the built artifact (currently inconsistent with other build paths). |
| apps/Makefile | Adds ptransfer to the app build subdirectories. |
| Makefile | Adds top-level ptransfer and uptransfer convenience targets. |
| CMakeLists.txt | Adds new core service sources to the library and adds a CMake app target for ptransfer. |
| apps/ptransfer/s_ptransfer.c | Removes legacy app-local ConfirmedPrivateTransfer sender implementation. |
| apps/ptransfer/h_pt.c | Removes legacy app-local ConfirmedPrivateTransfer request handler implementation. |
| apps/ptransfer/h_pt_a.c | Removes legacy app-local ConfirmedPrivateTransfer ACK handler implementation. |
| apps/ptransfer/ptransfer.sln | Removes an obsolete Visual Studio solution file. |
Suppressed comments (1)
src/bacnet/basic/service/h_pt.c:63
- On decode failure (decode_len < 0), the abort APDU is also encoded at Handler_Transmit_Buffer[0] and will be overwritten by the NPDU header encoded later. Encode this abort APDU at &Handler_Transmit_Buffer[npdu_len] (after the NPDU length is known).
decode_len = ptransfer_decode_service_request(
service_request, service_len, &data);
if (decode_len < 0) {
apdu_len = abort_encode_apdu(
&Handler_Transmit_Buffer[0], service_data->invoke_id,
ABORT_REASON_OTHER, true);
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.