Ejemplo n.º 1
0
        public GattService FindService(Uuid uuid)
        {
            string uuidStr = uuid.ToString();

            if (m_services.ContainsKey(uuidStr))
            {
                return(m_services[uuidStr]);
            }
            else
            {
                Assert.IsNotNull(AndroidObject);
                /* BluetoothGattService */ AndroidJavaObject service = AndroidObject.Call <AndroidJavaObject>("getService", uuid.ToJavaObject());

                if (service == null)
                {
                    return(null);
                }

                var gattService = new GattService(service, this);
                m_services.Add(uuidStr, gattService);
                return(gattService);
            }
        }
 internal GattCharacteristic(AndroidJavaObject androidObject, GattService service) : base(androidObject)
 {
     Service = service;
 }