File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,44 @@ BLECharacteristic& BLECharacteristic::operator= (const BLECharacteristic& rhs)
94
94
return *this ;
95
95
}
96
96
97
+ BLECharacteristic::BLECharacteristic (const BLECharacteristic& rhs)
98
+ {
99
+ unsigned char *_value = (unsigned char *)malloc (rhs._value_size );
100
+ if (_value)
101
+ {
102
+ memcpy (_value, rhs._value , rhs._value_size );
103
+ _value_size = rhs._value_size ;
104
+ memcpy (_uuid_cstr, rhs._uuid_cstr , sizeof (_uuid_cstr));
105
+ _properties = rhs._properties ;
106
+ _event_handlers = rhs._event_handlers ;
107
+ _internal = rhs._internal ;
108
+ _bledev = BLEDevice (&rhs._bledev );
109
+ }
110
+ }
111
+
112
+ BLECharacteristic& BLECharacteristic::operator = (const BLECharacteristic& rhs)
113
+ {
114
+ if (this != &rhs)
115
+ {
116
+ if (_value)
117
+ {
118
+ free (_value);
119
+ }
120
+ _value = (unsigned char *)malloc (rhs._value_size );
121
+ if (_value)
122
+ {
123
+ memcpy (_value, rhs._value , rhs._value_size );
124
+ _value_size = rhs._value_size ;
125
+ memcpy (_uuid_cstr, rhs._uuid_cstr , sizeof (_uuid_cstr));
126
+ _properties = rhs._properties ;
127
+ _event_handlers = rhs._event_handlers ;
128
+ _internal = rhs._internal ;
129
+ _bledev = BLEDevice (&rhs._bledev );
130
+ }
131
+ }
132
+ return *this ;
133
+ }
134
+
97
135
BLECharacteristic::~BLECharacteristic ()
98
136
{
99
137
if (_value)
You can’t perform that action at this time.
0 commit comments