Commit Graph

121 Commits

Author SHA1 Message Date
Johan Hedberg
a2685ac211 emulator/btdev: Add initial support for HCI_LE_Long_Term_Key_Request_Reply 2013-11-29 14:41:14 +02:00
Johan Hedberg
c56b263fbf emulator/btdev: Add basic support for HCI_LE_Start_Encryption 2013-11-29 14:11:06 +02:00
Johan Hedberg
c8217dc462 emulator/btdev: Fix existing connection check in disconnection logic 2013-11-29 11:17:39 +02:00
Johan Hedberg
3204c443ad emulator/btdev: Simplify connection request logic
We should return page timeout both when the remote exists but just
doesn't have page scan enabled as well as when the remote doesn't exist.
2013-11-29 11:13:09 +02:00
Marcel Holtmann
bdaa349ba5 emulator: Add support for reading IAC information 2013-10-14 14:43:58 -07:00
Marcel Holtmann
f8b11ca9d9 monitor: Fix broken assoc_fragment structure value 2013-10-07 12:47:07 -07:00
Marcel Holtmann
065783d0a2 emulator: Add support for read local amp assoc command 2013-10-05 10:31:14 -07:00
Johan Hedberg
724a904228 emulator: Add basic support for LE connections 2013-09-19 20:39:02 +03:00
Johan Hedberg
26218dbf24 emulator: Remove redundant empty line 2013-09-19 10:06:57 -05:00
Johan Hedberg
84a0738622 emulator: Add missing HCI commands to the supported commands response 2013-09-11 10:54:41 +03:00
Johan Hedberg
d87776a264 emulator: Disallow SCO HCI commands on LE-only controllers 2013-09-11 10:54:22 +03:00
Johan Hedberg
4b95a69b61 emulator: Disallow HCI_Write_Current_IAP_LAP for LE-only controllers 2013-09-11 10:53:56 +03:00
Marcel Holtmann
aa6c727822 emulator: Add support for reading local out-of-band data 2013-09-11 00:04:35 -07:00
Marcel Holtmann
44f2f61e9f emulator: Add support for LE test commands 2013-09-07 21:36:38 -07:00
Marcel Holtmann
840fbec181 emulator: Add emulation a few more HCI commands 2013-09-07 21:28:34 -07:00
Marcel Holtmann
d68010fb9d emulator: Add support for host buffer size and LE rand commands 2013-09-07 16:35:22 -07:00
Marcel Holtmann
da05e084ae emulator: Fix up AFH channel assessment structures 2013-08-27 19:21:28 -07:00
Frédéric Dalleau
7d0783b711 emulator: Add btdev_get_features API (needed for SCO tests) 2013-08-01 12:54:32 +03:00
Frédéric Dalleau
287304526a emulator: Add SCO connection creation support 2013-08-01 12:54:32 +03:00
Bruna Moreira
c582e850a8 emulator: Add new function for running all hooks
It was defined four hook types and they are run before/after the first
part of default command processing and send event. Note that hook return
will define if the emulator will process/send next events (calling the
default_cmd_completion() function or not).
2013-07-24 09:05:56 -07:00
Eder Ruiz Maria
0714d4ee67 emulator: cmd_status() using send_packet() for run hooks easily
Now like cmd_command(), cmd_status() directly uses send_packet() instead
of send_event(), consequently cmd_status() must build the hci packet
without help of send_event(). With this change the events sent by
default_cmd() no more use send_event(), who is a good place to run hooks
for BTDEV_HOOK_POST_EVT. And the functions cmd_command() and
cmd_status() can run hooks for BTDEV_HOOK_POST_CMD.
2013-07-24 09:05:45 -07:00
Eder Ruiz Maria
6eef674964 emulator: Split default_cmd() for better command and event handler
Now except for command complete event and command status event, all
other are handled by default_cmd_completion(). With this we can easily
add hooks in some points.
2013-07-24 09:04:03 -07:00
Eder Ruiz Maria
653a17cc3b emulator: Add support for delete a hook 2013-07-24 09:03:49 -07:00
Eder Ruiz Maria
7fcddf9989 emulator: Add hook only if there aren't other with same type and opcode 2013-07-24 09:03:02 -07:00
Eder Ruiz Maria
37199df506 emulator: Add support for pre/post command/event hooks
Now who use emulator can add hooks to manipulate hci packets before
and after process commands and send events.
2013-07-24 09:02:52 -07:00
Jefferson Delfes
328231416b emulator: Implement LE advertising report
When a virtual device starts a LE advertising, emulator searches for
other virtual devices that are in scan mode, in order to send adv data
to these devices.
Inverse goes when LE scan is enabled. Emulator searches virtual devices
that are in advertising mode and copy adv data to them.
2013-07-05 11:56:48 +03:00
Jefferson Delfes
2aab109f42 emulator: Dummy LE set advertising parameters
Implement basic LE set adv parameters command.
2013-07-05 11:56:25 +03:00
Jefferson Delfes
8d3386453a emulator: Disallow LE set scan params command when scan is enabled
When LE scan is enabled, the command LE set scan parameters should
return a command disallowed in status of command complete event.
2013-07-05 11:56:13 +03:00
Jefferson Delfes
5616bb9686 emulator: Store LE scan state of virtual controller
The LE command set scan enable can change the scan state of virtual
controller.
2013-07-05 11:55:57 +03:00
Jefferson Delfes
ba6460907a emulator: Implement basic LE set adv enable command
Store advertising state of virtual controller in btdev struct.
2013-07-05 11:55:33 +03:00
Jefferson Delfes
f1877f83b2 emulator: Store LE advertising data length in btdev
LE advertising data length will be used for emulating reports in other
virtual devices.
2013-07-05 11:55:09 +03:00
Anderson Lizardo
14b00ae8d2 emulator: Fix Remote Name Request Cancel command complete
The Command Complete event for this HCI command contains two parameters,
status and bd_addr.
2013-06-17 13:49:19 +03:00
Anderson Lizardo
fc2911aae7 emulator: Fix uninitialised memory usage on inquiry
This happens when using "btvirt -l2" and running "discoverable on" on
hci1 and "scan on" on hci0 using bluetoothctl:

==1870== Syscall param write(buf) points to uninitialised byte(s)
==1870==    at 0x4114443: __write_nocancel (syscall-template.S:82)
==1870==    by 0x804B503: send_packet (btdev.c:478)
==1870==    by 0x804B599: send_event (btdev.c:503)
==1870==    by 0x804B8C0: inquiry_complete (btdev.c:589)
==1870==    by 0x804C538: default_cmd (btdev.c:881)
==1870==    by 0x804E5DE: process_cmd (btdev.c:1559)
==1870==    by 0x804E646: btdev_receive_h4 (btdev.c:1577)
==1870==    by 0x804A487: vhci_read_callback (vhci.c:82)
==1870==    by 0x804923E: mainloop_run (mainloop.c:142)
==1870==    by 0x8048FD4: main (main.c:145)
==1870==  Address 0x41e4d0f is 15 bytes inside a block of size 258
alloc'd
==1870==    at 0x402B56C: malloc (vg_replace_malloc.c:270)
==1870==    by 0x804B531: send_event (btdev.c:490)
==1870==    by 0x804B8C0: inquiry_complete (btdev.c:589)
==1870==    by 0x804C538: default_cmd (btdev.c:881)
==1870==    by 0x804E5DE: process_cmd (btdev.c:1559)
==1870==    by 0x804E646: btdev_receive_h4 (btdev.c:1577)
==1870==    by 0x804A487: vhci_read_callback (vhci.c:82)
==1870==    by 0x804923E: mainloop_run (mainloop.c:142)
==1870==    by 0x8048FD4: main (main.c:145)
==1870==
2013-06-17 13:49:17 +03:00
Johan Hedberg
dcd5640ece emulator: Fix typo in supported command comment 2013-06-13 12:19:00 +03:00
Johan Hedberg
c27f48e426 emulator: Fix btdev connectability test (0x02 is page scan) 2013-05-28 11:14:16 +03:00
Johan Hedberg
890fac2917 emulator: Remove unneeded btdev_set_bdaddr function 2013-04-30 13:21:23 +03:00
Jefferson Delfes
b895b60dcf emulator: Add getter function for device address in btdev
This helper function returns bdaddr field from btdev.
2013-04-30 13:01:58 +03:00
Johan Hedberg
1e0aa26199 emulator: Remove extended features from LE-only controllers 2013-04-19 16:51:07 +03:00
Johan Hedberg
d311de1295 emulator: Move Event Mask Page 2 from BR/EDR to BR/EDR/LE 2013-04-19 16:50:21 +03:00
Johan Hedberg
449ab3a1ad emulator: Add proper supported commands response values 2013-04-19 16:13:48 +03:00
Johan Hedberg
d4405c37b5 emulator: Add missing command support checks 2013-04-19 16:02:55 +03:00
Johan Hedberg
711b7e3008 emulator: Add basic HCI_Set_Event_Mask_Page_2 support 2013-04-19 15:55:20 +03:00
Johan Hedberg
4c4726d1d5 emulator: Add sync train parameter reading support 2013-04-18 17:57:38 +03:00
Johan Hedberg
611d1d2ca6 emulator: Fix extended features invalid params response 2013-04-18 17:57:38 +03:00
Johan Hedberg
ddb4dbd0ea emulator: Add support for local features page 2 2013-04-17 14:56:35 +03:00
Johan Hedberg
9353c8ca44 emulator: Fix missing break statement for LE Read White List Size 2013-03-04 15:34:42 +02:00
Johan Hedberg
338656c527 emulator: Add Page Scan Type HCI command support 2013-03-04 15:27:52 +02:00
Johan Hedberg
373abffd14 emulator: Add Page Scan Activity HCI command support 2013-03-04 15:19:25 +02:00
Johan Hedberg
11b9adb69a emulator: Fix BR/EDR-only and LE-only supported command checks 2013-01-31 21:47:22 -06:00
Johan Hedberg
6b0eaec9bd emulator: Fix controller version for BR/EDR type 2013-01-31 14:52:11 -06:00
Johan Hedberg
d61dcac1fc emulator: Create separate BR/EDR/LE and BR/EDR device types 2013-01-31 14:26:40 -06:00
Johan Hedberg
a6bbc7617f emulator: Fix LE Read White List Size response variable naming 2013-01-27 05:09:49 -06:00
Johan Hedberg
c491db263f emulator: Add support for LE Read White List Size command 2013-01-26 19:14:35 +02:00
Johan Hedberg
d624314263 emulator: Add support for HCI_LE_Set_Advertising_Data command 2013-01-11 16:00:01 +02:00
Marcel Holtmann
82e196d32a emulator: Relax license restrictions on device emulation 2012-12-17 20:37:37 +01:00
Marcel Holtmann
747c74538f emulator: Add support for custom HCI command handling 2012-12-17 02:03:22 +01:00
Marcel Holtmann
fefe4edf13 emulator: Add support for setting Bluetooth device address 2012-12-15 23:53:03 +01:00
Johan Hedberg
b8779d2202 Revert "Ensure config.h is included by using CPPFLAGS"
This reverts commit 8a03376544.

The patch needs to be split up and the gdbus/ changes were bogus
compared to the original commit message.

Conflicts:
	Makefile.am
	Makefile.obexd
	profiles/cyclingspeed/cyclingspeed.c
	profiles/heartrate/heartrate.c
	src/error.c
2012-12-07 12:46:04 +02:00
Lucas De Marchi
8a03376544 Ensure config.h is included by using CPPFLAGS
Instead of trying to include config.h in each file over the tree and
possibly forgetting to include it, give a "-include config.h" argument
to the compiler so it's guaranteed that a) it will be included for all
source files and b) it will be the first header included.

gdbus/ directory is left out, since it would break other projects using
it.
2012-12-05 17:18:07 +02:00
Marcel Holtmann
ce06826bd7 build: Remove stupid -I directives 2012-11-20 16:12:51 +01:00
Marcel Holtmann
bd83307026 emulator: Create server channel for LE only device 2012-11-13 18:37:34 +09:00
Marcel Holtmann
918e4d24a5 monitor: Support basic set of AMP controller commands and events 2012-11-04 19:32:46 +01:00
Marcel Holtmann
e4e3df41b0 emulator: Add the page scan modes to inquiry results 2012-11-02 11:23:17 +01:00
Marcel Holtmann
7bc76b3d3a monitor: Add more decoding of HCI commands and events 2012-11-02 08:43:25 +01:00
Marcel Holtmann
d4618b52d4 emulator: Handle requests for advertising channel TX power 2012-10-31 18:42:50 -07:00
Marcel Holtmann
214244f1cb emulator: Handle the local AMP info command 2012-10-29 16:09:38 -07:00
Marcel Holtmann
1dbe2217a4 emulator: Add type definition for AMP controller 2012-10-29 15:29:15 -07:00
Marcel Holtmann
e696bce8a5 emulator: Add stub for LE single mode devices 2012-10-29 15:12:03 -07:00
Marcel Holtmann
09c2d25647 emulator: Allow specifying controller type 2012-10-29 15:01:43 -07:00
Marcel Holtmann
43ec488a22 emulator: Create unique addresses accross devices 2012-10-29 14:54:54 -07:00
Marcel Holtmann
d5be1cc111 emulator: Add initial version of new emulator 2012-02-27 10:56:43 -08:00