-
Notifications
You must be signed in to change notification settings - Fork 4
/
DCCScheduler.h
33 lines (27 loc) · 746 Bytes
/
DCCScheduler.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
#ifndef DCC_SHED_H
#define DCC_SHED_H
#include "DCCPacket.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Used to specify which queue to place a packet in for sending */
typedef enum {
DCC_HIPRI,
DCC_LOPRI,
DCC_EPRI
} DCCPriority;
/* Initialises local state including packet queues, idle packet
* and dcc hardware, ready for sending packets
* returns 1 if successful, 0 otherwise
*/
int dccshed_init();
/* Prints out the status of the scheduler queues */
void dccshed_status();
/* Adds the pkt to the appropriate queue based on the specified priority
* returns 1 if successfully added, 0 if queue was full & packet dropped
*/
int dccshed_send(DCCPriority pri, DCCPacket *pkt);
#ifdef __cplusplus
}
#endif
#endif /* DCC_SHED_H */