[Pager] Cppcheck fixes
This commit is contained in:
parent
208f4f8ad4
commit
bf1933a0c4
2 changed files with 7 additions and 7 deletions
|
@ -67,10 +67,10 @@ int16_t PagerClient::transmit(String& str, uint32_t addr, uint8_t encoding, uint
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int16_t PagerClient::transmit(const char* str, uint32_t addr, uint8_t encoding, uint8_t function) {
|
int16_t PagerClient::transmit(const char* str, uint32_t addr, uint8_t encoding, uint8_t function) {
|
||||||
return(PagerClient::transmit((uint8_t*)str, strlen(str), addr, encoding, function));
|
return(PagerClient::transmit(reinterpret_cast<uint8_t*>(const_cast<char*>(str)), strlen(str), addr, encoding, function));
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t PagerClient::transmit(uint8_t* data, size_t len, uint32_t addr, uint8_t encoding, uint8_t function) {
|
int16_t PagerClient::transmit(const uint8_t* data, size_t len, uint32_t addr, uint8_t encoding, uint8_t function) {
|
||||||
if(addr > RADIOLIB_PAGER_ADDRESS_MAX) {
|
if(addr > RADIOLIB_PAGER_ADDRESS_MAX) {
|
||||||
return(RADIOLIB_ERR_INVALID_ADDRESS_WIDTH);
|
return(RADIOLIB_ERR_INVALID_ADDRESS_WIDTH);
|
||||||
}
|
}
|
||||||
|
@ -326,14 +326,14 @@ int16_t PagerClient::readData(String& str, size_t len, uint32_t* addr) {
|
||||||
// check tone-only transmissions
|
// check tone-only transmissions
|
||||||
if(length == 0) {
|
if(length == 0) {
|
||||||
length = 6;
|
length = 6;
|
||||||
strncpy((char*)data, "<tone>", length + 1);
|
strncpy(reinterpret_cast<char*>(data), "<tone>", length + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// add null terminator
|
// add null terminator
|
||||||
data[length] = 0;
|
data[length] = 0;
|
||||||
|
|
||||||
// initialize Arduino String class
|
// initialize Arduino String class
|
||||||
str = String((char*)data);
|
str = String(reinterpret_cast<char*>(data));
|
||||||
}
|
}
|
||||||
|
|
||||||
// deallocate temporary buffer
|
// deallocate temporary buffer
|
||||||
|
@ -494,7 +494,7 @@ bool PagerClient::addressMatched(uint32_t addr) {
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PagerClient::write(uint32_t* data, size_t len) {
|
void PagerClient::write(const uint32_t* data, size_t len) {
|
||||||
// write code words from buffer
|
// write code words from buffer
|
||||||
for(size_t i = 0; i < len; i++) {
|
for(size_t i = 0; i < len; i++) {
|
||||||
RADIOLIB_DEBUG_PROTOCOL_PRINTLN("POCSAG W\t%lu\t%08lX", (long unsigned int)i, (long unsigned int)data[i]);
|
RADIOLIB_DEBUG_PROTOCOL_PRINTLN("POCSAG W\t%lu\t%08lX", (long unsigned int)i, (long unsigned int)data[i]);
|
||||||
|
|
|
@ -117,7 +117,7 @@ class PagerClient {
|
||||||
\param function bits (NUMERIC, TONE, ACTIVATION, ALPHANUMERIC). Allowed values 0 to 3. Defaults to auto select by specified encoding
|
\param function bits (NUMERIC, TONE, ACTIVATION, ALPHANUMERIC). Allowed values 0 to 3. Defaults to auto select by specified encoding
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
int16_t transmit(uint8_t* data, size_t len, uint32_t addr, uint8_t encoding = RADIOLIB_PAGER_BCD, uint8_t function = RADIOLIB_PAGER_FUNC_AUTO);
|
int16_t transmit(const uint8_t* data, size_t len, uint32_t addr, uint8_t encoding = RADIOLIB_PAGER_BCD, uint8_t function = RADIOLIB_PAGER_FUNC_AUTO);
|
||||||
|
|
||||||
#if !RADIOLIB_EXCLUDE_DIRECT_RECEIVE
|
#if !RADIOLIB_EXCLUDE_DIRECT_RECEIVE
|
||||||
/*!
|
/*!
|
||||||
|
@ -190,7 +190,7 @@ class PagerClient {
|
||||||
size_t filterNumAddresses = 0;
|
size_t filterNumAddresses = 0;
|
||||||
bool inv = false;
|
bool inv = false;
|
||||||
|
|
||||||
void write(uint32_t* data, size_t len);
|
void write(const uint32_t* data, size_t len);
|
||||||
void write(uint32_t codeWord);
|
void write(uint32_t codeWord);
|
||||||
int16_t startReceiveCommon();
|
int16_t startReceiveCommon();
|
||||||
bool addressMatched(uint32_t addr);
|
bool addressMatched(uint32_t addr);
|
||||||
|
|
Loading…
Add table
Reference in a new issue