OutgoingTransferRegistryKey(DataTypeID data_type_id, TransferType transfer_type, NodeID destination_node_id)
     : data_type_id_(data_type_id)
     , transfer_type_(transfer_type)
     , destination_node_id_(destination_node_id)
 {
     UAVCAN_ASSERT((transfer_type == TransferTypeMessageBroadcast) == destination_node_id.isBroadcast());
     /*
      * Service response transfers must use the same Transfer ID as matching service request transfer,
      * so this registry is not applicable for service response transfers at all.
      */
     UAVCAN_ASSERT(transfer_type != TransferTypeServiceResponse);
 }
Example #2
0
 Frame(DataTypeID data_type_id, TransferType transfer_type, NodeID src_node_id, NodeID dst_node_id,
       uint_fast8_t frame_index, TransferID transfer_id, bool last_frame = false)
     : transfer_priority_(getDefaultPriorityForTransferType(transfer_type))
     , transfer_type_(transfer_type)
     , data_type_id_(data_type_id)
     , payload_len_(0)
     , src_node_id_(src_node_id)
     , dst_node_id_(dst_node_id)
     , frame_index_(frame_index)
     , transfer_id_(transfer_id)
     , last_frame_(last_frame)
 {
     UAVCAN_ASSERT((transfer_type == TransferTypeMessageBroadcast) == dst_node_id.isBroadcast());
     UAVCAN_ASSERT(data_type_id.isValidForDataTypeKind(getDataTypeKindForTransferType(transfer_type)));
     UAVCAN_ASSERT(src_node_id.isUnicast() ? (src_node_id != dst_node_id) : true);
     UAVCAN_ASSERT(frame_index <= getMaxIndex());
 }