Skip to content

Commit

Permalink
Add manufacturer data
Browse files Browse the repository at this point in the history
  • Loading branch information
jcelerier committed Jun 9, 2024
1 parent b5ad091 commit 1830d6c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions BLE/Protocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,13 @@ void ble_protocol::scan_services()
}
}
}
for(auto [id, data] : m_peripheral.manufacturer_data())
{
auto& data_node
= ossia::net::find_or_create_node(m_device->get_root_node(), std::to_string(id));
auto param = data_node.create_parameter(ossia::val_type::STRING);
param->set_value(data);
}
}

void ble_protocol::set_device(net::device_base& dev)
Expand Down Expand Up @@ -243,6 +250,12 @@ void ble_scan_protocol::scan_services()
auto param = svc_node.create_parameter(ossia::val_type::STRING);
param->set_value(service.data());
}
for(auto [id, data] : m_peripheral.manufacturer_data())
{
auto& data_node = ossia::net::find_or_create_node(prp_node, std::to_string(id));
auto param = data_node.create_parameter(ossia::val_type::STRING);
param->set_value(data);
}
}
}

Expand Down

0 comments on commit 1830d6c

Please sign in to comment.