summaryrefslogtreecommitdiff
path: root/src/device.h
AgeCommit message (Collapse)AuthorFilesLines
2012-10-12core: Create devices dynamically during discoveryJohan Hedberg1-0/+1
2012-10-12device: Add device_name_known convenience functionJohan Hedberg1-0/+1
2012-10-12device: Add LegacyPairing and RSSI propertiesJohan Hedberg1-0/+2
These are needed for the new device discovery where we create objects for each found device.
2012-10-09device: Remove not used device_set_class functionSzymon Janc1-1/+0
With mgmt interface CoD cannot change as it is only received in EIR when device is discovered or connected. Was only used in btd_event_remote_class which is now removed.
2012-10-05device: Move auth_type_t definition to device.cSzymon Janc1-8/+0
Bonding is handled in device.c and auth_type_t is private device data not used outside of it.
2012-10-05device: Make device_get_address return const pointerSzymon Janc1-1/+1
2012-10-05device: Convert device_get_address into simple getterSzymon Janc1-2/+1
This allow to remove number of local variables used only to get device address and pass it as pointer later on. bdaddr_type parameter is also removed as there is device_get_addr_type already present which can be used to get it if needed.
2012-10-03core: Mutually exclude concurrent connectionsJoão Paulo Rechi Vita1-1/+1
Since controllers don't support more than one ongoing connection procedure at the same time, new connection attempts needs to yield if there is an ongoing connection procedure already.
2012-10-01adapter: Replace device authorizing flagMikel Astiz1-2/+0
Refactor code to drop the device authorizing flag by replacing it with a private authorization pointer in btd_adapter. After all, no more than one authorization can be ongoing, so the code is easier to follow if this is made explicit.
2012-09-28core: Add proper support for run-time removal of profilesJohan Hedberg1-0/+1
2012-09-25core: Add dynamic adapter and device probe supportJohan Hedberg1-0/+1
Particularly With the introduction of external profiles the probe functions must be possible to be triggered at any point during runtime.
2012-09-21device: Simplify DBusConnection object handlingAndrzej Kaczmarek1-16/+13
This patch removes redundant references and function parameters for DBusConnection object and uses btd_get_dbus_connection() call wherever such object is needed instead. Pointer returned by this call is guaranteed to be valid for entire bluetoothd lifetime and thus do not need to be refcounted.
2012-09-20core: Use adapter connect list for LE connectionsJoão Paulo Rechi Vita1-0/+1
When a connection is needed for a LE device it is added to the adapter connect list instead of directly connecting the ATT io channel.
2012-09-11core: Move profile code into profile.{c,h}Johan Hedberg1-31/+0
2012-09-07core: Add compare function for bdaddr in a struct btd_deviceJoão Paulo Rechi Vita1-0/+1
This is a utility function similar to device_address_cmp but comparing bdaddr instead of the string representing the address. This way is possible to avoid allocating two buffers to temporarily hold the strings, two sprintf() calls to generate the strings from the bdaddr arrays, and a string comparison, substituting all of it for one memcmp() call.
2012-09-04core: Refactor authentication handlingJohan Hedberg1-2/+9
2012-09-03Add profile abstraction (replaces btd_device drivers)Johan Hedberg1-13/+33
This patch removes the btd_device_driver concept and replaces it with btd_profile. The new construct also contains the necessary parts for adapter drivers, so btd_adapter_driver is only needed for non-profile related functionality (most of which is in plugins/*). The main purpose of this new construct is to facilitate a centralized connection creation mechanism for profiles, ultimately enabling the addition of a Device.Connect() method instead of requiring a UI to know to call e.g. Input.Connect or Audio.Connect. This feature will also be extended to externally implemented profiles once the internal implementation gets more stable, such as OBEX (obexd) and HFP (oFono). The new D-Bus interface will also partially restore functionality which was previously available through the Serial interface.
2012-08-20gatt: Primary service interval may not changeClaudio Takahasi1-0/+2
This patch address the "Service Changed" scenario on which the start and end Primary Service attribute handle interval doesn't change.
2012-08-20gatt: Emit PropertyChanged for AppearanceClaudio Takahasi1-0/+1
Emit PropertyChanged changed signal in the Device hierarchy when the Appearance characteristic value is read from the remote GAP service.
2012-08-20core: Add device method to access "Appearance"Claudio Takahasi1-0/+1
This patch adds a new device method to access the Appearance GAP characteristic value stored previously as result of the discovery procedure or GATT characteristic read procedure.
2012-05-27storage: Store address type in "ccc" filePaulo Alcantara1-0/+1
Addressing types can be either BR/EDR, BLE public or BLE random so the entries in the "ccc" file did not contain enough information to distinguish which addressing type it's supposed to be. Entries will now contain both address number and address type as a single key in every entry in the file.
2012-04-25Remove addr_type_t definition from adapter.hClaudio Takahasi1-3/+3
This patch replaces addr_type_t by the new Bluetooth address type constants defined in bluetooth.h
2012-04-12Add AUTH_TYPE_NOTIFY_PASSKEY to device_request_authenticationScott James Remnant1-0/+1
This new authentication type accepts a pincode and calls the DisplayPinCode agent method, a fallback is provided so that if the method is not implemented the older RequestPinCode method is used instead. Due to this fallback, the agent_pincode_cb is used and calling functions should send the pincode passed to the callback to the adapter, which may differ from that generated.
2012-04-12Pass passkey by pointer rather than by valueScott James Remnant1-1/+1
This allows alternate data of a different type to be passed to device_request_authentication() for other notification types such as those that require a PIN.
2012-04-12Rename AUTH_TYPE_NOTIFY to AUTH_TYPE_NOTIFY_PASSKEYScott James Remnant1-1/+1
This makes room for additional notification types to be added.
2012-04-04DeviceInfo: Read PNP IDChen Ganir1-0/+4
Read the PNP ID characteristic of the DeviceInfo Service, and store it inside the btd_device, for use by other profiles.
2012-01-31event: Add type information to the mgmt "Device Connected" eventVinicius Costa Gomes1-0/+1
In the case of incomming connections we have to know the type of the device that connected to us. Through hciops we have the LE Connection Complete event, that information was lost when Management interface was being used.
2011-12-23Fix device address type trackingJohan Hedberg1-12/+6
2011-10-05Add set auto connect in deviceClaudio Takahasi1-0/+1
Skeleton of automatic connections driven by platform/user event. Two layers will manage connections: Profiles can request on demand connections registering ATTIO connection callbacks(one attempt) for a given device and platform/user action can trigger automatic connections for devices with ATTIO callbacks registered.
2011-10-01Add Vendor, Product and Version properties to org.bluez.DeviceLuiz Augusto von Dentz1-0/+3
This identifiers can be used by applications to implements quirks which seems to be very common in some profiles such as syncml and since this information is already stored permanently we can quickly retrieve it without having to connect or parse the records again.
2011-09-01Add support for blacklisting eventsAntti Julku1-0/+5
Add support for mgmt interface events for device blocking/unblocking. Kernel sends a mgmt event when a device has been blocked by another management socket or with ioctl command (e.g. by hciconfig). Parameter update_only is added to device_block/unblock functions in device.c to avoid code copying. When update_only is true, blocking command is not sent to kernel, but only device status is updated and dbus signal is sent.
2011-07-11Clean up device bonding removalJohan Hedberg1-1/+1
2011-07-11Fix unpair device when disconnected for No BondingDmitriy Paliy1-0/+1
Fix Paired device property if 'No Bonding' authentication is used. It is set to be false when device is disconnected and no link key is stored. Otherwise, there can be cases when device is still valid and being claimed as paired without available bonding information. For instanse, use of CreateDevice method call and obex client file transfer is such use case.
2011-06-08Add support of secure pin code in mgmt codeWaldemar Rymarkiewicz1-1/+1
Use secure pin code parameter received from the kernel in MGMT_EV_PIN_CODE_REQUEST event and propagate this to agent code. Secure flag is specific for the pin code request only.
2011-05-19Cleanup of device class update signalSheldon Demario1-0/+1
Adds a new device function to address the PropertyChanged signal when the device's class changes. event.c file should avoid sending signals that belongs to device objects.
2011-04-20Cleanup: remove header declared but not definedClaudio Takahasi1-4/+0
2011-04-14Fix primary services registration from storage for basic rateClaudio Takahasi1-0/+2
2011-04-14Remove btd_device_add_service functionClaudio Takahasi1-1/+0
btd_device_add_service is no longer necessary if the object paths for the primary services can be returned during the registration.
2011-04-14Cleanup primary service registration from storageClaudio Takahasi1-2/+2
2011-02-17Move SSP auto-accept handling completely inside hciopsJohan Hedberg1-1/+0
There's no need to expose the auto-accept case to the core daemon so move it to hciops. For the management interface this will all be handled on the kernel side.
2011-01-28Refactor pairing code to match the management interfaceJohan Hedberg1-6/+0
This patch refactors the pairing code in hciops and the core daemon to better match the management interface. Particularly all logic regarding IO capabilities and authentication requirements are moved into hciops.c. The patch is quite big because there are a lot of cross-dependencies which makes it difficult to split the changes up into smaller chunks. The important adapter_ops preparations for the management interface in this patch are the create_bonding and cancel_bonding callbacks. Those will be directly mapped to corresponding management commands.
2011-01-21Keep connection handle information inside adapter_opsJohan Hedberg1-5/+2
There's no point to export connection handle details to the core daemon since it will not be available in the management interface. Instead track the handles inside hciops (managment interface will do this inside the kernel).
2010-12-24Change CreatePairedDevice to support LE devicesSheldon Demario1-1/+4
CreatePairedDevice implements now the same behaviour of CreateDevice, triggering Discover All Primary Services when needed. SMP negotiation starts when the link is established. LE capable kernel is required to test this method properly. Limitation: For dual mode devices, Discover All Primary Services is not being executed after SDP search if GATT record is found.
2010-12-23Add the btd_ prefix to device_add_serviceVinicius Costa Gomes1-1/+1
This is needed to keep consistency, as device_add_service would be used from outside the core bluetoothd.
2010-12-23Add a way to retrieve ATT primary servicesVinicius Costa Gomes1-0/+3
As the primary services were discovered by the core bluetoothd, we need a way to export that information. The service discovery uses the same primary list as the device, there's no need to free that list when the discovery finishes. That list will be removed when the device is free'd.
2010-12-23Add support for creating devices from stored typesVinicius Costa Gomes1-0/+1
This adds a way to restore devices from their types.
2010-12-19Fix clearing authentication request for renewed keysJohan Hedberg1-0/+1
In the case of upgrading an unauthenticated key to an authenticated one there will be a second authentication request which needs to be cleared upon the link key notification event.
2010-12-07Add device type to identify LE, BR/EDR or dual mode devicesClaudio Takahasi1-2/+9
If EIR Flags field is sent in the advertising data, it can be used to detect the operation mode. If the remote device is dual mode, GAP operation mode defines that it shall follow the connectable mode for BR/EDR and non-connectable mode for LE. This patch forces service discovery protocol prior to Discover All Primary Services.
2010-11-29Check the device type when creating the deviceClaudio Takahasi1-2/+3
For CreateDevice, if the remote device is LE capable, Discover All Primary Services shall be issued instead of SDP queries. The logic to define if the remote is LE capable shall be based on the result of the interleaved discovery results. Meaning, the remote device is classified as LE capable only if an advertising event from this device was collected during the discovery. Limitation: Advertising event data is not being considered yet to infer the remote properties and CreateDevice needs to be called during the discovery session.
2010-09-30Add "Services" property in the org.bluez.Device interfaceVinicius Costa Gomes1-0/+1
Add a new property "Services" representing the object paths of the available GATT primary services. "Services" is an array of D-Bus object paths.