ACKme Logo WiConnect Host Library- API Reference Guide
 
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups Pages
WiconnectSerial.h
1 
29 #pragma once
30 
31 #include "WiconnectTypes.h"
32 
33 
34 namespace wiconnect
35 {
36 
42 class WiconnectSerial WICONNECT_SERIAL_BASE_CLASS
43 {
44 public:
45  WiconnectSerial(const SerialConfig &config, Wiconnect *wiconnect = NULL);
46  virtual ~WiconnectSerial();
47 
48  void flush(void);
49  int write(const void *data, int bytesToWrite, int timeoutMs);
50  int read(void *data, int bytesToRead, int timeoutMs);
51 
52 protected:
53  TimeoutTimer timeoutTimer;
54 #ifdef WICONNECT_SERIAL_RX_BUFFER
55  uint8_t ringBuffer[32];
56  bool bufferAlloc;
57  void rxIrqHandler(void);
58 #endif
59 };
60 
61 
62 }
63 
64