-
Notifications
You must be signed in to change notification settings - Fork 1
/
SxRadioEvents.h
89 lines (77 loc) · 2.49 KB
/
SxRadioEvents.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/*
/ _____) _ | |
( (____ _____ ____ _| |_ _____ ____| |__
\____ \| ___ | (_ _) ___ |/ ___) _ \
_____) ) ____| | | || |_| ____( (___| | | |
(______/|_____)_|_|_| \__)_____)\____)_| |_|
(C)2013 Semtech
Description: Generic radio driver definition
License: Revised BSD License, see LICENSE.TXT file include in the project
Maintainer: Miguel Luis and Gregory Cristian
*/
#ifndef __SXRADIOEVENTS_H__
#define __SXRADIOEVENTS_H__
/*!
* \brief Radio driver callback functions
*/
class SxRadioEvents
{
public:
/*!
* \brief Tx Start callback prototype.
*/
virtual void TxStart( void ) {}
/*!
* \brief Tx Done callback prototype.
*/
virtual void TxDone( void ) {}
/*!
* \brief Tx Timeout callback prototype.
*/
virtual void TxTimeout( void ) {}
/*!
* \brief Rx Done callback prototype.
*
* \param [IN] payload Received buffer pointer
* \param [IN] size Received buffer size
* \param [IN] rssi RSSI value computed while receiving the frame [dBm]
* \param [IN] snr Raw SNR value given by the radio hardware
* FSK : N/A ( set to 0 )
* LoRa: SNR value is two's complement in 1/4 dB
*/
virtual void RxDone( uint8_t *payload, uint16_t size, int16_t rssi, int16_t snr ) {}
virtual void RxDone( uint8_t *payload, uint16_t size, int16_t rssi, int16_t snr, uint8_t wnd ) {}
/*!
* \brief Called if Beacon Window cannot be opened or is missed
*
* \param [IN] beaconTime Updated time of beacon for the period
* \param [IN] no_rx True if called from rx done
*/
virtual void OnBeaconless( uint32_t beaconTime, bool no_rx = false ) {}
/*!
* \brief Rx Timeout callback prototype.
*/
virtual void RxTimeout( void ) {}
/*!
* \brief Rx Error callback prototype.
*/
virtual void RxError( void ) {}
/*!
* \brief FHSS Change Channel callback prototype.
*
* \param [IN] currentChannel Index number of the current channel
*/
virtual void FhssChangeChannel( uint8_t currentChannel ) {}
/*!
* \brief CAD Done callback prototype.
*
* \param [IN] channelActivityDetected Channel Activity detected during the CAD
*/
virtual void CadDone( bool channelActivityDetected ) {}
/*!
* \brief Mac Event callback prototype.
*/
virtual void MacEvent( void ) {}
virtual void LinkIdle(void) {}
};
#endif // __SXRADIOEVENTS_H__