#include <avr/eeprom.h>
#include <avr/pgmspace.h>
#include <inttypes.h>
#include "net/link.h"
#include "net/network.h"
#include "net.h"
#include "utils.h"
Go to the source code of this file.
Defines | |
#define | DAF_MASK 0x03 |
#define | SAF_MASK 0x0c |
#define | PDU_MASK 0x30 |
Functions | |
uint16_t ee_addr_logic | __attribute__ ((section(".eeprom"))) |
void | net_ind (uint8_t *buf, uint8_t len, const net_ind_t *ind) |
Called from network layer if a packet arrived for us... | |
void | net_con (void) |
Called from network layer if a queued packet was sent. | |
uint8_t | lnk_ind (uint8_t *buf, uint8_t len) |
Called from link layer if a packet has been received. | |
void | lnk_con (void) |
Called from link layer if a packet was delivered. | |
uint8_t | net_requ (net_buf_t *buf, const net_requ_t *requ) |
Send a packet. | |
uint8_t | net_compare_src_addr (const net_addr_t *addr1, const net_addr_t *addr2) |
Compares two source network addresses. | |
uint8_t | net_get_local_member_id (uint8_t group) |
Returns local member number for a group. | |
uint8_t | net_clear_to_send (void) |
Check if another packet can be scheduled for transmission. | |
void | net_set_logic_addr (uint16_t addr) |
Set logic address. | |
uint16_t | net_get_logic_addr (void) |
Get logic address. | |
void | net_set_group_addr (uint8_t group, uint16_t addr) |
Set address of a group. | |
uint16_t | net_get_group_addr (uint8_t group) |
Get group address. |
Implements the OpenHome network layer. The code is quite straight forward and rather self explainary.
Definition in file network.c.
|
Called from link layer if a packet was delivered. Simply passes event to upper layers. Definition at line 139 of file network.c. References net_con(). Referenced by lnk_process(). |
|
Called from link layer if a packet has been received. This function is also called for locally generated packets to determine if the packet should be transmitted on the bus. If the destination address of the packet matches a local one then net_ind() is called to pass it to upper layers.
Definition at line 86 of file network.c. References net_addr_t::addr, AT_LOGIC, AT_PHYSIC, net_addr_t::format, NAF_BROADCAST, NAF_GROUP, NAF_LOGIC, NAF_PHYSIC, net_ind(), net_ind_t::pdu, net_ind_t::rat, and net_ind_t::src. Referenced by lnk_process(), and net_requ(). |
|
Check if another packet can be scheduled for transmission.
Definition at line 238 of file network.c. References lnk_clear_to_send(). Referenced by tsp_process(). |
|
Compares two source network addresses. Since source and destination addresses differ in the group address format this function only compares two SOURCE network addresses.
Definition at line 210 of file network.c. References net_addr_t::addr, and net_addr_t::format. |
|
Called from network layer if a queued packet was sent. Checks if tsp_con_fin() should be called. Definition at line 380 of file transport.c. References tsp_con_fin(). Referenced by lnk_con(), and net_requ(). |
|
Get group address.
|
|
Returns local member number for a group.
Definition at line 227 of file network.c. Referenced by net_ind(). |
|
Get logic address.
|
|
Called from network layer if a packet arrived for us...
Definition at line 296 of file transport.c. References net_addr_t::addr, net_addr_t::format, NAF_GROUP, net_get_local_member_id(), NPDU_SESSION, NPDU_SINGLE, net_ind_t::pdu, net_ind_t::rat, net_ind_t::src, tsp_con(), tsp_con_fin(), and tsp_ind(). Referenced by lnk_ind(). |
|
Send a packet. This functions adds the network layer specific header and passes the packet to the link layer. Also checks if it should be delivered locally.
Definition at line 162 of file network.c. References net_addr_t::addr, AT_LOGIC, AT_PHYSIC, net_requ_t::backlog, net_requ_t::dest, net_addr_t::format, lnk_clear_to_send(), lnk_ind(), lnk_requ(), NAF_GROUP, NAF_LOGIC, NAF_PHYSIC, net_con(), net_requ_t::pdu, and net_requ_t::src. Referenced by tsp_process(). |
|
Set address of a group.
|
|
Set logic address.
|