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()); }
private void DisplayDetectedObject(ObjectDescriptor objectDescriptor) { if (ledArray != null) { var shapeKind = GetShapeKind(objectDescriptor); ledArray.DrawShape(shapeKind); } }