Browse Source

Bluetooth: Classic: SCO: Modify `bt_sco_chan::ops` with `const`

Use `const` to modify the field `ops` of the structure
`struct bt_sco_chan`.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
pull/92275/head
Lyle Zhu 3 months ago committed by Daniel DeGrasse
parent
commit
0c2c93d57d
  1. 4
      subsys/bluetooth/host/classic/hfp_ag.c
  2. 2
      subsys/bluetooth/host/classic/hfp_hf.c
  3. 6
      subsys/bluetooth/host/classic/sco_internal.h

4
subsys/bluetooth/host/classic/hfp_ag.c

@ -1399,7 +1399,7 @@ static void hfp_ag_sco_disconnected(struct bt_sco_chan *chan, uint8_t reason) @@ -1399,7 +1399,7 @@ static void hfp_ag_sco_disconnected(struct bt_sco_chan *chan, uint8_t reason)
static struct bt_conn *bt_hfp_ag_create_sco(struct bt_hfp_ag *ag)
{
static struct bt_sco_chan_ops ops = {
static const struct bt_sco_chan_ops ops = {
.connected = hfp_ag_sco_connected,
.disconnected = hfp_ag_sco_disconnected,
};
@ -3958,7 +3958,7 @@ static int hfp_ag_accept(struct bt_conn *conn, struct bt_rfcomm_server *server, @@ -3958,7 +3958,7 @@ static int hfp_ag_accept(struct bt_conn *conn, struct bt_rfcomm_server *server,
static int bt_hfp_ag_sco_accept(const struct bt_sco_accept_info *info,
struct bt_sco_chan **chan)
{
static struct bt_sco_chan_ops ops = {
static const struct bt_sco_chan_ops ops = {
.connected = hfp_ag_sco_connected,
.disconnected = hfp_ag_sco_disconnected,
};

2
subsys/bluetooth/host/classic/hfp_hf.c

@ -4161,7 +4161,7 @@ static void hfp_hf_sco_disconnected(struct bt_sco_chan *chan, uint8_t reason) @@ -4161,7 +4161,7 @@ static void hfp_hf_sco_disconnected(struct bt_sco_chan *chan, uint8_t reason)
static int bt_hfp_hf_sco_accept(const struct bt_sco_accept_info *info,
struct bt_sco_chan **chan)
{
static struct bt_sco_chan_ops ops = {
static const struct bt_sco_chan_ops ops = {
.connected = hfp_hf_sco_connected,
.disconnected = hfp_hf_sco_disconnected,
};

6
subsys/bluetooth/host/classic/sco_internal.h

@ -48,11 +48,11 @@ struct bt_sco_chan_ops { @@ -48,11 +48,11 @@ struct bt_sco_chan_ops {
};
struct bt_sco_chan {
struct bt_conn *sco;
struct bt_conn *sco;
/** Channel operations reference */
struct bt_sco_chan_ops *ops;
const struct bt_sco_chan_ops *ops;
enum bt_sco_state state;
enum bt_sco_state state;
};
/** @brief Initiate an SCO connection to a remote device.

Loading…
Cancel
Save