Skip to content
This repository was archived by the owner on Apr 23, 2023. It is now read-only.

Commit 6774550

Browse files
committed
Not passing int by reference
1 parent 1579998 commit 6774550

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

cpp_utils/BLECharacteristic.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -657,18 +657,18 @@ void BLECharacteristic::setValue(uint8_t* data, size_t length) {
657657
* @param [in] Set the value of the characteristic.
658658
* @return N/A.
659659
*/
660-
void BLECharacteristic::setValue(std::string value) {
660+
void BLECharacteristic::setValue(std::string& value) {
661661
setValue((uint8_t*)(value.data()), value.length());
662662
} // setValue
663663

664-
void BLECharacteristic::setValue(uint16_t& data16) {
664+
void BLECharacteristic::setValue(uint16_t data16) {
665665
uint8_t temp[2];
666666
temp[0] = data16;
667667
temp[1] = data16 >> 8;
668668
setValue(temp, 2);
669669
} // setValue
670670

671-
void BLECharacteristic::setValue(uint32_t& data32) {
671+
void BLECharacteristic::setValue(uint32_t data32) {
672672
uint8_t temp[4];
673673
temp[0] = data32;
674674
temp[1] = data32 >> 8;
@@ -677,7 +677,7 @@ void BLECharacteristic::setValue(uint32_t& data32) {
677677
setValue(temp, 4);
678678
} // setValue
679679

680-
void BLECharacteristic::setValue(int& data32) {
680+
void BLECharacteristic::setValue(int data32) {
681681
uint8_t temp[4];
682682
temp[0] = data32;
683683
temp[1] = data32 >> 8;
@@ -686,13 +686,13 @@ void BLECharacteristic::setValue(int& data32) {
686686
setValue(temp, 4);
687687
} // setValue
688688

689-
void BLECharacteristic::setValue(float& data32) {
689+
void BLECharacteristic::setValue(float data32) {
690690
uint8_t temp[4];
691691
*((float*)temp) = data32;
692692
setValue(temp, 4);
693693
} // setValue
694694

695-
void BLECharacteristic::setValue(double& data64) {
695+
void BLECharacteristic::setValue(double data64) {
696696
uint8_t temp[8];
697697
*((double*)temp) = data64;
698698
setValue(temp, 8);

cpp_utils/BLECharacteristic.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ class BLECharacteristic {
7171
void setNotifyProperty(bool value);
7272
void setReadProperty(bool value);
7373
void setValue(uint8_t* data, size_t size);
74-
void setValue(std::string value);
75-
void setValue(uint16_t& data16);
76-
void setValue(uint32_t& data32);
77-
void setValue(int& data32);
78-
void setValue(float& data32);
79-
void setValue(double& data64);
74+
void setValue(std::string& value);
75+
void setValue(uint16_t data16);
76+
void setValue(uint32_t data32);
77+
void setValue(int data32);
78+
void setValue(float data32);
79+
void setValue(double data64);
8080
void setWriteProperty(bool value);
8181
void setWriteNoResponseProperty(bool value);
8282
std::string toString();

0 commit comments

Comments
 (0)