Jim Patterson / Mbed 2 deprecated MultiSensor_00

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Transport Class Reference

Transport Class Reference

A class to implement a basic transport layer that is based very loosely on UDP/UDP-lite. More...

#include <comms.h>

Public Member Functions

 Transport (uint32_t, uint32_t, uint32_t)
 Transport constructor.
void get_packet (uint8_t **, uint16_t *)
 Provides a pointer to a buffer containing a formatted packet and the total length of said packet.
void load_data (uint16_t *, uint16_t)
 Loads the transport packet with an array of 16bit samples.
void set_dst_port (uint16_t)
 Set the destination port.

Detailed Description

A class to implement a basic transport layer that is based very loosely on UDP/UDP-lite.

Definition at line 41 of file comms.h.


Constructor & Destructor Documentation

Transport ( uint32_t  src_addr,
uint32_t  dst_addr,
uint32_t  ID 
)

Transport constructor.

Set up the pseudo header and packet to be used in communications

Definition at line 23 of file comms.cpp.


Member Function Documentation

void get_packet ( uint8_t **  buffer,
uint16_t *  length 
)

Provides a pointer to a buffer containing a formatted packet and the total length of said packet.

Definition at line 53 of file comms.cpp.

void load_data ( uint16_t *  buffer,
uint16_t  length 
)

Loads the transport packet with an array of 16bit samples.

This will require translating the words into big-endian.

Definition at line 62 of file comms.cpp.

void set_dst_port ( uint16_t  port )

Set the destination port.

Definition at line 79 of file comms.cpp.