Exemple #1
0
        public IAsyncOperation <SenseHatLedArrayDrawShapeResult> DrawShapeAsync(
            AllJoynMessageInfo info, int interfaceMemberShapeKind)
        {
            Task <SenseHatLedArrayDrawShapeResult> task =
                new Task <SenseHatLedArrayDrawShapeResult>(() =>
            {
                if (ledArray != null)
                {
                    currentShape = GetShapeKind(interfaceMemberShapeKind);

                    ledArray.DrawShape(currentShape);

                    return(SenseHatLedArrayDrawShapeResult.CreateSuccessResult());
                }
                else
                {
                    return(SenseHatLedArrayDrawShapeResult.CreateFailureResult(
                               (int)ErrorCodes.LedInitializationError));
                }
            });

            task.Start();

            return(task.AsAsyncOperation());
        }
Exemple #2
0
        private void DisplayDetectedObject(ObjectDescriptor objectDescriptor)
        {
            if (ledArray != null)
            {
                var shapeKind = GetShapeKind(objectDescriptor);

                ledArray.DrawShape(shapeKind);
            }
        }