Skip to content

Commit a1f2943

Browse files
authored
fix: correct const (#130)
* fix: correct `const` * chore: bump patch version * chore: update `keywords.txt`
1 parent cc0a6ed commit a1f2943

File tree

5 files changed

+35
-40
lines changed

5 files changed

+35
-40
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[![Coverage Status](https://coveralls.io/repos/github/blues/note-arduino/badge.svg?branch=master)](https://coveralls.io/github/blues/note-arduino?branch=master)
22

3-
# note-arduino
3+
# note-arduino
44

55
The note-arduino Arduino library for communicating with the
66
[Blues][blues] Notecard via serial or I²C. Includes example sketches in

keywords.txt

+5-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ clearDebugOutputStream KEYWORD2
1111
clearTransactionPins KEYWORD2
1212
debugSyncStatus KEYWORD2
1313
deleteResponse KEYWORD2
14-
logDebug KEYWORD2
15-
logDebugf KEYWORD2
14+
end KEYWORD2
1615
newCommand KEYWORD2
1716
newRequest KEYWORD2
1817
requestAndResponse KEYWORD2
@@ -30,6 +29,10 @@ setTransactionPins KEYWORD2
3029
########################################
3130
Notecard_h LITERAL1
3231
Notecarrier_h LITERAL1
32+
NOTE_ARDUINO_VERSION LITERAL1
33+
NOTE_ARDUINO_VERSION_MAJOR LITERAL1
34+
NOTE_ARDUINO_VERSION_MINOR LITERAL1
35+
NOTE_ARDUINO_VERSION_PATCH LITERAL1
3336

3437
########################################
3538
## DATA TYPES

library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=Blues Wireless Notecard
2-
version=1.6.0
2+
version=1.6.1
33
author=Blues
44
maintainer=Blues <[email protected]>
55
sentence=An easy to use Notecard Library for Arduino.

src/Notecard.cpp

+10-20
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ void noteTransactionStop (void) {
186186
The TwoWire implementation to use for I2C communication.
187187
*/
188188
/**************************************************************************/
189-
void Notecard::platformInit (bool assignCallbacks) const
189+
void Notecard::platformInit (bool assignCallbacks)
190190
{
191191
NoteSetUserAgent((char *) ("note-arduino " NOTE_ARDUINO_VERSION));
192192
if (assignCallbacks) {
@@ -225,7 +225,7 @@ Notecard::~Notecard (void)
225225
appropriately for the host.
226226
*/
227227
/**************************************************************************/
228-
void Notecard::begin(NoteI2c * noteI2c_, uint32_t i2cAddress_, uint32_t i2cMax_) const
228+
void Notecard::begin(NoteI2c * noteI2c_, uint32_t i2cAddress_, uint32_t i2cMax_)
229229
{
230230
noteI2c = noteI2c_;
231231
platformInit(noteI2c);
@@ -247,7 +247,7 @@ void Notecard::begin(NoteI2c * noteI2c_, uint32_t i2cAddress_, uint32_t i2cMax_)
247247
communicating with the Notecard from the host.
248248
*/
249249
/**************************************************************************/
250-
void Notecard::begin(NoteSerial * noteSerial_) const
250+
void Notecard::begin(NoteSerial * noteSerial_)
251251
{
252252
noteSerial = noteSerial_;
253253
platformInit(noteSerial);
@@ -268,16 +268,6 @@ void Notecard::begin(NoteSerial * noteSerial_) const
268268
}
269269
}
270270

271-
/**************************************************************************/
272-
/*!
273-
@brief Clear the debug output source.
274-
*/
275-
/**************************************************************************/
276-
void Notecard::clearDebugOutputStream(void) const
277-
{
278-
setDebugOutputStream(nullptr);
279-
}
280-
281271
/**************************************************************************/
282272
/*!
283273
@brief Periodically show Notecard sync status, returning `TRUE`
@@ -287,10 +277,10 @@ void Notecard::clearDebugOutputStream(void) const
287277
@param maxLevel
288278
The maximum log level to output to the debug console. Pass
289279
-1 for all.
290-
@return `True` if a pending response was displayed to the debug stream.
280+
@return `true` if a pending response was displayed to the debug stream.
291281
*/
292282
/**************************************************************************/
293-
bool Notecard::debugSyncStatus(int pollFrequencyMs, int maxLevel) const
283+
bool Notecard::debugSyncStatus(int pollFrequencyMs, int maxLevel)
294284
{
295285
return NoteDebugSyncStatus(pollFrequencyMs, maxLevel);
296286
}
@@ -314,7 +304,7 @@ void Notecard::deleteResponse(J *rsp) const
314304
interfaces, and frees all associated memory.
315305
*/
316306
/**************************************************************************/
317-
void Notecard::end(void) const
307+
void Notecard::end(void)
318308
{
319309
// Clear Communication Interfaces
320310
NoteSetFnI2C(0, 0, nullptr, nullptr, nullptr);
@@ -490,7 +480,7 @@ bool Notecard::sendRequestWithRetry(J *req, uint32_t timeoutSeconds) const
490480
debug output.
491481
*/
492482
/**************************************************************************/
493-
void Notecard::setDebugOutputStream(NoteLog * noteLog_) const
483+
void Notecard::setDebugOutputStream(NoteLog * noteLog_)
494484
{
495485
noteLog = noteLog_;
496486
if (noteLog) {
@@ -513,7 +503,7 @@ void Notecard::setDebugOutputStream(NoteLog * noteLog_) const
513503
I2C bus taken during the call to `lockI2cFn()`.
514504
*/
515505
/**************************************************************************/
516-
void Notecard::setFnI2cMutex(mutexFn lockI2cFn_, mutexFn unlockI2cFn_) const {
506+
void Notecard::setFnI2cMutex(mutexFn lockI2cFn_, mutexFn unlockI2cFn_) {
517507
NoteSetFnI2CMutex(lockI2cFn_, unlockI2cFn_);
518508
}
519509

@@ -530,7 +520,7 @@ void Notecard::setFnI2cMutex(mutexFn lockI2cFn_, mutexFn unlockI2cFn_) const {
530520
Notecard transaction taken during the call to `lockNoteFn()`.
531521
*/
532522
/**************************************************************************/
533-
void Notecard::setFnNoteMutex(mutexFn lockNoteFn_, mutexFn unlockNoteFn_) const {
523+
void Notecard::setFnNoteMutex(mutexFn lockNoteFn_, mutexFn unlockNoteFn_) {
534524
NoteSetFnNoteMutex(lockNoteFn_, unlockNoteFn_);
535525
}
536526

@@ -549,7 +539,7 @@ void Notecard::setFnNoteMutex(mutexFn lockNoteFn_, mutexFn unlockNoteFn_) const
549539
A platform specific tuple of digital I/O pins.
550540
*/
551541
/**************************************************************************/
552-
void Notecard::setTransactionPins(NoteTxn * noteTxn_) const {
542+
void Notecard::setTransactionPins(NoteTxn * noteTxn_) {
553543
noteTxn = noteTxn_; // Set global interface
554544
if (noteTxn_) {
555545
NoteSetFnTransaction(noteTransactionStart, noteTransactionStop);

src/Notecard.h

+18-16
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747

4848
#define NOTE_ARDUINO_VERSION_MAJOR 1
4949
#define NOTE_ARDUINO_VERSION_MINOR 6
50-
#define NOTE_ARDUINO_VERSION_PATCH 0
50+
#define NOTE_ARDUINO_VERSION_PATCH 1
5151

5252
#define NOTE_ARDUINO_VERSION NOTE_C_STRINGIZE(NOTE_ARDUINO_VERSION_MAJOR) "." NOTE_C_STRINGIZE(NOTE_ARDUINO_VERSION_MINOR) "." NOTE_C_STRINGIZE(NOTE_ARDUINO_VERSION_PATCH)
5353

@@ -73,32 +73,34 @@ class Notecard
7373
#ifdef ARDUINO
7474
inline void begin(uint32_t i2cAddress = NOTE_I2C_ADDR_DEFAULT,
7575
uint32_t i2cMax = NOTE_I2C_MAX_DEFAULT,
76-
TwoWire &wirePort = Wire) const {
76+
TwoWire &wirePort = Wire) {
7777
begin(make_note_i2c(&wirePort), i2cAddress, i2cMax);
7878
}
79-
inline void begin(HardwareSerial &serial, uint32_t speed = 9600) const {
79+
inline void begin(HardwareSerial &serial, uint32_t speed = 9600) {
8080
MakeNoteSerial_ArduinoParameters arduino_parameters(serial, speed);
8181
begin(make_note_serial(&arduino_parameters));
8282
}
83-
inline void setDebugOutputStream(Stream &dbgserial) const {
83+
inline void setDebugOutputStream(Stream &dbgserial) {
8484
setDebugOutputStream(make_note_log(&dbgserial));
8585
}
86-
inline void setTransactionPins(uint8_t ctx_pin, uint8_t rtx_pin) const {
86+
inline void setTransactionPins(uint8_t ctx_pin, uint8_t rtx_pin) {
8787
uint8_t txn_pins[2] = {ctx_pin, rtx_pin};
8888
setTransactionPins(make_note_txn(txn_pins));
8989
}
9090
#endif
9191
void begin(NoteI2c * noteI2c,
9292
uint32_t i2cAddress = NOTE_I2C_ADDR_DEFAULT,
93-
uint32_t i2cMax = NOTE_I2C_MAX_DEFAULT) const;
94-
void begin(NoteSerial * noteSerial) const;
95-
void clearDebugOutputStream(void) const;
96-
inline void clearTransactionPins(void) const {
93+
uint32_t i2cMax = NOTE_I2C_MAX_DEFAULT);
94+
void begin(NoteSerial * noteSerial);
95+
inline void clearDebugOutputStream(void) {
96+
setDebugOutputStream(nullptr);
97+
}
98+
inline void clearTransactionPins(void) {
9799
setTransactionPins(nullptr);
98100
}
99-
bool debugSyncStatus (int pollFrequencyMs, int maxLevel) const;
101+
bool debugSyncStatus (int pollFrequencyMs, int maxLevel);
100102
void deleteResponse(J *rsp) const;
101-
void end(void) const;
103+
void end(void);
102104
NOTE_ARDUINO_DEPRECATED void logDebug(const char *message) const;
103105
NOTE_ARDUINO_DEPRECATED void logDebugf(const char *format, ...) const;
104106
J *newCommand(const char *request) const;
@@ -108,13 +110,13 @@ class Notecard
108110
bool responseError(J *rsp) const;
109111
bool sendRequest(J *req) const;
110112
bool sendRequestWithRetry(J *req, uint32_t timeoutSeconds) const;
111-
void setDebugOutputStream(NoteLog * noteLog) const;
112-
void setFnI2cMutex(mutexFn lockI2cFn, mutexFn unlockI2cFn) const;
113-
void setFnNoteMutex(mutexFn lockNoteFn, mutexFn unlockNoteFn) const;
114-
void setTransactionPins(NoteTxn * noteTxn) const;
113+
void setDebugOutputStream(NoteLog * noteLog);
114+
void setFnI2cMutex(mutexFn lockI2cFn, mutexFn unlockI2cFn);
115+
void setFnNoteMutex(mutexFn lockNoteFn, mutexFn unlockNoteFn);
116+
void setTransactionPins(NoteTxn * noteTxn);
115117

116118
private:
117-
void platformInit (bool assignCallbacks) const;
119+
void platformInit (bool assignCallbacks);
118120
};
119121

120122
#endif

0 commit comments

Comments
 (0)