-
Notifications
You must be signed in to change notification settings - Fork 504
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
Implementation of UDP TX #363
Conversation
…verification #docs #sonar
…. #verification #docs #sonar
… #verification #docs #sonar
…Cyphal-Garage/libcyphal into sshirokov/344_fallible_run2
|
struct Publish | ||
{ | ||
UdpardMicrosecond deadline_us; | ||
UdpardPriority priority; | ||
UdpardPortID subject_id; | ||
UdpardTransferID transfer_id; | ||
}; | ||
struct Request | ||
{ | ||
UdpardMicrosecond deadline_us; | ||
UdpardPriority priority; | ||
UdpardPortID service_id; | ||
UdpardNodeID server_node_id; | ||
UdpardTransferID transfer_id; | ||
}; | ||
struct Respond | ||
{ | ||
UdpardMicrosecond deadline_us; | ||
UdpardPriority priority; | ||
UdpardPortID service_id; | ||
UdpardNodeID client_node_id; | ||
UdpardTransferID transfer_id; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we not extract the common fields into a new type and use composition with that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Am I right that you are proposing to extract deadline_us
, priority
& transfer_id
to some BaseMetadata
?
In general I saw and was aware of this duplication, but decided that a bit of duplication in detail
won't hurt but instead will give clear independence/separation of the cases (which are instantiated in 3 different places, and in the end consumed by 3 different operator()
-s)...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pavel-kirienko ? (see above question)
static cetl::optional<AnyError> optAnyErrorFromUdpard(const std::int32_t result) | ||
{ | ||
// Udpard error results are negative, so we need to negate them to get the error code. | ||
const std::int32_t canard_error = -result; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
udpard_error
struct IpEndpoint final | ||
{ | ||
std::uint32_t ip_address; | ||
std::uint16_t udp_port; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be wiser to alias UdpardUDPIPEndpoint
so that you don't have to convert there and back in your code. Also I think it's more accurate to call it a UDP/IP endpoint, not just an IP endpoint.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My thinking was that we are under udp::
namespace, so the type is kinda already has UDP, like udp::IpEndpoint
...
@thirtytwobits Scott, how is PR overall? Aproveable? ;) |
TransportDelegate
&TransportImp
.udp::IMedia
,udp::ITxSocket
&upd::IRxSocket
protocols.libcyphal::detail::UniquePtrSpec
helper).std::exchange
.Here is code coverage. Note that low (red) coverage at RX is currently expected - will be addressed by near future next PRs.
![image](https://private-user-images.githubusercontent.com/2915466/341780175-c4fc38b9-0e54-4f11-8d7d-efd38af61394.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5NDc0OTksIm5iZiI6MTczODk0NzE5OSwicGF0aCI6Ii8yOTE1NDY2LzM0MTc4MDE3NS1jNGZjMzhiOS0wZTU0LTRmMTEtOGQ3ZC1lZmQzOGFmNjEzOTQucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDdUMTY1MzE5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NzY4Y2RkYTVmNDIzNGVhOGExMWZjNWY1ZTkwZjNkYTY0ZjM4MDFjZGJlYzcwNmUwMWU4ZTlkMmUzNWU4ZTkxMiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.hEkOsPOfatTjCKvln-ClnnNJ2sD-c5_a3zRo1AdzOQU)