You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by an...@apache.org on 2022/02/09 11:38:45 UTC
[mynewt-nimble] 04/04: nimble/ll: Fix master/slave in comments
This is an automated email from the ASF dual-hosted git repository.
andk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git
commit cd1706b91722dc13c710541b7d11e470c1dd80b3
Author: Andrzej Kaczmarek <an...@codecoup.pl>
AuthorDate: Tue Feb 8 13:24:51 2022 +0100
nimble/ll: Fix master/slave in comments
---
nimble/controller/src/ble_ll_adv.c | 2 +-
nimble/controller/src/ble_ll_conn.c | 64 ++++++++++++-------------
nimble/controller/src/ble_ll_conn_hci.c | 24 +++++-----
nimble/controller/src/ble_ll_ctrl.c | 82 ++++++++++++++++-----------------
nimble/controller/src/ble_ll_sched.c | 42 ++++++++---------
nimble/controller/src/ble_ll_sync.c | 2 +-
6 files changed, 108 insertions(+), 108 deletions(-)
diff --git a/nimble/controller/src/ble_ll_adv.c b/nimble/controller/src/ble_ll_adv.c
index 5f024da..d8d251b 100644
--- a/nimble/controller/src/ble_ll_adv.c
+++ b/nimble/controller/src/ble_ll_adv.c
@@ -4400,7 +4400,7 @@ ble_ll_adv_conn_req_rxd(uint8_t *rxbuf, struct ble_mbuf_hdr *hdr,
}
#endif
- /* Try to start slave connection. If successful, stop advertising */
+ /* Try to start peripheral connection. If successful, stop advertising */
valid = ble_ll_conn_periph_start(rxbuf, addr_type, hdr,
!(advsm->props &
BLE_HCI_LE_SET_EXT_ADV_PROP_LEGACY));
diff --git a/nimble/controller/src/ble_ll_conn.c b/nimble/controller/src/ble_ll_conn.c
index 7824f1d..33a666a 100644
--- a/nimble/controller/src/ble_ll_conn.c
+++ b/nimble/controller/src/ble_ll_conn.c
@@ -62,8 +62,8 @@ extern void bletest_completed_pkt(uint16_t handle);
* 2) Make sure we check incoming data packets for size and all that. You
* know, supported octets and all that. For both rx and tx.
*
- * 3) Make sure we are setting the schedule end time properly for both slave
- * and master. We should just set this to the end of the connection event.
+ * 3) Make sure we are setting the schedule end time properly for both peripheral
+ * and central. We should just set this to the end of the connection event.
* We might want to guarantee a IFS time as well since the next event needs
* to be scheduled prior to the start of the event to account for the time it
* takes to get a frame ready (which is pretty much the IFS time).
@@ -83,15 +83,15 @@ extern void bletest_completed_pkt(uint16_t handle);
*
* 8) Right now I use a fixed definition for required slots. CHange this.
*
- * 10) See what connection state machine elements are purely master and
- * purely slave. We can make a union of them.
+ * 10) See what connection state machine elements are purely central and
+ * purely peripheral. We can make a union of them.
*
* 11) Not sure I am dealing with the connection terminate timeout perfectly.
* I may extend a connection event too long although if it is always in terms
* of connection events I am probably fine. Checking at end that the next
* connection event will occur past terminate timeould would be fine.
*
- * 12) When a slave receives a data packet in a connection it has to send a
+ * 12) When a peripheral receives a data packet in a connection it has to send a
* response. Well, it should. If this packet will overrun the next scheduled
* event, what should we do? Transmit anyway? Not transmit? For now, we just
* transmit.
@@ -666,7 +666,7 @@ ble_ll_conn_wfr_timer_exp(void)
}
/**
- * Callback for slave when it transmits a data pdu and the connection event
+ * Callback for peripheral when it transmits a data pdu and the connection event
* ends after the transmission.
*
* Context: Interrupt
@@ -973,8 +973,8 @@ ble_ll_conn_tx_pdu(struct ble_ll_conn_sm *connsm)
/*
* We will allow a next packet if it itself is allowed or we are
- * a slave and we are sending the START_ENC_RSP. The master has
- * to wait to receive the START_ENC_RSP from the slave before
+ * a peripheral and we are sending the START_ENC_RSP. The central has
+ * to wait to receive the START_ENC_RSP from the peripheral before
* packets can be let go.
*/
if (nextpkthdr && !ble_ll_ctrl_enc_allowed_pdu_tx(nextpkthdr)
@@ -1064,7 +1064,7 @@ ble_ll_conn_tx_pdu(struct ble_ll_conn_sm *connsm)
* -> wait IFS, send the next frame.
* -> wait IFS, receive a maximum size frame.
*
- * For slave:
+ * For peripheral:
* -> wait IFS, send current frame.
* -> wait IFS, receive maximum size frame.
* -> wait IFS, send next frame.
@@ -1141,13 +1141,13 @@ conn_tx_pdu:
ble_hdr->txinfo.hdr_byte = hdr_byte;
/*
- * If we are a slave, check to see if this transmission will end the
+ * If we are a peripheral, check to see if this transmission will end the
* connection event. We will end the connection event if we have
* received a valid frame with the more data bit set to 0 and we dont
* have more data.
*
- * XXX: for a slave, we dont check to see if we can:
- * -> wait IFS, rx frame from master (either big or small).
+ * XXX: for a peripheral, we dont check to see if we can:
+ * -> wait IFS, rx frame from central (either big or small).
* -> wait IFS, send empty pdu or next pdu.
*
* We could do this. Now, we just keep going and hope that we dont
@@ -1179,7 +1179,7 @@ conn_tx_pdu:
if (is_ctrl && (opcode == BLE_LL_CTRL_START_ENC_RSP)) {
/*
- * Both master and slave send the START_ENC_RSP encrypted and receive
+ * Both central and peripheral send the START_ENC_RSP encrypted and receive
* encrypted
*/
CONN_F_ENCRYPTED(connsm) = 1;
@@ -1190,7 +1190,7 @@ conn_tx_pdu:
CONN_IS_CENTRAL(connsm));
} else if (is_ctrl && (opcode == BLE_LL_CTRL_START_ENC_REQ)) {
/*
- * Only the slave sends this and it gets sent unencrypted but
+ * Only the peripheral sends this and it gets sent unencrypted but
* we receive encrypted
*/
CONN_F_ENCRYPTED(connsm) = 0;
@@ -1204,7 +1204,7 @@ conn_tx_pdu:
}
} else if (is_ctrl && (opcode == BLE_LL_CTRL_PAUSE_ENC_RSP)) {
/*
- * The slave sends the PAUSE_ENC_RSP encrypted. The master sends
+ * The peripheral sends the PAUSE_ENC_RSP encrypted. The central sends
* it unencrypted (note that link was already set unencrypted).
*/
switch (connsm->conn_role) {
@@ -1376,7 +1376,7 @@ ble_ll_conn_event_start_cb(struct ble_ll_sched_item *sch)
}
#endif
- /* XXX: what is this really for the slave? */
+ /* XXX: what is this really for the peripheral? */
start = sch->start_time + g_ble_ll_sched_offset_ticks;
rc = ble_phy_rx_set_start_time(start, sch->remainder);
if (rc) {
@@ -1385,14 +1385,14 @@ ble_ll_conn_event_start_cb(struct ble_ll_sched_item *sch)
rc = BLE_LL_SCHED_STATE_DONE;
} else {
/*
- * Set flag that tells slave to set last anchor point if a packet
+ * Set flag that tells peripheral to set last anchor point if a packet
* has been received.
*/
connsm->csmflags.cfbit.periph_set_last_anchor = 1;
/*
* Set the wait for response time. The anchor point is when we
- * expect the master to start transmitting. Worst-case, we expect
+ * expect the central to start transmitting. Worst-case, we expect
* to hear a reply within the anchor point plus:
* -> current tx window size
* -> current window widening amount (includes +/- 16 usec jitter)
@@ -1441,9 +1441,9 @@ ble_ll_conn_event_start_cb(struct ble_ll_sched_item *sch)
/**
* Called to determine if the device is allowed to send the next pdu in the
- * connection event. This will always return 'true' if we are a slave. If we
- * are a master, we must be able to send the next fragment and get a minimum
- * sized response from the slave.
+ * connection event. This will always return 'true' if we are a peripheral. If we
+ * are a central, we must be able to send the next fragment and get a minimum
+ * sized response from the peripheral.
*
* Context: Interrupt context (rx end isr).
*
@@ -1590,7 +1590,7 @@ ble_ll_conn_central_common_init(struct ble_ll_conn_sm *connsm)
}
/**
* Called when a create connection command has been received. This initializes
- * a connection state machine in the master role.
+ * a connection state machine in the central role.
*
* NOTE: Must be called before the state machine is started
*
@@ -1715,7 +1715,7 @@ ble_ll_conn_set_csa(struct ble_ll_conn_sm *connsm, bool chsel)
/**
* Create a new connection state machine. This is done once per
* connection when the HCI command "create connection" is issued to the
- * controller or when a slave receives a connect request.
+ * controller or when a peripheral receives a connect request.
*
* Context: Link Layer task
*
@@ -2053,9 +2053,9 @@ ble_ll_conn_next_event(struct ble_ll_conn_sm *connsm)
*/
/*
- * XXX TODO: I think this is technically incorrect. We can allow slave
+ * XXX TODO: I think this is technically incorrect. We can allow peripheral
* latency if we are doing one of these updates as long as we
- * know that the master has received the ACK to the PDU that set
+ * know that the central has received the ACK to the PDU that set
* the instant
*/
/* Set event counter to the next connection event that we will tx/rx in */
@@ -2140,9 +2140,9 @@ ble_ll_conn_next_event(struct ble_ll_conn_sm *connsm)
((int16_t)(connsm->chanmap_instant - connsm->event_cntr) <= 0)) {
/* XXX: there is a chance that the control packet is still on
- * the queue of the master. This means that we never successfully
+ * the queue of the central. This means that we never successfully
* transmitted update request. Would end up killing connection
- on slave side. Could ignore it or see if still enqueued. */
+ on peripheral side. Could ignore it or see if still enqueued. */
connsm->num_used_chans =
ble_ll_utils_calc_num_used_chans(connsm->req_chanmap);
memcpy(connsm->chanmap, connsm->req_chanmap, BLE_LL_CONN_CHMAP_LEN);
@@ -2290,7 +2290,7 @@ ble_ll_conn_created(struct ble_ll_conn_sm *connsm, struct ble_mbuf_hdr *rxhdr)
connsm->last_rxd_pdu_cputime = connsm->last_scheduled;
/*
- * Set first connection event time. If slave the endtime is the receive end
+ * Set first connection event time. If peripheral the endtime is the receive end
* time of the connect request. The actual connection starts 1.25 msecs plus
* the transmit window offset from the end of the connection request.
*/
@@ -2385,7 +2385,7 @@ ble_ll_conn_created(struct ble_ll_conn_sm *connsm, struct ble_mbuf_hdr *rxhdr)
*
* XXX we do this only as a central as it was observed that sending
* LL_PERIPH_FEATURE_REQ after connection breaks some recent iPhone
- * models; for slave just assume master will initiate features xchg
+ * models; for peripheral just assume central will initiate features xchg
* if it has some additional features to use.
*/
ble_ll_ctrl_proc_start(connsm, BLE_LL_CTRL_PROC_FEATURE_XCHG);
@@ -3016,8 +3016,8 @@ ble_ll_conn_rx_data_pdu(struct os_mbuf *rxpdu, struct ble_mbuf_hdr *hdr)
connsm->conn_rssi = hdr->rxinfo.rssi;
/*
- * If we are a slave, we can only start to use slave latency
- * once we have received a NESN of 1 from the master
+ * If we are a peripheral, we can only start to use peripheral latency
+ * once we have received a NESN of 1 from the central
*/
#if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
if (connsm->conn_role == BLE_LL_CONN_ROLE_PERIPHERAL) {
@@ -3577,7 +3577,7 @@ ble_ll_conn_set_global_chanmap(uint8_t num_used_chans, const uint8_t *chanmap)
/**
* Called when a device has received a connect request while advertising and
* the connect request has passed the advertising filter policy and is for
- * us. This will start a connection in the slave role assuming that we dont
+ * us. This will start a connection in the peripheral role assuming that we dont
* already have a connection with this device and that the connect request
* parameters are valid.
*
diff --git a/nimble/controller/src/ble_ll_conn_hci.c b/nimble/controller/src/ble_ll_conn_hci.c
index 8a90ed7..6664458 100644
--- a/nimble/controller/src/ble_ll_conn_hci.c
+++ b/nimble/controller/src/ble_ll_conn_hci.c
@@ -582,7 +582,7 @@ ble_ll_conn_hci_create(const uint8_t *cmdbuf, uint8_t len)
return BLE_ERR_CONN_LIMIT;
}
- /* Initialize state machine in master role and start state machine */
+ /* Initialize state machine in central role and start state machine */
ble_ll_conn_central_init(connsm, &cc_scan, &cc_params);
ble_ll_conn_sm_new(connsm);
@@ -770,7 +770,7 @@ ble_ll_conn_hci_ext_create(const uint8_t *cmdbuf, uint8_t len)
return BLE_ERR_CONN_LIMIT;
}
- /* Initialize state machine in master role and start state machine */
+ /* Initialize state machine in central role and start state machine */
ble_ll_conn_central_init(connsm, &cc_scan,
&g_ble_ll_conn_create_sm.params[0]);
ble_ll_conn_sm_new(connsm);
@@ -886,7 +886,7 @@ ble_ll_conn_hci_update(const uint8_t *cmdbuf, uint8_t len)
struct hci_conn_update *hcu;
/*
- * XXX: must deal with slave not supporting this feature and using
+ * XXX: must deal with peripheral not supporting this feature and using
* conn update! Right now, we only check if WE support the connection
* parameters request procedure. We dont check if the remote does.
* We should also be able to deal with sending the parameter request,
@@ -920,10 +920,10 @@ ble_ll_conn_hci_update(const uint8_t *cmdbuf, uint8_t len)
}
/*
- * If we are a slave and the master has initiated the procedure already
- * we should deny the slave request for now. If we are a master and the
- * slave has initiated the procedure, we need to send a reject to the
- * slave.
+ * If we are a peripheral and the central has initiated the procedure already
+ * we should deny the peripheral request for now. If we are a central and the
+ * peripheral has initiated the procedure, we need to send a reject to the
+ * peripheral.
*/
if (connsm->csmflags.cfbit.awaiting_host_reply) {
switch (connsm->conn_role) {
@@ -948,8 +948,8 @@ ble_ll_conn_hci_update(const uint8_t *cmdbuf, uint8_t len)
}
/*
- * If we are a slave and the master has initiated the channel map
- * update procedure we should deny the slave request for now.
+ * If we are a peripheral and the central has initiated the channel map
+ * update procedure we should deny the peripheral request for now.
*/
#if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
if (connsm->csmflags.cfbit.chanmap_update_scheduled) {
@@ -1524,7 +1524,7 @@ ble_ll_conn_hci_le_ltk_reply(const uint8_t *cmdbuf, uint8_t len,
}
#if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
- /* Should never get this if we are a master! */
+ /* Should never get this if we are a central! */
if (connsm->conn_role == BLE_LL_CONN_ROLE_CENTRAL) {
rc = BLE_ERR_UNSPECIFIED;
goto ltk_key_cmd_complete;
@@ -1583,7 +1583,7 @@ ble_ll_conn_hci_le_ltk_neg_reply(const uint8_t *cmdbuf, uint8_t len,
}
#if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
- /* Should never get this if we are a master! */
+ /* Should never get this if we are a central! */
if (connsm->conn_role == BLE_LL_CONN_ROLE_CENTRAL) {
rc = BLE_ERR_UNSPECIFIED;
goto ltk_key_cmd_complete;
@@ -1713,7 +1713,7 @@ ble_ll_conn_hci_wr_auth_pyld_tmo(const uint8_t *cmdbuf, uint8_t len,
} else {
/*
* The timeout is in units of 10 msecs. We need to make sure that the
- * timeout is greater than or equal to connItvl * (1 + slaveLatency)
+ * timeout is greater than or equal to connItvl * (1 + peripheralLatency)
*/
tmo = le16toh(cmd->tmo);
min_tmo = (uint32_t)connsm->conn_itvl * BLE_LL_CONN_ITVL_USECS;
diff --git a/nimble/controller/src/ble_ll_ctrl.c b/nimble/controller/src/ble_ll_ctrl.c
index 609fc5d..62272d7 100644
--- a/nimble/controller/src/ble_ll_ctrl.c
+++ b/nimble/controller/src/ble_ll_ctrl.c
@@ -319,14 +319,14 @@ ble_ll_ctrl_conn_param_pdu_proc(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
/*
* A change has been requested. Is it within the values specified by
- * the host? Note that for a master we will not be processing a
- * connect param request from a slave if we are currently trying to
+ * the host? Note that for a central we will not be processing a
+ * connect param request from a peripheral if we are currently trying to
* update the connection parameters. This means that the previous
- * check is all we need for a master (when receiving a request).
+ * check is all we need for a central (when receiving a request).
*/
if (CONN_IS_PERIPHERAL(connsm) || (opcode == BLE_LL_CTRL_CONN_PARM_RSP)) {
/*
- * Not sure what to do about the slave. It is possible that the
+ * Not sure what to do about the peripheral. It is possible that the
* current connection parameters are not the same ones as the local host
* has provided? Not sure what to do here. Do we need to remember what
* host sent us? For now, I will assume that we need to remember what
@@ -403,7 +403,7 @@ ble_ll_ctrl_conn_upd_make(struct ble_ll_conn_sm *connsm, uint8_t *pyld,
/*
* Set instant. We set the instant to the current event counter plus
- * the amount of slave latency as the slave may not be listening
+ * the amount of peripheral latency as the peripheral may not be listening
* at every connection interval and we are not sure when the connect
* request will actually get sent. We add one more event plus the
* minimum as per the spec of 6 connection events.
@@ -723,7 +723,7 @@ ble_ll_ctrl_find_new_phy(uint8_t phy_mask_prefs)
* @param connsm Pointer to connection state machine
* @param dptr Pointer to PHY_REQ or PHY_RSP data.
* @param ctrdata: Pointer to where CtrData of UPDATE_IND pdu starts
- * @param periph_req flag denoting if slave requested this. 0: no 1:yes
+ * @param periph_req flag denoting if peripheral requested this. 0: no 1:yes
*/
static void
@@ -741,7 +741,7 @@ ble_ll_ctrl_phy_update_ind_make(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
tx_phys = dptr[0];
rx_phys = dptr[1];
- /* If we are master, check if slave requested symmetric PHY */
+ /* If we are central, check if peripheral requested symmetric PHY */
#if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
if (connsm->conn_role == BLE_LL_CONN_ROLE_CENTRAL) {
is_periph_sym = tx_phys == rx_phys;
@@ -765,9 +765,9 @@ ble_ll_ctrl_phy_update_ind_make(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
* PHY in both directions
*
* Core 5.2, Vol 6, PartB, 5.1.10
- * If the slave specified a single PHY in both the TX_PHYS and
- * RX_PHYS fields and both fields are the same, the master shall
- * either select the PHY specified by the slave for both directions
+ * If the peripheral specified a single PHY in both the TX_PHYS and
+ * RX_PHYS fields and both fields are the same, the central shall
+ * either select the PHY specified by the peripheral for both directions
* or shall leave both directions unchanged.
*/
if ((s_to_m == 0) || (m_to_s == 0)) {
@@ -924,7 +924,7 @@ ble_ll_ctrl_rx_phy_req(struct ble_ll_conn_sm *connsm, uint8_t *req,
/* XXX: TODO: if we started another procedure with an instant
* why are we doing this? Need to look into this.*/
- /* Respond to master's phy update procedure */
+ /* Respond to central's phy update procedure */
CONN_F_PEER_PHY_UPDATE(connsm) = 1;
ble_ll_ctrl_phy_req_rsp_make(connsm, rsp);
rsp_opcode = BLE_LL_CTRL_PHY_RSP;
@@ -988,7 +988,7 @@ ble_ll_ctrl_rx_phy_rsp(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
break;
}
- /* NOTE: slave should never receive one of these */
+ /* NOTE: peripheral should never receive one of these */
return rsp_opcode;
}
@@ -996,7 +996,7 @@ ble_ll_ctrl_rx_phy_rsp(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
/**
* Called when a LL_PHY_UPDATE_IND pdu is received
*
- * NOTE: slave is the only device that should receive this.
+ * NOTE: peripheral is the only device that should receive this.
*
* @param connsm
* @param dptr
@@ -1044,8 +1044,8 @@ ble_ll_ctrl_rx_phy_update_ind(struct ble_ll_conn_sm *connsm, uint8_t *dptr)
} else {
no_change = 0;
/*
- * NOTE: from the slaves perspective, the m to s phy is the one
- * that the slave will receive on; s to m is the one it will
+ * NOTE: from the peripherals perspective, the m to s phy is the one
+ * that the peripheral will receive on; s to m is the one it will
* transmit on
*/
new_rx_phy = ble_ll_ctrl_phy_from_phy_mask(new_m_to_s_mask);
@@ -1239,7 +1239,7 @@ ble_ll_calc_session_key(struct ble_ll_conn_sm *connsm)
* XXX: the current code may actually allow some control pdu's to be sent
* in states where they shouldnt. I dont expect those states to occur so I
* dont try to check for them but we could do more... for example there are
- * different PDUs allowed for master/slave and TX/RX
+ * different PDUs allowed for central/peripheral and TX/RX
*
* @param llid
* @param opcode
@@ -1398,7 +1398,7 @@ ble_ll_ctrl_cis_create(struct ble_ll_conn_sm *connsm, uint8_t *dptr)
* IVm (4)
*
* The random number and encrypted diversifier come from the host command.
- * Controller generates master portion of SDK and IV.
+ * Controller generates central portion of SDK and IV.
*
* NOTE: this function does not set the LL data pdu header nor does it
* set the opcode in the buffer.
@@ -1428,7 +1428,7 @@ ble_ll_ctrl_enc_req_make(struct ble_ll_conn_sm *connsm, uint8_t *dptr)
}
/**
- * Called when LL_ENC_RSP is received by the master.
+ * Called when LL_ENC_RSP is received by the central.
*
* Context: Link Layer Task.
*
@@ -1436,7 +1436,7 @@ ble_ll_ctrl_enc_req_make(struct ble_ll_conn_sm *connsm, uint8_t *dptr)
* SKDs (8)
* IVs (4)
*
- * The master now has the long term key (from the start encrypt command)
+ * The central now has the long term key (from the start encrypt command)
* and the SKD (stored in the plain text encryption block). From this the
* sessionKey is generated.
*
@@ -1462,7 +1462,7 @@ ble_ll_ctrl_rx_enc_rsp(struct ble_ll_conn_sm *connsm, uint8_t *dptr)
/**
* Called when we have received a LL control encryption request PDU. This
- * should only be received by a slave.
+ * should only be received by a peripheral.
*
* The LL_ENC_REQ PDU format is:
* Rand (8)
@@ -1474,7 +1474,7 @@ ble_ll_ctrl_rx_enc_rsp(struct ble_ll_conn_sm *connsm, uint8_t *dptr)
* but it could be a reject ind. Note that the caller of this function
* will send the REJECT_IND_EXT if supported by remote.
*
- * NOTE: if this is received by a master we will silently discard the PDU
+ * NOTE: if this is received by a central we will silently discard the PDU
* (denoted by return BLE_ERR_MAX).
*
* @param connsm
@@ -1530,7 +1530,7 @@ ble_ll_ctrl_rx_start_enc_req(struct ble_ll_conn_sm *connsm)
{
int rc;
- /* Only master should receive start enc request */
+ /* Only central should receive start enc request */
rc = BLE_ERR_MAX;
switch (connsm->conn_role) {
@@ -1651,7 +1651,7 @@ ble_ll_ctrl_rx_start_enc_rsp(struct ble_ll_conn_sm *connsm)
#endif
#if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
case BLE_LL_CONN_ROLE_PERIPHERAL:
- /* Procedure has completed but slave needs to send START_ENC_RSP */
+ /* Procedure has completed but peripheral needs to send START_ENC_RSP */
rc = BLE_LL_CTRL_START_ENC_RSP;
/* Stop timer if it was started when sending START_ENC_REQ */
@@ -1667,7 +1667,7 @@ ble_ll_ctrl_rx_start_enc_rsp(struct ble_ll_conn_sm *connsm)
/*
* XXX: for now, a Slave sends this event when it receivest the
- * START_ENC_RSP from the master. It might be technically incorrect
+ * START_ENC_RSP from the central. It might be technically incorrect
* to send it before we transmit our own START_ENC_RSP.
*/
ble_ll_hci_ev_encrypt_chg(connsm, BLE_ERR_SUCCESS);
@@ -1830,7 +1830,7 @@ ble_ll_ctrl_rx_reject_ind(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
switch (connsm->conn_role) {
#if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
case BLE_LL_CONN_ROLE_CENTRAL:
- /* As a master we should send connection update indication in this point */
+ /* As a central we should send connection update indication in this point */
rsp_opcode = BLE_LL_CTRL_CONN_UPDATE_IND;
ble_ll_ctrl_conn_upd_make(connsm, rspdata, NULL);
connsm->reject_reason = BLE_ERR_SUCCESS;
@@ -1896,7 +1896,7 @@ ble_ll_ctrl_rx_conn_update(struct ble_ll_conn_sm *connsm, uint8_t *dptr)
uint16_t conn_events;
struct ble_ll_conn_upd_req *reqdata;
- /* Only a slave should receive this */
+ /* Only a peripheral should receive this */
#if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
if (connsm->conn_role == BLE_LL_CONN_ROLE_CENTRAL) {
return BLE_LL_CTRL_UNKNOWN_RSP;
@@ -1996,7 +1996,7 @@ ble_ll_ctrl_update_features(struct ble_ll_conn_sm *connsm, uint8_t *feat)
}
/**
- * Called when we receive a feature request or a slave initiated feature
+ * Called when we receive a feature request or a peripheral initiated feature
* request.
*
*
@@ -2016,8 +2016,8 @@ ble_ll_ctrl_rx_feature_req(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
uint64_t our_feat;
/*
- * Only accept slave feature requests if we are a master and feature
- * requests if we are a slave.
+ * Only accept peripheral feature requests if we are a central and feature
+ * requests if we are a peripheral.
*/
if (opcode == BLE_LL_CTRL_PERIPH_FEATURE_REQ) {
if (!CONN_IS_CENTRAL(connsm)) {
@@ -2106,7 +2106,7 @@ ble_ll_ctrl_rx_conn_param_req(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
return BLE_ERR_MAX;
}
- /* XXX: remember to deal with this on the master: if the slave has
+ /* XXX: remember to deal with this on the central: if the peripheral has
* initiated a procedure we may have received its connection parameter
* update request and have signaled the host with an event. If that
* is the case, we will need to drop the host command when we get it
@@ -2116,19 +2116,19 @@ ble_ll_ctrl_rx_conn_param_req(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
* be pending (a connection update) that will cause collisions and the
behavior below. */
/*
- * Check for procedure collision (Vol 6 PartB 5.3). If we are a slave
- * and we receive a request we "consider the slave initiated
+ * Check for procedure collision (Vol 6 PartB 5.3). If we are a peripheral
+ * and we receive a request we "consider the peripheral initiated
* procedure as complete". This means send a connection update complete
* event (with error).
*
- * If a master, we send reject with a
+ * If a central, we send reject with a
* transaction collision error code.
*/
if (IS_PENDING_CTRL_PROC(connsm, BLE_LL_CTRL_PROC_CONN_PARAM_REQ)) {
switch (connsm->conn_role) {
#if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
case BLE_LL_CONN_ROLE_CENTRAL:
- /* The master sends reject ind ext w/error code 0x23 */
+ /* The central sends reject ind ext w/error code 0x23 */
rsp_opcode = BLE_LL_CTRL_REJECT_IND_EXT;
rspbuf[1] = BLE_LL_CTRL_CONN_PARM_REQ;
rspbuf[2] = BLE_ERR_LMP_COLLISION;
@@ -2147,7 +2147,7 @@ ble_ll_ctrl_rx_conn_param_req(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
}
/*
- * If we are a master and we currently performing a channel map
+ * If we are a central and we currently performing a channel map
* update procedure we need to return an error
*/
#if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
@@ -2172,7 +2172,7 @@ ble_ll_ctrl_rx_conn_param_rsp(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
{
uint8_t rsp_opcode;
- /* A slave should never receive this response */
+ /* A peripheral should never receive this response */
#if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
if (connsm->conn_role == BLE_LL_CONN_ROLE_PERIPHERAL) {
return BLE_LL_CTRL_UNKNOWN_RSP;
@@ -2180,9 +2180,9 @@ ble_ll_ctrl_rx_conn_param_rsp(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
#endif
/*
- * This case should never happen! It means that the slave initiated a
- * procedure and the master initiated one as well. If we do get in this
- * state just clear the awaiting reply. The slave will hopefully stop its
+ * This case should never happen! It means that the peripheral initiated a
+ * procedure and the central initiated one as well. If we do get in this
+ * state just clear the awaiting reply. The peripheral will hopefully stop its
* procedure when we reply.
*/
if (connsm->csmflags.cfbit.awaiting_host_reply) {
@@ -2562,7 +2562,7 @@ ble_ll_ctrl_chk_proc_start(struct ble_ll_conn_sm *connsm)
* NOTE: this function uses the received PDU for the response in some cases. If
* the received PDU is not used it needs to be freed here.
*
- * XXX: may want to check, for both master and slave, whether the control
+ * XXX: may want to check, for both central and peripheral, whether the control
* pdu should be received by that role. Might make for less code...
* Context: Link Layer
*
@@ -2954,7 +2954,7 @@ ble_ll_ctrl_tx_done(struct os_mbuf *txpdu, struct ble_ll_conn_sm *connsm)
case BLE_LL_CTRL_REJECT_IND_EXT:
if (connsm->cur_ctrl_proc == BLE_LL_CTRL_PROC_CONN_PARAM_REQ) {
/* If rejecting opcode is BLE_LL_CTRL_PROC_CONN_PARAM_REQ and
- * reason is LMP collision that means we are master on the link and
+ * reason is LMP collision that means we are central on the link and
* peer wanted to start procedure which we already started.
* Let's wait for response and do not close procedure. */
if (txpdu->om_data[1] == BLE_LL_CTRL_CONN_PARM_REQ &&
diff --git a/nimble/controller/src/ble_ll_sched.c b/nimble/controller/src/ble_ll_sched.c
index 4a7051c..b7d8cf6 100644
--- a/nimble/controller/src/ble_ll_sched.c
+++ b/nimble/controller/src/ble_ll_sched.c
@@ -410,7 +410,7 @@ ble_ll_sched_conn_reschedule(struct ble_ll_conn_sm *connsm)
}
/**
- * Called to schedule a connection when the current role is master.
+ * Called to schedule a connection when the current role is central.
*
* Context: Interrupt
*
@@ -452,8 +452,8 @@ ble_ll_sched_central_new(struct ble_ll_conn_sm *connsm,
/* XXX:
* The calculations for the 32kHz crystal bear alot of explanation. The
- * earliest possible time that the master can start the connection with a
- * slave is 1.25 msecs from the end of the connection request. The
+ * earliest possible time that the central can start the connection with a
+ * peripheral is 1.25 msecs from the end of the connection request. The
* connection request is sent an IFS time from the end of the advertising
* packet that was received plus the time it takes to send the connection
* request. At 1 Mbps, this is 1752 usecs, or 57.41 ticks. Using 57 ticks
@@ -462,32 +462,32 @@ ble_ll_sched_central_new(struct ble_ll_conn_sm *connsm,
* the advertising PDU is 'now' (we call os_cputime_get32). We dont know
* how much time it will take to service the ISR but if we are more than the
* rx to tx time of the chip we will not be successful transmitting the
- * connect request. All this means is that we presume that the slave will
+ * connect request. All this means is that we presume that the peripheral will
* receive the connect request later than we expect but no earlier than
* 13 usecs before (this is important).
*
* The code then attempts to schedule the connection at the
* earliest time although this may not be possible. When the actual
- * schedule start time is determined, the master has to determine if this
+ * schedule start time is determined, the central has to determine if this
* time is more than a transmit window offset interval (1.25 msecs). The
- * master has to tell the slave how many transmit window offsets there are
+ * central has to tell the peripheral how many transmit window offsets there are
* from the earliest possible time to when the actual transmit start will
* occur. Later in this function you will see the calculation. The actual
* transmission start has to occur within the transmit window. The transmit
* window interval is in units of 1.25 msecs and has to be at least 1. To
- * make things a bit easier (but less power efficient for the slave), we
+ * make things a bit easier (but less power efficient for the peripheral), we
* use a transmit window of 2. We do this because we dont quite know the
* exact start of the transmission and if we are too early or too late we
* could miss the transmit window. A final note: the actual transmission
* start (the anchor point) is sched offset ticks from the schedule start
* time. We dont add this to the calculation when calculating the window
* offset. The reason we dont do this is we want to insure we transmit
- * after the window offset we tell the slave. For example, say we think
+ * after the window offset we tell the peripheral. For example, say we think
* we are transmitting 1253 usecs from the earliest start. This would cause
* us to send a transmit window offset of 1. Since we are actually
- * transmitting earlier than the slave thinks we could end up transmitting
+ * transmitting earlier than the peripheral thinks we could end up transmitting
* before the window offset. Transmitting later is fine since we have the
- * transmit window to do so. Transmitting before is bad, since the slave
+ * transmit window to do so. Transmitting before is bad, since the peripheral
* wont be listening. We could do better calculation if we wanted to use
* a transmit window of 1 as opposed to 2, but for now we dont care.
*/
@@ -673,8 +673,8 @@ ble_ll_sched_conn_central_new(struct ble_ll_conn_sm *connsm,
/* XXX:
* The calculations for the 32kHz crystal bear alot of explanation. The
- * earliest possible time that the master can start the connection with a
- * slave is 1.25 msecs from the end of the connection request. The
+ * earliest possible time that the central can start the connection with a
+ * peripheral is 1.25 msecs from the end of the connection request. The
* connection request is sent an IFS time from the end of the advertising
* packet that was received plus the time it takes to send the connection
* request. At 1 Mbps, this is 1752 usecs, or 57.41 ticks. Using 57 ticks
@@ -683,32 +683,32 @@ ble_ll_sched_conn_central_new(struct ble_ll_conn_sm *connsm,
* the advertising PDU is 'now' (we call os_cputime_get32). We dont know
* how much time it will take to service the ISR but if we are more than the
* rx to tx time of the chip we will not be successful transmitting the
- * connect request. All this means is that we presume that the slave will
+ * connect request. All this means is that we presume that the peripheral will
* receive the connect request later than we expect but no earlier than
* 13 usecs before (this is important).
*
* The code then attempts to schedule the connection at the
* earliest time although this may not be possible. When the actual
- * schedule start time is determined, the master has to determine if this
+ * schedule start time is determined, the central has to determine if this
* time is more than a transmit window offset interval (1.25 msecs). The
- * master has to tell the slave how many transmit window offsets there are
+ * central has to tell the peripheral how many transmit window offsets there are
* from the earliest possible time to when the actual transmit start will
* occur. Later in this function you will see the calculation. The actual
* transmission start has to occur within the transmit window. The transmit
* window interval is in units of 1.25 msecs and has to be at least 1. To
- * make things a bit easier (but less power efficient for the slave), we
+ * make things a bit easier (but less power efficient for the peripheral), we
* use a transmit window of 2. We do this because we dont quite know the
* exact start of the transmission and if we are too early or too late we
* could miss the transmit window. A final note: the actual transmission
* start (the anchor point) is sched offset ticks from the schedule start
* time. We dont add this to the calculation when calculating the window
* offset. The reason we dont do this is we want to insure we transmit
- * after the window offset we tell the slave. For example, say we think
+ * after the window offset we tell the peripheral. For example, say we think
* we are transmitting 1253 usecs from the earliest start. This would cause
* us to send a transmit window offset of 1. Since we are actually
- * transmitting earlier than the slave thinks we could end up transmitting
+ * transmitting earlier than the peripheral thinks we could end up transmitting
* before the window offset. Transmitting later is fine since we have the
- * transmit window to do so. Transmitting before is bad, since the slave
+ * transmit window to do so. Transmitting before is bad, since the peripheral
* wont be listening. We could do better calculation if we wanted to use
* a transmit window of 1 as opposed to 2, but for now we dont care.
*/
@@ -781,7 +781,7 @@ ble_ll_sched_conn_central_new(struct ble_ll_conn_sm *connsm,
#endif
/**
- * Schedules a slave connection for the first time.
+ * Schedules a peripheral connection for the first time.
*
* Context: Link Layer
*
@@ -801,7 +801,7 @@ ble_ll_sched_conn_periph_new(struct ble_ll_conn_sm *connsm)
/* Set schedule start and end times */
/*
- * XXX: for now, we dont care about anchor point usecs for the slave. It
+ * XXX: for now, we dont care about anchor point usecs for the peripheral. It
* does not matter if we turn on the receiver up to one tick before w
* need to. We also subtract one extra tick since the conversion from
* usecs to ticks could be off by up to 1 tick.
diff --git a/nimble/controller/src/ble_ll_sync.c b/nimble/controller/src/ble_ll_sync.c
index 31e9984..8912cec 100644
--- a/nimble/controller/src/ble_ll_sync.c
+++ b/nimble/controller/src/ble_ll_sync.c
@@ -900,7 +900,7 @@ ble_ll_sync_schedule_chain(struct ble_ll_sync_sm *sm, struct ble_mbuf_hdr *hdr,
return -1;
}
- /* chain should use same PHY as master PDU */
+ /* chain should use same PHY as central PDU */
if (phy != ble_ll_sync_phy_mode_to_aux_phy(sm->phy_mode)) {
return -1;
}