Ejemplo n.º 1
0
        //const uint SERVICE_VERSION_ATTRIBUTE_ID = 0x0300;
        //const byte SERVICE_VERSION_ATTRIBUTE_TYPE = 0x0A;   // UINT32
        //const uint SERVICE_VERSION = 200;
        //void InitializeServiceSdpAttributes(RfcommServiceProvider provider)
        //{
        //    var writer = new Windows.Storage.Streams.DataWriter();

        //    // First write the attribute type
        //    writer.WriteByte(SERVICE_VERSION_ATTRIBUTE_TYPE);
        //    // Then write the data
        //    writer.WriteUInt32(SERVICE_VERSION);

        //    var data = writer.DetachBuffer();
        //    provider.SdpRawAttributes.Add(SERVICE_VERSION_ATTRIBUTE_ID, data);
        //}

        internal void StopListening()
        {
            // Stop advertising/listening so that we're only serving one client
            if (_provider != null)
            {
                _provider.StopAdvertising();
            }
        }