btnut/btnode/include/cc/ccc.h File Reference


Detailed Description

Packet-communication library for the CC1000 radio.

Author:
Mario Strasser <mast@gmx.net>

#include <sys/types.h>
#include <cc/ccc_packet.h>
#include <cc/mac.h>

Typedefs

typedef void(*) ccc_packet_handler_t (ccc_packet_t *pkt)

Functions

void ccc_deregister_packet_handler (u_char type)
u_short ccc_get_address (void)
u_short ccc_get_mtu (void)
ccc_packet_handler_t ccc_get_packet_handler (u_char type)
int ccc_init (mac_interface_t *mac_interface)
int ccc_register_packet_handler (u_char type, ccc_packet_handler_t handler)
void ccc_release (void)
int ccc_send (u_short dst, u_char type, ccc_packet_t *pkt)
void ccc_test (void)
ccc_packet_tnew_ccc_packet (u_short data_length)


Typedef Documentation

typedef void(*) ccc_packet_handler_t(ccc_packet_t *pkt)

packet-handler type


Function Documentation

void ccc_deregister_packet_handler ( u_char  type  ) 

Deregisters the packet handler of the specified type.

Parameters:
type [in] packet type

u_short ccc_get_address ( void   ) 

Returns the configured mac address.

Returns:
configured mac address.

u_short ccc_get_mtu ( void   ) 

Returns the maximal payload size of a ccc packet.

Returns:
maximal payload size of a ccc packet.

ccc_packet_handler_t ccc_get_packet_handler ( u_char  type  ) 

Returns the currently installed packet handler for the specified type.

Parameters:
type [in] packet type
Returns:
currently installed packet handler, or NULL if there is none.

int ccc_init ( mac_interface_t mac_interface  ) 

Initialises the CC1000 communication library.

Parameters:
mac_interface [in] CC1000 MAC-Interface to use
Returns:
0 on success, -1 otherwise.
Examples:
ccc-cmd/ccc-cmd.c.

int ccc_register_packet_handler ( u_char  type,
ccc_packet_handler_t  handler 
)

Registers a packet handler for the specified packet type.

Parameters:
type [in] packet type to handle
handler [in] packet handler to use
Returns:
0 on success, -1 if the specified type is invalid or already assigned to an other handler.
Examples:
ccc-cmd/ccc-cmd.c.

void ccc_release ( void   ) 

Releases the CC1000 communication library.

int ccc_send ( u_short  dst,
u_char  type,
ccc_packet_t pkt 
)

Sends a ccc packet to the specified destination node.

Parameters:
dst [in] destination address
type [in] packet type
pkt [in] packet to send, note that the header will be overwritten
Returns:
0 on success, -1 otherwise.
Examples:
ccc-cmd/ccc-cmd.c.

ccc_packet_t* new_ccc_packet ( u_short  data_length  ) 

Allocates memory for a new ccc packet with the given (maximal) payload size.

Parameters:
data_length [in] maximal length of the payload
Returns:
pointer to the new ccc packet.
Examples:
ccc-cmd/ccc-cmd.c.


Generated on Wed Apr 29 11:12:29 2009 for BTnut System Software by doxygen 1.5.1
!!! Dieses Dokument stammt aus dem ETH Web-Archiv und wird nicht mehr gepflegt !!!
!!! This document is stored in the ETH Web archive and is no longer maintained !!!