Commit Graph

189 Commits

Author SHA1 Message Date
Jose Antonio Santos Cadenas
b373573355 Notify channel deletion correctly 2010-10-14 12:50:53 +02:00
Jose Antonio Santos Cadenas
e47d40a09a Create a function for closing mcl correctly 2010-10-14 12:50:53 +02:00
Santiago Carot-Nemesio
cb38c347a8 Check echo response 2010-10-14 12:50:53 +02:00
Santiago Carot-Nemesio
35a1403775 Set watcher to check echo response 2010-10-14 12:50:53 +02:00
Jose Antonio Santos Cadenas
e95a28a056 Generate random echo packet 2010-10-14 12:50:53 +02:00
Jose Antonio Santos Cadenas
e0d3d7581a Initial steps to send echo data 2010-10-14 12:50:53 +02:00
Santiago Carot-Nemesio
8dfeb1f0fe Remove unnecessary variable 2010-10-14 12:50:53 +02:00
Jose Antonio Santos Cadenas
86b4526064 Connect echo channel 2010-10-14 12:50:53 +02:00
Santiago Carot-Nemesio
9dffe9e4a6 Add support to initiate echo 2010-10-14 12:50:53 +02:00
Jose Antonio Santos Cadenas
aab917fc2b Some code cleanup in hdp 2010-10-13 17:42:15 +03:00
Santiago Carot-Nemesio
562c939a93 Check first reliable configuration during channel creation 2010-10-12 11:10:29 +01:00
Santiago Carot-Nemesio
95fa316ecc Delete all channels when the instance is removed
When an MCAP instance is removed, MCAP removes all the data channels,
but the D-Bus interfaces are already there, this commits removes
this interfaces so no future use of this channels will be possible
2010-10-12 11:10:28 +01:00
Jose Antonio Santos Cadenas
96f7d6e04e Implement callback for responding echo petitions 2010-10-12 11:10:28 +01:00
Santiago Carot-Nemesio
c3761e22e8 Add extra checks for avoid notifiying incoming echo channels 2010-10-12 11:10:28 +01:00
Jose Antonio Santos Cadenas
1ba926af27 Return MCAP_MDL_BUSY when health channel can't be created
This error code is more appropriated than MDEP_BUSY. MDEP_BUSY is
reserved for cases when no more data channels can be managed
simultaneously.
2010-10-12 11:10:28 +01:00
Jose Antonio Santos Cadenas
eb2cee291c Fix multiple emission of main channel property signal.
Whenever a data channel was connected the signal property change was
emitted too.
2010-10-12 11:10:28 +01:00
Santiago Carot-Nemesio
4ed615d046 Correctly notify the deletion of the reliable data channel 2010-10-12 11:10:28 +01:00
Jose Antonio Santos Cadenas
3913704e8f Incoming connection in control channel should be ERTM 2010-10-12 11:10:28 +01:00
Santiago Carot-Nemesio
e88fdbd063 Process request of of echo channels creation 2010-10-12 11:10:28 +01:00
Santiago Carot-Nemesio
6d93423f1e Add a new function to create channels 2010-10-12 11:10:28 +01:00
Jose Antonio Santos Cadenas
a68f5a6f8f Remove unnecessary app parameter from hdp_establish_mcl 2010-10-12 11:10:28 +01:00
Jose Antonio Santos Cadenas
f2024ff51e Remove mdl_conn from struct hdp_channel
Istead of using this flag, the file descriptor can be used.
2010-10-12 11:10:28 +01:00
Johan Hedberg
acf63e3fdb Fix minor coding style issues in HDP code 2010-10-06 10:37:09 +02:00
Santiago Carot-Nemesio
b0115866e8 Remove extra space in HDP code 2010-10-06 10:37:09 +02:00
Jose Antonio Santos Cadenas
bc85591222 Add remote mdep when connect new data channels 2010-10-06 10:37:09 +02:00
Jose Antonio Santos Cadenas
57b22cdd52 Send a proper reply to Acquire petition once reconnection is done 2010-10-06 10:37:09 +02:00
Jose Antonio Santos Cadenas
6b41ddfe00 Reuse connect funcion for reconnections 2010-10-06 10:37:09 +02:00
Santiago Carot-Nemesio
fba8a45ca3 Set MDLs to disconnected state when an MCL is disconnected 2010-10-06 10:37:09 +02:00
Santiago Carot-Nemesio
595752c369 Start getting remote dcpsm for reconnect a HealthChannel 2010-10-06 10:37:09 +02:00
Jose Antonio Santos Cadenas
1541fa313e Start reconnecton if needed in Acquire method 2010-10-06 10:37:09 +02:00
Santiago Carot-Nemesio
ef0819a1bf Prepare callbacks for acquire data channel (mcl reconnection) 2010-10-06 10:37:09 +02:00
Santiago Carot-Nemesio
516204b31c Append missed signal when channel is created 2010-10-06 10:37:09 +02:00
Santiago Carot-Nemesio
7632f20717 Fix typo error in HDP 2010-10-06 10:37:09 +02:00
Jose Antonio Santos Cadenas
494d89f244 Implement GetProperties method for the HealthChannel object 2010-10-06 10:37:09 +02:00
Santiago Carot-Nemesio
93faa8d7ff Implement Release function 2010-10-06 10:37:09 +02:00
Jose Antonio Santos Cadenas
0a50d08af2 Create a GetProperties function for HealthDevice 2010-10-06 10:37:09 +02:00
Santiago Carot-Nemesio
a153666771 Implement deleted callback 2010-10-06 10:37:09 +02:00
Santiago Carot-Nemesio
655eec7147 Reconnect MDL in destroy channel if it is required 2010-10-06 10:37:09 +02:00
Santiago Carot-Nemesio
637151299a Initial support to destroy data channels 2010-10-06 10:37:09 +02:00
Jose Antonio Santos Cadenas
77dc4f532a Check if the requested configuration is valid for the application role 2010-10-06 10:37:09 +02:00
Santiago Carot-Nemesio
da079c7c63 Check the configuration of the negotiated data channel 2010-10-06 10:37:08 +02:00
Jose Antonio Santos Cadenas
5c58732e46 Implement hdp_mcap_mdl_reconn_req_cb 2010-10-06 10:37:08 +02:00
Jose Antonio Santos Cadenas
7de15fe110 Implement hdp_mcap_mdl_deleted_cb 2010-10-06 10:37:08 +02:00
Jose Antonio Santos Cadenas
2e1bbce2b6 Implement hdp_mcap_mdl_closed_cb 2010-10-06 10:37:08 +02:00
Santiago Carot-Nemesio
a90dfa8a84 Send abort request when error happens connecting a data channel 2010-10-06 10:37:08 +02:00
Jose Antonio Santos Cadenas
c619bc6a30 Implement hdp_mcap_mdl_connected_cb 2010-10-06 10:37:08 +02:00
Santiago Carot-Nemesio
df05348c07 Implement hdp_mcap_mdl_aborted_cb 2010-10-06 10:37:08 +02:00
Santiago Carot-Nemesio
9677a892e7 Implement health_channel_destroy function 2010-10-06 10:37:08 +02:00
Jose Antonio Santos Cadenas
d13ce23977 Complete connection req. callback checking the configuration 2010-10-06 10:37:08 +02:00
Santiago Carot-Nemesio
b15f410ebc Implement hdp_mcap_mdl_conn_req_cb 2010-10-06 10:37:08 +02:00
Santiago Carot-Nemesio
d62b6a7324 Connect data channel 2010-10-06 10:37:08 +02:00
Jose Antonio Santos Cadenas
10bb87731c Set the MCAP control channel mode to ERTM 2010-10-06 10:37:08 +02:00
Jose Antonio Santos Cadenas
aa2eeb07ee mcap_connect_mcl receives the mode of the channel instead of the btiotype 2010-10-06 10:37:08 +02:00
Santiago Carot-Nemesio
3218a9e698 Correctly deletion of hidden hdp_devices 2010-10-06 10:37:08 +02:00
Jose Antonio Santos Cadenas
7369e445b2 Set mcl callbacks when it is connected or reconnected 2010-10-06 10:37:08 +02:00
Jose Antonio Santos Cadenas
f72719cd3d Register HealthChannel interface when create channel request is success 2010-10-06 10:37:08 +02:00
Jose Antonio Santos Cadenas
1c5538a224 Add function to get the remote dcpsm 2010-10-06 10:37:07 +02:00
Santiago Carot-Nemesio
4ecfa42540 Add a reference counter to hdp_create_dc for callbacks 2010-10-06 10:37:07 +02:00
Santiago Carot-Nemesio
f3e8d0272c Implementation of create_mcl_cb for connecting data channels 2010-10-06 10:37:07 +02:00
Jose Antonio Santos Cadenas
1673fc33c0 Add a reference counter to conn_mcl_data for callbacks 2010-10-06 10:37:07 +02:00
Jose Antonio Santos Cadenas
402dcd1ba7 Parse remote SDP record for getting control channel PSM 2010-10-06 10:37:07 +02:00
Santiago Carot-Nemesio
eebe51ff43 Send request to create data channels 2010-10-06 10:37:07 +02:00
Jose Antonio Santos Cadenas
bad39a61d7 Parse SDP record for find the matching MDEP 2010-10-06 10:37:07 +02:00
Santiago Carot-Nemesio
fa207381f8 Reconnect MCL when create a new data channels if it is closed 2010-10-06 10:37:07 +02:00
Jose Antonio Santos Cadenas
8c16454c7d Get MDEP to create a new data channel 2010-10-06 10:37:07 +02:00
Santiago Carot-Nemesio
b571d6d327 First steps for get the remote mdep 2010-10-06 10:37:07 +02:00
Santiago Carot-Nemesio
707359ef28 Initial support to create data channels 2010-10-06 10:37:07 +02:00
Santiago Carot-Nemesio
c8c4f6445b Fix MCAP bug when a new request is done in a callback 2010-10-06 10:37:07 +02:00
Santiago Carot-Nemesio
0a39787183 Fix potential memory leak in MCAP code
Data provided by profiles using MCAP may fall in memory leak if
control channel is closed before reply arrives from remote side.
This patch add a GDestroyNotify function parameter in MCAP API
to release private data provided by upper layers even if adapter
is removed or control channels is closed before reply from remote
side arrives.
2010-10-06 10:37:07 +02:00
Santiago Carot-Nemesio
92f12fb6fa Add GDestroyNotify function to connect L2CAP channels in MCAP API
Profiles using MCAP should be able to free private data provided when
connecting both (data and control channels) even if connections process
is not success.
2010-10-06 10:37:07 +02:00
Jose Antonio Santos Cadenas
62b35db235 Update device flag indicating that it was created by the driver 2010-10-06 10:37:06 +02:00
Jose Antonio Santos Cadenas
66b906db68 Unref the device reference of the mcl when the mcap instance is closed 2010-10-06 10:37:06 +02:00
Santiago Carot-Nemesio
8720548660 Implement callback when mcl is uncached 2010-10-06 10:37:06 +02:00
Jose Antonio Santos Cadenas
798dd19190 Implement callback for mcl reconnections 2010-10-06 10:37:06 +02:00
Jose Antonio Santos Cadenas
5d1c5168db Implement callback for mcl disconnection 2010-10-06 10:37:06 +02:00
Jose Antonio Santos Cadenas
85ea1b8fac Implement callback for mcl connection 2010-10-06 10:37:06 +02:00
Johan Hedberg
0ca6eacb9a Remove redundant parentheses 2010-09-22 10:55:11 +03:00
Santiago Carot-Nemesio
bab7bc682b Remove magic numbers in MCAP CSP 2010-09-22 10:48:16 +03:00
Santiago Carot-Nemesio
d9c916ac62 Simplify logic to calculate the BT/system clock latency
This is only a cosmetic change. Using a while loop
we avoid direct manipulation of counter loop variable
when error happens reading the BT clock.
2010-09-22 10:48:11 +03:00
Elvis Pfützenreuter
5500d6f8a8 Use hciops functions instead of HCI raw sockets 2010-09-22 10:22:52 +03:00
Elvis Pfützenreuter
ce86aba22d Fix potential lockup while finding latency
This patch fixes a potential infinite loop while finding the
BT/system clock read latency. If the adapter is removed exactly
at that moment, BT clock simply can't be read and it must quit.
This is handled as a temporary failure (if a new connection is
made, adapter is probably in place again).
2010-09-21 21:03:08 +03:00
Jose Antonio Santos Cadenas
2b34bb1e19 Code reorganization to avoid unnecessary forward declarations 2010-09-21 21:03:02 +03:00
Jose Antonio Santos Cadenas
1dee81c167 Some code reordering in mcap_sync
Declaration, defines and struct definitions are moved to the begining
of the file. Just for make the code more readable.
2010-09-21 14:01:12 +03:00
Santiago Carot-Nemesio
7fec3cc784 Fix potential NULL pointer access in MCAP CSP code
NULL pointer acces may hapen when an attemp to send a
synchronization command happens over a closed MCL.
2010-09-20 14:14:06 +03:00
Santiago Carot-Nemesio
f7d72451b4 Fix minor coding style issues in MCAP CSP code 2010-09-20 14:14:03 +03:00
Johan Hedberg
73d16df5fc Fix minor coding style issues in HDP code 2010-09-17 18:01:58 +03:00
Jose Antonio Santos Cadenas
2aceae7e35 Add watcher for client disconnection 2010-09-17 16:40:58 +02:00
Jose Antonio Santos Cadenas
022fe44099 Register and unregister interfaces for health devices 2010-09-17 16:40:58 +02:00
Santiago Carot-Nemesio
ced4231b06 Register features in SDP record 2010-09-17 16:40:58 +02:00
Jose Antonio Santos Cadenas
bb0b2e841e Manage adapters 2010-09-17 16:40:51 +02:00
Jose Antonio Santos Cadenas
bbbdb87fc6 Managing applications (create and destroy) 2010-09-17 16:34:53 +02:00
Santiago Carot-Nemesio
2792e639a9 Initial support for HDP plugin 2010-09-17 11:38:02 +02:00
Johan Hedberg
0d1d944281 Make read_btclock return value clearer 2010-09-16 17:57:48 +03:00
Johan Hedberg
bfc9ce9a21 Fix memory leak 2010-09-16 17:56:07 +03:00
Johan Hedberg
3ed7e64096 Fix coding style issues in MCAP CSP code 2010-09-16 17:54:27 +03:00
Elvis Pfützenreuter
afceadebb7 Fixes several small issues found with PTS testing
1. BT clock reading is retried a few times upon failure. Temporary
   failures seem to be common (at least in a VM environment) and
   CSP needs to deal with it more gracefully.
2. Do not read local BT clock if ioctl() fails; fail and let the
   higher-level function to retry. No clock is better than the wrong
   one.
3. Add a field to SyncLeadTime in capabilities struct, since this
   is checked by PTS and a better/clearer estimate is needed
   throughout the code (see below).
4. Make sure every scheduling is delayed by SyncLeadTime. PTS does
   not like to receive a message before this.
5. Added a more conservative (and bigger) estimate of SyncLeadTime
   (PTS insists about receiving immediate responses within it).
6. Sync Indication is immediately sent in two ocasions: right after
   a sync set, and right after sync set response (and every "n"
   seconds after that, depending on required accuracy).
7. Timestamp resolution is set to 1 when operating system call
   yields resolution = 0.
2010-09-16 10:54:11 -03:00
Elvis Pfützenreuter
cf25fc1f49 Added CSP enabling/disabling API; GError argument positioning
MCAP stack wakes up with CSP disabled. It must be enabled
explicitly. MCL connections created prior to CSP enabling
won't be CSP-capable; only new MCLs will.

GError pointer is by convention the last parameter in request functions.
2010-09-16 10:54:11 -03:00
Elvis Pfützenreuter
62fb66c518 Read native BT clock if connection has no handle
Loopback connections (between two processes in the same machine)
have no ACL handle. In this case, just use the native BT clock.
2010-09-16 10:54:11 -03:00
Elvis Pfützenreuter
c1e45717d5 CSP-Master implementation 2010-09-16 10:54:11 -03:00
Elvis Pfützenreuter
1e6a00608a Internal CSP capabilities use signed int
Using plain, signed ints for the internal representation
of CSP capabilities makes it easier to do math on those
values, as well as avoiding casts.
2010-09-16 10:54:11 -03:00