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

include/lnp/lnp.h File Reference

LNP Interface: link networking protocol. More...

#include <config.h>
#include <unistd.h>

Include dependency graph for lnp.h:

Include dependency graph

Go to the source code of this file.

Defines

#define LNP_DUMMY_INTEGRITY   ((lnp_integrity_handler_t)0)
 dummy integrity layer packet handler

#define LNP_DUMMY_ADDRESSING   ((lnp_addressing_handler_t)0)
 dummy addressing layer packet handler

#define LNP_DUMMY_REMOTE   ((lnp_remote_handler_t)0)
 dummy remote packet handler


Typedefs

typedef void(* lnp_integrity_handler_t )(const unsigned char *, unsigned char)
 the integrity layer packet handler type

typedef void(* lnp_addressing_handler_t )(const unsigned char *, unsigned char, unsigned char)
 the addressing layer packet handler type

typedef void(* lnp_remote_handler_t )(unsigned int)
 handler for remote


Functions

void lnp_integrity_set_handler (lnp_integrity_handler_t handler)
 set the integrity layer packet handler

void lnp_addressing_set_handler (unsigned char port, lnp_addressing_handler_t handler)
 set an addressing layer packet handler for a port.

void lnp_set_hostaddr (unsigned char host)
 set new LNP host address

void lnp_remote_set_handler (lnp_remote_handler_t handler)
 set the remote packet handler

int send_msg (unsigned char msg)
 send a standard firmware message

void clear_msg (void)
 clear last message from standard firmware

wakeup_t msg_received (wakeup_t m)
 wait until receive a message

unsigned char get_msg (void)
 read received message from standard firmware

int lnp_integrity_write (const unsigned char *data, unsigned char length)
 send a LNP integrity layer packet of given length

int lnp_addressing_write (const unsigned char *data, unsigned char length, unsigned char dest, unsigned char srcport)
 send a LNP addressing layer packet of given length


Variables

volatile lnp_integrity_handler_t lnp_integrity_handler
 there are no ports for integrity layer packets, so there's just

volatile lnp_addressing_handler_t lnp_addressing_handler []
 addressing layer packets may be directed to a variety of ports.

unsigned char lnp_hostaddr
 LNP host address.

lnp_remote_handler_t lnp_remote_handler
 packets from remote have no ports

unsigned char lnp_rcx_message
 message variable


Detailed Description

LNP Interface: link networking protocol.

Author:
Markus L. Noga <markus@noga.de>

Definition in file lnp.h.


Define Documentation

#define LNP_DUMMY_ADDRESSING   ((lnp_addressing_handler_t)0)
 

dummy addressing layer packet handler

Definition at line 61 of file lnp.h.

#define LNP_DUMMY_INTEGRITY   ((lnp_integrity_handler_t)0)
 

dummy integrity layer packet handler

Definition at line 58 of file lnp.h.

#define LNP_DUMMY_REMOTE   ((lnp_remote_handler_t)0)
 

dummy remote packet handler

Definition at line 70 of file lnp.h.


Typedef Documentation

typedef void(* lnp_addressing_handler_t)(const unsigned char *, unsigned char, unsigned char)
 

the addressing layer packet handler type

arguments are (data,length,src_address).

Definition at line 55 of file lnp.h.

Referenced by lnp_addressing_set_handler().

typedef void(* lnp_integrity_handler_t)(const unsigned char *, unsigned char)
 

the integrity layer packet handler type

arguments are (data,length).

Definition at line 50 of file lnp.h.

Referenced by lnp_integrity_set_handler().

typedef void(* lnp_remote_handler_t)(unsigned int)
 

handler for remote

arguments are (buttonstate)

Definition at line 67 of file lnp.h.

Referenced by lnp_remote_set_handler().


Function Documentation

void clear_msg void   )  [inline]
 

clear last message from standard firmware

Definition at line 136 of file lnp.h.

References lnp_rcx_message.

Referenced by get_msg().

unsigned char get_msg void   )  [inline]
 

read received message from standard firmware

Definition at line 145 of file lnp.h.

References clear_msg(), lnp_rcx_message, msg_received(), and wait_event().

void lnp_addressing_set_handler unsigned char  port,
lnp_addressing_handler_t  handler
[inline]
 

set an addressing layer packet handler for a port.

Definition at line 107 of file lnp.h.

References lnp_addressing_handler, and lnp_addressing_handler_t.

int lnp_addressing_write const unsigned char *  data,
unsigned char  length,
unsigned char  dest,
unsigned char  srcport
 

send a LNP addressing layer packet of given length

Returns:
0 on success.

void lnp_integrity_set_handler lnp_integrity_handler_t  handler  )  [inline]
 

set the integrity layer packet handler

Definition at line 101 of file lnp.h.

References lnp_integrity_handler, and lnp_integrity_handler_t.

int lnp_integrity_write const unsigned char *  data,
unsigned char  length
 

send a LNP integrity layer packet of given length

Returns:
0 on success.

void lnp_remote_set_handler lnp_remote_handler_t  handler  )  [inline]
 

set the remote packet handler

Definition at line 122 of file lnp.h.

References lnp_remote_handler, and lnp_remote_handler_t.

void lnp_set_hostaddr unsigned char  host  )  [inline]
 

set new LNP host address

Definition at line 115 of file lnp.h.

References lnp_hostaddr.

wakeup_t msg_received wakeup_t  m  ) 
 

wait until receive a message

Referenced by get_msg().

int send_msg unsigned char  msg  ) 
 

send a standard firmware message


Variable Documentation

volatile lnp_addressing_handler_t lnp_addressing_handler[]
 

addressing layer packets may be directed to a variety of ports.

Definition at line 84 of file lnp.h.

Referenced by lnp_addressing_set_handler().

unsigned char lnp_hostaddr
 

LNP host address.

Definition at line 87 of file lnp.h.

Referenced by lnp_set_hostaddr().

volatile lnp_integrity_handler_t lnp_integrity_handler
 

there are no ports for integrity layer packets, so there's just

Definition at line 81 of file lnp.h.

Referenced by lnp_integrity_set_handler().

unsigned char lnp_rcx_message
 

message variable

Definition at line 130 of file lnp.h.

Referenced by clear_msg(), and get_msg().

lnp_remote_handler_t lnp_remote_handler
 

packets from remote have no ports

Definition at line 91 of file lnp.h.

Referenced by lnp_remote_set_handler().


brickOS is released under the Mozilla Public License.
Original code copyright 1998-2002 by the authors.

Generated on Mon Feb 16 21:01:55 2004 for brickOS C by doxygen 1.3.5