2021-06-04 13:22:59 +08:00

22 lines
530 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Assets.Scripts.Devices.Ble.Extension
{
public static class PrimitiveExtensions
{
public static bool IsBitSet(this byte value, int position)
{
return ((uint)value & (uint)(1 << position)) > 0U;
}
public static bool IsBitSet(this ushort value, int position)
{
return ((uint)value & (uint)(1 << position)) > 0U;
}
}
}