8 #ifndef MAP27_PHYSICALLAYER_H
9 #define MAP27_PHYSICALLAYER_H
26 #define MAP27_PHYSICAL_TYPE_LR 0x01
27 #define MAP27_PHYSICAL_TYPE_LA 0x02
28 #define MAP27_PHYSICAL_TYPE_LT 0x04
76 void send(uint8_t *buf, uint16_t len);
102 void sendLinkTransfer(uint8_t n_s, uint8_t ar, uint8_t* buf, uint16_t bufLen);
116 void handleRx(uint8_t ch);
117 virtual void handleMessage();
118 bool appendRxBuffer(uint8_t ch);
119 virtual void handleLinkRequest(uint8_t n1, uint8_t k, uint8_t version);
120 virtual void handleLinkAcknowledge(uint8_t n_r, uint8_t n_k);
121 virtual void handleLinkTransfer(uint8_t n_s, uint8_t ar, uint8_t* buf, uint16_t bufLen);
122 void sendFrameStart();
123 void sendFrameData(uint8_t *buf, uint16_t len);
135 RX_STATE_WAIT_FCS1 = 6,
136 RX_STATE_WAIT_FCS2 = 7
169 PhysicalRxState _rxState;
170 uint8_t _rxBuf[MAP27_MAX_MESSAGE_LEN];
Manage the Physical Layer of the Map27 protocol stack.
Definition: PhysicalLayer.h:37
Class for calculating Map27 Frame Check Sequence.
Definition: FCS.h:22
void sendLinkRequest(uint8_t n1, uint8_t k, uint8_t version)
Definition: PhysicalLayer.cpp:209
void sendLinkAcknowledge(uint8_t n_r, uint8_t n_k)
Definition: PhysicalLayer.cpp:220
Manage the Data Layer of the Map27 protocol stack.
Definition: DataLayer.h:26
Abstract superclass for accessing RS232 port on the host.
Definition: Port.h:23
void setDataLayer(Map27DataLayer *dataLayer)
Definition: PhysicalLayer.cpp:46
void clearRxBuf()
Definition: PhysicalLayer.cpp:246
void send(uint8_t *buf, uint16_t len)
Definition: PhysicalLayer.cpp:100
Map27DataLayer * dataLayer()
Definition: PhysicalLayer.cpp:51
void poll()
Definition: PhysicalLayer.cpp:56
void setPort(Map27Port *port)
Definition: PhysicalLayer.cpp:30
void sendLinkTransfer(uint8_t n_s, uint8_t ar, uint8_t *buf, uint16_t bufLen)
Definition: PhysicalLayer.cpp:231
Map27PhysicalLayer()
Constructor.
Definition: PhysicalLayer.cpp:14
Map27Port * port()
Definition: PhysicalLayer.cpp:35
bool configure_rs232_port(uint32_t baud=9600)
Definition: PhysicalLayer.cpp:40
void reset()
Definition: PhysicalLayer.cpp:20
virtual void sendToPort(uint8_t ch)
Definition: PhysicalLayer.cpp:203