|
19 | 19 | #include <zephyr/bluetooth/classic/hfp_hf.h>
|
20 | 20 | #include <zephyr/settings/settings.h>
|
21 | 21 |
|
22 |
| -static void connected(struct bt_conn *conn) |
| 22 | +static void hf_connected(struct bt_conn *conn, struct bt_hfp_hf *hf) |
23 | 23 | {
|
24 | 24 | printk("HFP HF Connected!\n");
|
25 | 25 | }
|
26 | 26 |
|
27 |
| -static void disconnected(struct bt_conn *conn) |
| 27 | +static void hf_disconnected(struct bt_hfp_hf *hf) |
28 | 28 | {
|
29 | 29 | printk("HFP HF Disconnected!\n");
|
30 | 30 | }
|
31 | 31 |
|
32 |
| -static void service(struct bt_conn *conn, uint32_t value) |
| 32 | +static void hf_sco_connected(struct bt_hfp_hf *hf, struct bt_conn *sco_conn) |
| 33 | +{ |
| 34 | + printk("HF SCO connected\n"); |
| 35 | +} |
| 36 | + |
| 37 | +static void hf_sco_disconnected(struct bt_conn *sco_conn, uint8_t reason) |
| 38 | +{ |
| 39 | + printk("HF SCO disconnected\n"); |
| 40 | +} |
| 41 | + |
| 42 | +static void hf_service(struct bt_hfp_hf *hf, uint32_t value) |
33 | 43 | {
|
34 | 44 | printk("Service indicator value: %u\n", value);
|
35 | 45 | }
|
36 | 46 |
|
37 |
| -static void call(struct bt_conn *conn, uint32_t value) |
| 47 | +static void hf_outgoing(struct bt_hfp_hf *hf, struct bt_hfp_hf_call *call) |
| 48 | +{ |
| 49 | + printk("HF call %p outgoing\n", call); |
| 50 | +} |
| 51 | + |
| 52 | +static void hf_remote_ringing(struct bt_hfp_hf_call *call) |
| 53 | +{ |
| 54 | + printk("HF remote call %p start ringing\n", call); |
| 55 | +} |
| 56 | + |
| 57 | +static void hf_incoming(struct bt_hfp_hf *hf, struct bt_hfp_hf_call *call) |
| 58 | +{ |
| 59 | + printk("HF call %p incoming\n", call); |
| 60 | +} |
| 61 | + |
| 62 | +static void hf_incoming_held(struct bt_hfp_hf_call *call) |
| 63 | +{ |
| 64 | + printk("HF call %p is held\n", call); |
| 65 | +} |
| 66 | + |
| 67 | +static void hf_accept(struct bt_hfp_hf_call *call) |
38 | 68 | {
|
39 |
| - printk("Call indicator value: %u\n", value); |
| 69 | + printk("HF call %p accepted\n", call); |
40 | 70 | }
|
41 | 71 |
|
42 |
| -static void call_setup(struct bt_conn *conn, uint32_t value) |
| 72 | +static void hf_reject(struct bt_hfp_hf_call *call) |
43 | 73 | {
|
44 |
| - printk("Call Setup indicator value: %u\n", value); |
| 74 | + printk("HF call %p rejected\n", call); |
45 | 75 | }
|
46 | 76 |
|
47 |
| -static void call_held(struct bt_conn *conn, uint32_t value) |
| 77 | +static void hf_terminate(struct bt_hfp_hf_call *call) |
48 | 78 | {
|
49 |
| - printk("Call Held indicator value: %u\n", value); |
| 79 | + printk("HF call %p terminated\n", call); |
50 | 80 | }
|
51 | 81 |
|
52 |
| -static void signal(struct bt_conn *conn, uint32_t value) |
| 82 | +static void hf_signal(struct bt_hfp_hf *hf, uint32_t value) |
53 | 83 | {
|
54 | 84 | printk("Signal indicator value: %u\n", value);
|
55 | 85 | }
|
56 | 86 |
|
57 |
| -static void roam(struct bt_conn *conn, uint32_t value) |
| 87 | +static void hf_roam(struct bt_hfp_hf *hf, uint32_t value) |
58 | 88 | {
|
59 | 89 | printk("Roaming indicator value: %u\n", value);
|
60 | 90 | }
|
61 | 91 |
|
62 |
| -static void battery(struct bt_conn *conn, uint32_t value) |
| 92 | +static void hf_battery(struct bt_hfp_hf *hf, uint32_t value) |
63 | 93 | {
|
64 | 94 | printk("Battery indicator value: %u\n", value);
|
65 | 95 | }
|
66 | 96 |
|
67 |
| -static void ring_cb(struct bt_conn *conn) |
| 97 | +static void hf_ring_indication(struct bt_hfp_hf_call *call) |
68 | 98 | {
|
69 |
| - printk("Incoming Call...\n"); |
| 99 | + printk("HF call %p ring\n", call); |
70 | 100 | }
|
71 | 101 |
|
72 | 102 | static struct bt_hfp_hf_cb hf_cb = {
|
73 |
| - .connected = connected, |
74 |
| - .disconnected = disconnected, |
75 |
| - .service = service, |
76 |
| - .call = call, |
77 |
| - .call_setup = call_setup, |
78 |
| - .call_held = call_held, |
79 |
| - .signal = signal, |
80 |
| - .roam = roam, |
81 |
| - .battery = battery, |
82 |
| - .ring_indication = ring_cb, |
| 103 | + .connected = hf_connected, |
| 104 | + .disconnected = hf_disconnected, |
| 105 | + .sco_connected = hf_sco_connected, |
| 106 | + .sco_disconnected = hf_sco_disconnected, |
| 107 | + .service = hf_service, |
| 108 | + .outgoing = hf_outgoing, |
| 109 | + .remote_ringing = hf_remote_ringing, |
| 110 | + .incoming = hf_incoming, |
| 111 | + .incoming_held = hf_incoming_held, |
| 112 | + .accept = hf_accept, |
| 113 | + .reject = hf_reject, |
| 114 | + .terminate = hf_terminate, |
| 115 | + .signal = hf_signal, |
| 116 | + .roam = hf_roam, |
| 117 | + .battery = hf_battery, |
| 118 | + .ring_indication = hf_ring_indication, |
83 | 119 | };
|
84 | 120 |
|
85 | 121 | static void bt_ready(int err)
|
|
0 commit comments