Exemplo n.º 1
0
        private async Task GetCustomIcon(string customIconId, string nodeId)
        {
            var icon = await _customIconRepository.GetAsync(customIconId);

            var data = Array.Empty <byte>();

            if (icon != null)
            {
                var response = new WearCustomIcon(icon.Id, icon.Data);
                var json     = JsonConvert.SerializeObject(response);
                data = Encoding.UTF8.GetBytes(json);
            }

            await WearableClass.GetMessageClient(this).SendMessageAsync(nodeId, GetCustomIconCapability, data);
        }
Exemplo n.º 2
0
        private async Task GetCustomIcon(string customIconId, string nodeId)
        {
            await _customIconSource.Update();

            var icon = _customIconSource.Get(customIconId);

            var data = new byte[] { };

            if (icon != null)
            {
                var response = new WearCustomIcon(icon.Id, icon.Data);
                var json     = JsonConvert.SerializeObject(response);
                data = Encoding.UTF8.GetBytes(json);
            }

            await WearableClass.GetMessageClient(this).SendMessageAsync(nodeId, GetCustomIconCapability, data);
        }