OpenWSN Firmware
Main Page
Modules
Data Structures
Files
File List
Globals
sixtop.h
Go to the documentation of this file.
1
#ifndef __SIXTOP_H
2
#define __SIXTOP_H
3
11
#include "
opentimers.h
"
12
#include "
openwsn.h
"
13
14
//=========================== define ==========================================
15
16
enum
sixtop_CommandID_num
{
17
SIXTOP_SOFT_CELL_REQ
= 0x00,
18
SIXTOP_SOFT_CELL_RESPONSE
= 0x01,
19
SIXTOP_REMOVE_SOFT_CELL_REQUEST
= 0x02,
20
};
21
22
// states of the sixtop-to-sixtop state machine
23
typedef
enum
{
24
SIX_IDLE
= 0x00,
// ready for next event
25
// ADD: source
26
SIX_SENDING_ADDREQUEST
= 0x01,
// generating LinkRequest packet
27
SIX_WAIT_ADDREQUEST_SENDDONE
= 0x02,
// waiting for SendDone confirmation
28
SIX_WAIT_ADDRESPONSE
= 0x03,
// waiting for response from the neighbor
29
SIX_ADDRESPONSE_RECEIVED
= 0x04,
// I received the link response request command
30
// ADD: destinations
31
SIX_ADDREQUEST_RECEIVED
= 0x05,
// I received the link request command
32
SIX_SENDING_ADDRESPONSE
= 0x06,
// generating resLinkRespone command packet
33
SIX_WAIT_ADDRESPONSE_SENDDONE
= 0x07,
// waiting for SendDone confirmation
34
// REMOVE: source
35
SIX_SENDING_REMOVEREQUEST
= 0x08,
// generating resLinkRespone command packet
36
SIX_WAIT_REMOVEREQUEST_SENDDONE
= 0x09,
// waiting for SendDone confirmation
37
// REMOVE: destinations
38
SIX_REMOVEREQUEST_RECEIVED
= 0x0a
// I received the remove link request command
39
}
six2six_state_t
;
40
41
//=========================== typedef =========================================
42
43
#define SIX2SIX_TIMEOUT_MS 2000
44
45
//=========================== module variables ================================
46
47
typedef
struct
{
48
uint16_t
periodMaintenance
;
49
bool
busySendingKA
;
// TRUE when busy sending a keep-alive
50
bool
busySendingEB
;
// TRUE when busy sending an enhanced beacon
51
uint8_t
dsn
;
// current data sequence number
52
uint8_t
mgtTaskCounter
;
// counter to determine what management task to do
53
opentimer_id_t
maintenanceTimerId
;
54
opentimer_id_t
timeoutTimerId
;
// TimeOut timer id
55
uint16_t
kaPeriod
;
// period of sending KA
56
six2six_state_t
six2six_state
;
57
uint8_t
commandID
;
58
}
sixtop_vars_t
;
59
60
//=========================== prototypes ======================================
61
62
// admin
63
void
sixtop_init
(
void
);
64
void
sixtop_setKaPeriod
(uint16_t kaPeriod);
65
// scheduling
66
void
sixtop_addCells
(
open_addr_t
* neighbor, uint16_t numCells);
67
void
sixtop_removeCell
(
open_addr_t
* neighbor);
68
// from upper layer
69
owerror_t
sixtop_send
(
OpenQueueEntry_t
*msg);
70
// from lower layer
71
void
task_sixtopNotifSendDone
(
void
);
72
void
task_sixtopNotifReceive
(
void
);
73
// debugging
74
bool
debugPrint_myDAGrank
(
void
);
75
bool
debugPrint_kaPeriod
(
void
);
76
82
#endif
SIX_WAIT_ADDREQUEST_SENDDONE
Definition:
sixtop.h:27
sixtop_vars_t::busySendingEB
bool busySendingEB
Definition:
sixtop.h:50
sixtop_vars_t::kaPeriod
uint16_t kaPeriod
Definition:
sixtop.h:55
SIX_ADDREQUEST_RECEIVED
Definition:
sixtop.h:31
SIX_ADDRESPONSE_RECEIVED
Definition:
sixtop.h:29
debugPrint_myDAGrank
bool debugPrint_myDAGrank()
Trigger this module to print status information, over serial.
Definition:
sixtop.c:498
SIX_WAIT_ADDRESPONSE_SENDDONE
Definition:
sixtop.h:33
SIX_WAIT_REMOVEREQUEST_SENDDONE
Definition:
sixtop.h:36
SIX_SENDING_REMOVEREQUEST
Definition:
sixtop.h:35
SIX_REMOVEREQUEST_RECEIVED
Definition:
sixtop.h:38
owerror_t
uint8_t owerror_t
Definition:
openwsn.h:265
sixtop_vars_t::timeoutTimerId
opentimer_id_t timeoutTimerId
Definition:
sixtop.h:54
opentimers.h
sixtop_init
void sixtop_init()
Definition:
sixtop.c:118
SIX_SENDING_ADDREQUEST
Definition:
sixtop.h:26
sixtop_addCells
void sixtop_addCells(open_addr_t *neighbor, uint16_t numCells)
Definition:
sixtop.c:152
task_sixtopNotifSendDone
void task_sixtopNotifSendDone()
Definition:
sixtop.c:340
SIXTOP_SOFT_CELL_REQ
Definition:
sixtop.h:17
sixtop_vars_t::busySendingKA
bool busySendingKA
Definition:
sixtop.h:49
sixtop_setKaPeriod
void sixtop_setKaPeriod(uint16_t kaPeriod)
Definition:
sixtop.c:142
openwsn.h
opentimer_id_t
#define opentimer_id_t
Definition:
opentimers.h:28
six2six_state_t
six2six_state_t
Definition:
sixtop.h:23
open_addr_t
Definition:
openwsn.h:276
SIXTOP_SOFT_CELL_RESPONSE
Definition:
sixtop.h:18
sixtop_send
owerror_t sixtop_send(OpenQueueEntry_t *msg)
Definition:
sixtop.c:317
SIX_WAIT_ADDRESPONSE
Definition:
sixtop.h:28
sixtop_vars_t::dsn
uint8_t dsn
Definition:
sixtop.h:51
sixtop_vars_t::commandID
uint8_t commandID
Definition:
sixtop.h:57
sixtop_vars_t
Definition:
sixtop.h:47
SIX_IDLE
Definition:
sixtop.h:24
SIXTOP_REMOVE_SOFT_CELL_REQUEST
Definition:
sixtop.h:19
sixtop_vars_t::maintenanceTimerId
opentimer_id_t maintenanceTimerId
Definition:
sixtop.h:53
task_sixtopNotifReceive
void task_sixtopNotifReceive()
Definition:
sixtop.c:413
OpenQueueEntry_t
Definition:
openwsn.h:288
sixtop_CommandID_num
sixtop_CommandID_num
Definition:
sixtop.h:16
sixtop_vars_t::mgtTaskCounter
uint8_t mgtTaskCounter
Definition:
sixtop.h:52
debugPrint_kaPeriod
bool debugPrint_kaPeriod()
Trigger this module to print status information, over serial.
Definition:
sixtop.c:516
sixtop_removeCell
void sixtop_removeCell(open_addr_t *neighbor)
Definition:
sixtop.c:234
sixtop_vars_t::six2six_state
six2six_state_t six2six_state
Definition:
sixtop.h:56
sixtop_vars_t::periodMaintenance
uint16_t periodMaintenance
Definition:
sixtop.h:48
SIX_SENDING_ADDRESPONSE
Definition:
sixtop.h:32
firmware
openos
openwsn
02b-MAChigh
sixtop.h
Generated on Wed Sep 24 2014 04:39:18 for OpenWSN Firmware by
1.8.5