BTool.DeviceFormUtils.GetGattCharProperties C# (CSharp) Method

GetGattCharProperties() public method

public GetGattCharProperties ( byte properties, bool useShort ) : string
properties byte
useShort bool
return string
        public string GetGattCharProperties(byte properties, bool useShort)
        {
            string str = string.Empty;
            string s_space = " ";
            if (properties == 0)
                return str;

            if ((properties & 0x01) != 0)
                str = (!useShort ? str + GATT_CharProperties.Broadcast.ToString() : str + "Bcst") + s_space;

            if ((properties & 0x02) != 0)
                str = (!useShort ? str + GATT_CharProperties.Read.ToString() : str + "Rd") + s_space;

            if ((properties & 0x04) != 0)
                str = (!useShort ? str + GATT_CharProperties.WriteWithoutResponse.ToString() : str + "Wwr") + s_space;

            if ((properties & 0x08) != 0)
                str = (!useShort ? str + GATT_CharProperties.Write.ToString() : str + "Wr") + s_space;

            if ((properties & 0x10) != 0)
                str = (!useShort ? str + GATT_CharProperties.Notify.ToString() : str + "Nfy") + s_space;

            if ((properties & 0x20) != 0)
                str = (!useShort ? str + GATT_CharProperties.Indicate.ToString() : str + "Ind") + s_space;

            if ((properties & 0x40) != 0)
                str = (!useShort ? str + GATT_CharProperties.AuthenticatedSignedWrites.ToString() : str + "Asw") + s_space;

            if ((properties & 0x80) != 0)
                str = !useShort ? str + GATT_CharProperties.ExtendedProperties.ToString() : str + "Exp";

            return str.Trim();
        }