Main Page | Data Structures | File List | Data Fields | Globals | Related Pages

transport.h File Reference

Transport layer include file. More...

#include <inttypes.h>
#include "net/network.h"

Go to the source code of this file.

Enumerations

enum  tsp_service_e {
  S_DGRAM = 0, S_REPEATED, S_ACKED, S_REQUEST,
  S_INVALID = 0xff
}
 Transport layer service types. More...


Functions

void tsp_check_timeout (void)
 Check transport layer timeouts.

void tsp_process (void)
 Process waiting packets and schedule them for transmission.

int8_t tsp_requ (net_buf_t *buf, net_addr_t *dest, enum tsp_service_e service)
 Send a packet using a transport layer sevice.

uint8_t tsp_clear_to_send (void)
 Returns a nonzero value if a new packet could be passed to the transport layer.

void tsp_set_segment_size (uint8_t size)
 Set size of segment.

uint8_t tsp_get_segment_size (void)
 Get segment size.

void tsp_set_group_size (uint8_t group, uint8_t size)
 Set size of a group.

uint8_t tsp_get_group_size (uint8_t group)
 Get size of a group.


Detailed Description

Transport layer include file.

Constants and definitions of the transport layer.

Definition in file transport.h.


Enumeration Type Documentation

enum tsp_service_e
 

Transport layer service types.

Enumeration values:
S_DGRAM  Unacknowledged (not repeated) service.
S_REPEATED  Unacknowledged repeated service.
S_ACKED  Acknowledged service.
S_REQUEST  Session service.
S_INVALID  No service. tsp_requ() will fail.

Definition at line 36 of file transport.h.

Referenced by app_process().


Function Documentation

void tsp_check_timeout void   ) 
 

Check transport layer timeouts.

This function must be called at a fixed rate from the main loop.

Attention:
It cannot be called from a timer interrupt because it is not thread save!

Definition at line 451 of file transport.c.

References NAF_GROUP, and tsp_con_fin().

uint8_t tsp_get_group_size uint8_t  group  ) 
 

Get size of a group.

Parameters:
group Group number. [0..TSP_MAX_GROUPS-1]
Returns:
Size of group.

Definition at line 597 of file transport.c.

uint8_t tsp_get_segment_size void   ) 
 

Get segment size.

Returns:
Current segment size.

Definition at line 575 of file transport.c.

void tsp_process void   ) 
 

Process waiting packets and schedule them for transmission.

This function should be called from your main loop.

Attention:
Must not be called from a interrupt routine. The implementation is not thread-save.
Todo:
Remove dirty hack ensuring that buffer of sesion reply gets released.

Definition at line 398 of file transport.c.

References net_clear_to_send(), net_requ(), and NPDU_SINGLE.

int8_t tsp_requ net_buf_t *  buf,
net_addr_t dest,
enum tsp_service_e  service
 

Send a packet using a transport layer sevice.

This function does return without waiting for the packet to be transmitted. Check the return value if the packet was scheduled for transmission.

Parameters:
buf Network buffer containing the packet data.
dest Destination network address.
service Transport layer service used for transmission.
Returns:
Returns -1 for a invalid request, 0 if the request could not be processed currently or 1 if successfull.

Definition at line 492 of file transport.c.

References AT_LOGIC, NPDU_SESSION, NPDU_SINGLE, NPDU_TRANSACTION, S_ACKED, S_DGRAM, S_REPEATED, and S_REQUEST.

Referenced by app_process().

void tsp_set_group_size uint8_t  group,
uint8_t  size
 

Set size of a group.

Parameters:
group Group number of group which size is about to be set. [0..TSP_MAX_GROUPS-1]
size The new group size.

Definition at line 586 of file transport.c.

void tsp_set_segment_size uint8_t  size  ) 
 

Set size of segment.

Parameters:
size New segment size.

Definition at line 565 of file transport.c.


Generated on Fri Oct 17 16:45:55 2003 for OpenHome by doxygen 1.3.3