socket_zep.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 Freie Universität Berlin
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
56 #ifndef SOCKET_ZEP_H
57 #define SOCKET_ZEP_H
58 
59 #include "net/netdev.h"
60 #include "net/netdev/ieee802154.h"
61 #include "net/zep.h"
62 
63 #ifdef __cplusplus
64 extern "C" {
65 #endif
66 
70 typedef struct {
72  int sock_fd;
74  uint32_t seq;
78  uint8_t rcv_buf[sizeof(zep_v2_data_hdr_t) + IEEE802154_FRAME_LEN_MAX];
82  uint8_t snd_hdr_buf[sizeof(zep_v2_data_hdr_t)];
83  uint16_t chksum_buf;
84 } socket_zep_t;
85 
89 typedef struct {
90  char *local_addr;
91  char *local_port;
92  char *remote_addr;
93  char *remote_port;
95 
102 void socket_zep_setup(socket_zep_t *dev, const socket_zep_params_t *params);
103 
110 
111 #ifdef __cplusplus
112 }
113 #endif
114 
115 #endif /* SOCKET_ZEP_H */
116 
socket_zep_params_t
ZEP device initialization parameters.
Definition: socket_zep.h:89
socket_zep_params_t::local_port
char * local_port
local address string
Definition: socket_zep.h:91
socket_zep_params_t::remote_addr
char * remote_addr
remote address string
Definition: socket_zep.h:92
ieee802154.h
Definitions for netdev common IEEE 802.15.4 code.
netdev_event_t
netdev_event_t
Possible event types that are send from the device driver to the upper layer.
Definition: netdev.h:234
socket_zep_t::netdev
netdev_ieee802154_t netdev
netdev internal member
Definition: socket_zep.h:71
socket_zep_t::sock_fd
int sock_fd
socket fd
Definition: socket_zep.h:72
socket_zep_t::seq
uint32_t seq
ZEP sequence number.
Definition: socket_zep.h:74
socket_zep_params_t::remote_port
char * remote_port
local address string
Definition: socket_zep.h:93
zep_v2_data_hdr_t
ZEPv2 header definition (type == Data)
Definition: zep.h:76
IEEE802154_FRAME_LEN_MAX
#define IEEE802154_FRAME_LEN_MAX
maximum 802.15.4 frame length
Definition: ieee802154.h:97
socket_zep_params_t::local_addr
char * local_addr
local address string
Definition: socket_zep.h:90
netdev.h
Definitions low-level network driver interface.
socket_zep_t::chksum_buf
uint16_t chksum_buf
buffer for send checksum calculation
Definition: socket_zep.h:83
zep.h
Definitions for the ZigBee Encapsulation Protocol.
socket_zep_setup
void socket_zep_setup(socket_zep_t *dev, const socket_zep_params_t *params)
Setup socket_zep_t structure.
socket_zep_cleanup
void socket_zep_cleanup(socket_zep_t *dev)
Cleanup socket resources.
netdev_ieee802154_t
Extended structure to hold IEEE 802.15.4 driver state.
Definition: ieee802154.h:90
socket_zep_t
ZEP device state.
Definition: socket_zep.h:70
socket_zep_t::last_event
netdev_event_t last_event
event triggered
Definition: socket_zep.h:73