Transport is an interface class for sending/receiving UDP packets. This interface coforms to the SAE-JAUS AS5669 Standard. More...
#include <judp.h>
Public Member Functions | |
| JUDP () | |
| Constructor. | |
| ~JUDP () | |
| Destructor. | |
| virtual void | SetPacketPollingDelayMs (const unsigned int delayTimeMs=0) |
| Sets the delay time between checks for new packets to process by each message processing thread. | |
| virtual bool | LoadSettings (const std::string &filename) |
| Loads UDP configuration values from an XML file. Only loads values if transport has not been initialized. | |
| virtual bool | Initialize (const Address &componentID) |
| Initializes the Transport Service based on configuration values set. | |
| virtual bool | IsInitialized () const |
| virtual void | Shutdown () |
| Shutsdown the Transport. | |
| virtual Address::List | GetConnections () const |
| Returns a list of connections to other components. | |
| virtual bool | HaveConnection (const Address &id) const |
| virtual bool | SendPacket (const Packet &packet, const Header &header, const int broadcastFlags=Service::NoBroadcast) const |
| Sends a serialized JAUS packet that has the correct JUDP header setup. If the destination is a local broadcast, then it is sent using multicast, if destination is global, then it is sent using a broadcast socket. | |
| virtual bool | SerializeMessage (const Message *message, Packet::List &stream, Header::List &streamHeaders, const UShort startingSequenceNumber, const int broadcastFlags) const |
| Converts the message data into JUDP packets for transmission. | |
| virtual Packet | GetTransportHeader () const |
| virtual Address::List | GetManualConnections () const |
| void | SetMaxPacketSize (const unsigned int maxSizeBytes=1500) |
| Sets the maximum packet size value to use for UDP packets. This value should match the MTU of your network interface. The default value is 1500. | |
| void | SetDisconnectTimeMs (const unsigned int timeMs) |
| Sets the time in milliseconds used to determine if a connection should be closed. Only closes connection if no data has been received for this time value set. | |
| void | SetTTL (const unsigned char ttl=16) |
| Sets the TTL for multicast. Only set if Transport is not initialized. | |
| void | SetMulticastIP (const CxUtils::IP4Address &multicastIP) |
| Sets the address to use for multicast data. Only set if Transport is not initialized. | |
| void | EnableBroadcasting (const bool enabled) |
| Enable/Disable broadcasting over multicast. Only set if Transport is not initialized. | |
| CxUtils::IP4Address | GetMulticastIP () const |
| void | SetInterfaceIP (const CxUtils::IP4Address &networkIP=CxUtils::IP4Address()) |
| Sets the IP address of the network interface on the host machine to use. Set to blank if any address is fine. | |
| bool | AddConnection (const CxUtils::IP4Address &networkIP, const Address &jausID, const unsigned short port=Port) |
| Method to add a new connection manually to a component at an IP address. | |
| virtual bool | CloseConnection (const Address &jausID) |
| Method to disconnect from a component. | |
Static Public Member Functions | |
| static bool | ListenForSubsystems (Address::Set &discovered, const unsigned int waitTimeMs=5000, const CxUtils::IP4Address &multicastIP="239.255.0.1") |
| Creates a multicast listening socket to try and discover subsystems on the network for dynamic selection of a component ID. | |
Static Public Attributes | |
| static const unsigned short | Port = 3794 |
| JAUS UDP/TCP Port Number == "jaus". | |
| static const unsigned int | OverheadSizeBytes = 61 |
| JUDP Overhead in bytes. | |
| static const Byte | Version = 0x02 |
| JUDP Header Version. | |
Transport is an interface class for sending/receiving UDP packets. This interface coforms to the SAE-JAUS AS5669 Standard.
Definition at line 56 of file judp.h.
| bool JUDP::CloseConnection | ( | const Address & | jausID ) | [virtual] |
Method to disconnect from a component.
| [in] | jausID | JAUS ID of component. |
Reimplemented from JAUS::Transport.
| void JUDP::EnableBroadcasting | ( | const bool | enabled ) |
| Address::List JUDP::GetConnections | ( | ) | const [virtual] |
Returns a list of connections to other components.
Implements JAUS::Transport.
| Address::List JUDP::GetManualConnections | ( | ) | const [virtual] |
Implements JAUS::Transport.
| CxUtils::IP4Address JAUS::JUDP::GetMulticastIP | ( | ) | const [inline] |
| virtual Packet JAUS::JUDP::GetTransportHeader | ( | ) | const [inline, virtual] |
Implements JAUS::Transport.
| bool JUDP::HaveConnection | ( | const Address & | id ) | const [virtual] |
| [in] | id | Component ID to check connection for. |
Implements JAUS::Transport.
| bool JUDP::Initialize | ( | const Address & | componentID ) | [virtual] |
| bool JUDP::IsInitialized | ( | ) | const [virtual] |
Implements JAUS::Transport.
| bool JUDP::ListenForSubsystems | ( | Address::Set & | discovered, |
| const unsigned int | waitTimeMs = 5000, |
||
| const CxUtils::IP4Address & | multicastGroup = "239.255.0.1" |
||
| ) | [static] |
Creates a multicast listening socket to try and discover subsystems on the network for dynamic selection of a component ID.
| [in] | discovered | List of discovered components performing Discovery. |
| [in] | waitTimeMs | How long to listen for. |
| [in] | multicastGroup | Multicast group to listen on. |
| bool JUDP::LoadSettings | ( | const std::string & | filename ) | [virtual] |
Loads UDP configuration values from an XML file. Only loads values if transport has not been initialized.
| [in] | filename | File containing UDP settings data. |
Reimplemented from JAUS::Service.
| bool JUDP::SendPacket | ( | const Packet & | packet, |
| const Header & | header, | ||
| const int | broadcastFlags = Service::NoBroadcast |
||
| ) | const [virtual] |
Sends a serialized JAUS packet that has the correct JUDP header setup. If the destination is a local broadcast, then it is sent using multicast, if destination is global, then it is sent using a broadcast socket.
| [in] | packet | JUDP Packet to send. |
| [in] | header | JAUS Transport header information. |
| [in] | broadcastFlags | Values to use to signify if message should be sent using any broadcast options (e.g. multicast). 0 = no options, 1/2 = multicast. |
Implements JAUS::Transport.
| bool JUDP::SerializeMessage | ( | const Message * | message, |
| Packet::List & | stream, | ||
| Header::List & | streamHeaders, | ||
| const UShort | startingSequenceNumber, | ||
| const int | broadcastFlags | ||
| ) | const [virtual] |
Converts the message data into JUDP packets for transmission.
| [in] | message | Message to convert/serialize. |
| [out] | stream | Packets to send. |
| [out] | streamHeaders | Header info for packets. |
| [in] | startingSequenceNumber | Sequence number to use for packets. |
| [in] | broadcastFlags | Values to use to signify if message should be sent using any broadcast options (e.g. multicast). 0 = no options, 1 = local broadcast, 2 = global broadcast. |
Implements JAUS::Transport.
| void JUDP::SetDisconnectTimeMs | ( | const unsigned int | timeMs ) |
| void JUDP::SetInterfaceIP | ( | const CxUtils::IP4Address & | networkIP = CxUtils::IP4Address() ) |
| void JUDP::SetMaxPacketSize | ( | const unsigned int | maxSizeBytes = 1500 ) |
Sets the maximum packet size value to use for UDP packets. This value should match the MTU of your network interface. The default value is 1500.
| [in] | maxSizeBytes | The maximum packet size for sending over UDP. This should match the MTU of your network interface. Must be greater than OverheadSizeBytes. |
| void JUDP::SetMulticastIP | ( | const CxUtils::IP4Address & | multicastIP ) |
| void JUDP::SetPacketPollingDelayMs | ( | const unsigned int | delayTimeMs = 0 ) |
[virtual] |
Sets the delay time between checks for new packets to process by each message processing thread.
The default value is 1 ms, but can be set to 0 for no delay, or larger for less frequent checking of messages (use larger numbers on slower hardware).
| [in] | delayTimeMs | Delay time between checks in milliseconds. |
| void JUDP::SetTTL | ( | const unsigned char | ttl = 16 ) |
| void JUDP::Shutdown | ( | ) | [virtual] |
const unsigned int JAUS::JUDP::OverheadSizeBytes = 61 [static] |
const unsigned short JAUS::JUDP::Port = 3794 [static] |
const Byte JAUS::JUDP::Version = 0x02 [static] |
1.7.2