AncsNotifier.AncsManager.OnAction C# (CSharp) Метод

OnAction() публичный Метод

public OnAction ( PlainNotification notification, bool positive ) : void
notification PlainNotification
positive bool
Результат void
        public async void OnAction(PlainNotification notification, bool positive)
        {
            //Relay notification action back to device
            var not = new NotificationActionData
            {
                CommandId = 0x02, //CommandIDPerformNotificationAction
                NotificationUID = notification.Uid,
                ActionId =  positive ? ActionId.Positive : ActionId.Negative
            };

            var bytes = StructureToByteArray(not);

            try
            {
                var status =
                    await
                        this.ControlPointCharacteristic.WriteValueAsync(bytes.AsBuffer(),
                            GattWriteOption.WriteWithResponse);
            }
            catch (Exception)
            {

            }
        }