示例#1
0
        public async void sendSong()
        {
            System.Diagnostics.Debug.WriteLine("sending...");

            Dictionary <string, string> jsend = new Dictionary <string, string>();
            DRP drp = new DRP(DRPDevType.RBPI, "yeguslavia", 2, 3, new System.Collections.Generic.List <float>(), 0, DRPMessageType.ILLEGAL);

            await AzureIoTHub.SendDeviceToCloudMessageAsync(drp.ToString());

            System.Diagnostics.Debug.WriteLine("message send");
        }
        public Task ProcessEventsAsync(PartitionContext context, IEnumerable <EventData> messages)
        {
            foreach (var eventData in messages)
            {
                string data = Encoding.UTF8.GetString(eventData.Body.Array, eventData.Body.Offset, eventData.Body.Count);
                // Console.WriteLine($"Message received. Partition: '{context.PartitionId}', Data: '{data}'");
                DRP msg = DRP.deserializeDRP(data);
                //Toast.MakeText(MainActivity.context, msg.UserName, ToastLength.Long);
                System.Diagnostics.Debug.WriteLine("^^^^received: " + msg.UserName);
            }

            return(context.CheckpointAsync());
        }