File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -152,6 +152,18 @@ void NimBLEAdvertising::setName(const std::string& name) {
152152 m_advDataSet = false ;
153153} // setName
154154
155+ /* *
156+ * @brief Set the advertised manufacturer data.
157+ * @param [in] data The data to advertise.
158+ * @param [in] length The length of the data.
159+ */
160+ void NimBLEAdvertising::setManufacturerData (const uint8_t * data, size_t length) {
161+ std::vector<uint8_t >(data, data + length).swap (m_mfgData);
162+ m_advData.mfg_data = &m_mfgData[0 ];
163+ m_advData.mfg_data_len = m_mfgData.size ();
164+ m_advDataSet = false ;
165+ } // setManufacturerData
166+
155167/* *
156168 * @brief Set the advertised manufacturer data.
157169 * @param [in] data The data to advertise.
Original file line number Diff line number Diff line change @@ -94,6 +94,7 @@ class NimBLEAdvertising {
9494 bool stop ();
9595 void setAppearance (uint16_t appearance);
9696 void setName (const std::string& name);
97+ void setManufacturerData (const uint8_t * data, size_t length);
9798 void setManufacturerData (const std::string& data);
9899 void setManufacturerData (const std::vector<uint8_t >& data);
99100 void setURI (const std::string& uri);
You can’t perform that action at this time.
0 commit comments