• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

blues / note-arduino / 24263801275

10 Apr 2026 08:56PM UTC coverage: 86.2% (-3.6%) from 89.764%
24263801275

Pull #165

github

web-flow
Merge 9ed761615 into 124eca38f
Pull Request #165: feat: add ping() method to verify connectivity and to 'fix' baud rate

114 of 166 branches covered (68.67%)

Branch coverage included in aggregate %.

0 of 15 new or added lines in 3 files covered. (0.0%)

342 of 363 relevant lines covered (94.21%)

14.24 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

20.0
/src/NoteSerial.hpp
1
#ifndef NOTE_SERIAL_HPP
2
#define NOTE_SERIAL_HPP
3

4
#include <stddef.h>
5
#include <stdint.h>
6

7
class NoteSerial
8
{
9
public:
10

11
    virtual ~NoteSerial(void) {}
20✔
12

13
    /**************************************************************************/
14
    /*!
15
        @brief  Determines if the Notecard Serial port has data available.
16
        @return The number of bytes available to read.
17
    */
18
    /**************************************************************************/
19
    virtual size_t available(void) = 0;
20

21
    /**************************************************************************/
22
    /*!
23
        @brief  Read a byte from the Notecard Serial port.
24
        @return A single character byte.
25
    */
26
    /**************************************************************************/
27
    virtual char receive(void) = 0;
28

29
    /**************************************************************************/
30
    /*!
31
        @brief  Resets the serial port.
32
        @return `true` if the Serial port is available.
33
    */
34
    /**************************************************************************/
35
    virtual bool reset(void) = 0;
36

37
    /**************************************************************************/
38
    /*!
39
        @brief  Writes a buffer to the Notecard Serial port.
40
        @param    buffer
41
                  The bytes to write.
42
        @param    size
43
                  The number of bytes to write.
44
        @param    flush
45
                  Use `true` to flush to Serial.
46
        @return The number of bytes transmitted.
47
    */
48
    /**************************************************************************/
49
    virtual size_t transmit(uint8_t * buffer, size_t size, bool flush) = 0;
50

51
    /**************************************************************************/
52
    /*!
53
        @brief  Change the baud rate of the host Serial port.
54

55
        Reconfigures the underlying platform Serial interface to operate at
56
        the specified baud rate, and updates the cached rate used by `reset()`
57
        so a subsequent reset restores to the new rate. Implementations that
58
        cannot change the rate at runtime may return `false`.
59

60
        @param rate  The new baud rate, in bits per second.
61
        @return `true` on success, `false` if the rate change is unsupported
62
                or failed.
63
    */
64
    /**************************************************************************/
NEW
65
    virtual bool setBaudRate(size_t rate) {
×
66
        (void)rate;
NEW
67
        return false;
×
68
    }
69

70
    /**************************************************************************/
71
    /*!
72
        @brief  Get the currently-configured baud rate of the host Serial port.
73
        @return The active baud rate, in bits per second. Implementations that
74
                do not track a rate may return 0.
75
    */
76
    /**************************************************************************/
NEW
77
    virtual size_t getBaudRate(void) const {
×
NEW
78
        return 0;
×
79
    }
80
};
81

82
/******************************************************************************/
83
/*!
84
    @brief Creates a NoteSerial instance
85

86
    Helper function to abstract, create and maintain a single instance
87
    of the NoteSerial interface implementation, as required by the underlying
88
    `note-c` library.
89

90
    @param[in] serial_parameters
91
               Pointer to the parameters required to instantiate
92
               the platform specific UART implementation.
93
*/
94
/******************************************************************************/
95
template<typename T> NoteSerial * make_note_serial (T & serial_parameters);
96
NoteSerial * make_note_serial (nullptr_t);
97

98
#endif // NOTE_SERIAL_HPP
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc