protected virtual void WriteAttribute(ServiceAttribute attr, byte[] buffer, ref int offset) { int len; len = CreateAttrId(attr.Id, buffer, offset); offset += len; len = CreateElement(attr.Value, buffer, offset); offset += len; }
static ServiceElement GetChannelElement(ServiceRecord record, BluetoothProtocolDescriptorType proto) { if (!record.Contains(AttributeIds.ProtocolDescriptorList)) { goto NotFound; } ServiceAttribute attr = record.GetAttributeById(AttributeIds.ProtocolDescriptorList); return(GetChannelElement(attr, proto, out _)); NotFound: return(null); }
// TODO GetRfcommChannelElement(ServiceAttribute attr) Could be public -> Tests! internal static ServiceElement GetChannelElement(ServiceAttribute attr, BluetoothProtocolDescriptorType proto, #if !V1 out bool?isSimpleRfcomm #else out object isSimpleRfcomm
/// <overloads> /// Add a custom attribute. /// </overloads> /// - /// <summary> /// Add a custom attribute from a given <see cref="T:InTheHand.Net.Bluetooth.ServiceAttribute"/> /// </summary> /// - /// <param name="serviceAttribute">An attribute as a /// <see cref="T:InTheHand.Net.Bluetooth.ServiceAttribute"/> instance. /// </param> public void AddCustomAttribute(ServiceAttribute serviceAttribute) { AddCustomAttributes(new ServiceAttribute[] { serviceAttribute }); }