Skip to content

Instantly share code, notes, and snippets.

@nogawanogawa
Created June 2, 2018 06:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nogawanogawa/d08270a363c5929393260f4fe051bb12 to your computer and use it in GitHub Desktop.
Save nogawanogawa/d08270a363c5929393260f4fe051bb12 to your computer and use it in GitHub Desktop.
BluetoothLEAdvertisementPublisher _publisher;
void SetupBluetoothAdvertisement()
{
_publisher = new BluetoothLEAdvertisementPublisher();
var manufacturerData = new BluetoothLEManufacturerData();
manufacturerData.CompanyId = 0xFFFE;
var myIpAddress = GetMyIPAddress();
var writer = new DataWriter();
writer.WriteString(myIpAddress);
manufacturerData.Data = writer.DetachBuffer();
_publisher.Advertisement.ManufacturerData.Add(manufacturerData);
_publisher.Start();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment