@@ -18,7 +18,7 @@ class StreamPacket {
1818 // chunked отправщик
1919 class Sender {
2020 public:
21- Sender (Stream & s) : _s(s) {}
21+ Sender (Print & s) : _s(s) {}
2222
2323 // начать пакет
2424 template <typename Tp>
@@ -44,7 +44,7 @@ class StreamPacket {
4444 }
4545
4646 private:
47- Stream & _s;
47+ Print & _s;
4848 uint8_t _crc = 0 ;
4949 };
5050
@@ -117,13 +117,13 @@ class StreamPacket {
117117
118118 // отправить данные
119119 template <typename Tp, typename Td>
120- static bool send (Stream & s, Tp type, const Td& data) {
120+ static bool send (Print & s, Tp type, const Td& data) {
121121 return send (s, type, &data, sizeof (Td));
122122 }
123123
124124 // отправить данные
125125 template <typename Tp>
126- static bool send (Stream & s, Tp type, const void * data, size_t len) {
126+ static bool send (Print & s, Tp type, const void * data, size_t len) {
127127 return _beginSend (s, type, len) &&
128128 s.write ((uint8_t *)data, len) == len &&
129129 s.write (_crc8 (data, len)) == 1 ;
@@ -186,7 +186,7 @@ class StreamPacket {
186186
187187 // начать отправку
188188 template <typename Tp>
189- static bool _beginSend (Stream & s, Tp type, size_t len) {
189+ static bool _beginSend (Print & s, Tp type, size_t len) {
190190 Packet p{len, (uint8_t )type};
191191 p.crc = _crc8 (&p, sizeof (p) - 1 );
192192 return s.write ((uint8_t )SP_START) == 1 && s.write ((uint8_t *)&p, sizeof (p)) == sizeof (p);
0 commit comments