Exemplo n.º 1
0
        public async Task <ServiceResponse <IEnumerable <BleGattCharacteristic> > > GetCharacteristics(string deviceId, string gattServiceId)
        {
            var response = new ServiceResponse <IEnumerable <BleGattCharacteristic> >();

            response.Data = await _bluetoothManager.GetDeviceCharacteristics(deviceId, gattServiceId);

            if (!response.Data.Any())
            {
                response.Result  = ServiceResponseResult.NotFound;
                response.Message = $"Failed to fetch characteristics from device with Id: \'{deviceId}\' and service with Id: \'{gattServiceId}\'";
                return(response);
            }

            response.Result = ServiceResponseResult.Success;
            return(response);
        }