Skip to content

Commit 8de604d

Browse files
committed
Rename ConnectionParams_t -> PreferredConnectionParams_t
For actual connections, full ConnectionParameters is used. But as per BLE specification, Generic Access Service can display preferred connection parameters which is a smaller subset and ConnectionParams_t matches exactly. Thus we rename/repurpose it to PreferredConnectionParams_t.
1 parent 76b92b8 commit 8de604d

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

features/FEATURE_BLE/ble/gap/Gap.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ class Gap : public StaticInterface<Impl, Gap> {
548548
};
549549

550550
/**
551-
* Parameters of a BLE connection.
551+
* Preferred connection parameter display in Generic Access Service.
552552
*/
553553
typedef struct {
554554
/**
@@ -592,7 +592,7 @@ class Gap : public StaticInterface<Impl, Gap> {
592592
* @note maxConnectionInterval is in ms in the formulae above.
593593
*/
594594
uint16_t connectionSupervisionTimeout;
595-
} ConnectionParams_t;
595+
} PreferredConnectionParams_t;
596596

597597
/**
598598
* Assign the event handler implementation that will be used by the gap

features/FEATURE_BLE/ble/generic/GenericGap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class GenericGap :
7575
using Gap::default_central_privacy_configuration;
7676

7777
typedef typename ble::whitelist_t whitelist_t;
78-
typedef typename Gap::ConnectionParams_t ConnectionParams_t;
78+
typedef typename Gap::PreferredConnectionParams_t PreferredConnectionParams_t;
7979

8080
// Imports from Gap
8181
#if BLE_ROLE_BROADCASTER

features/FEATURE_BLE/ble/pal/GenericAccessService.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ struct GenericAccessService {
5757
* Parameters Characteristic
5858
*/
5959
virtual ble_error_t get_peripheral_preferred_connection_parameters(
60-
::Gap::ConnectionParams_t& parameters
60+
::Gap::PreferredConnectionParams_t& parameters
6161
) = 0;
6262

6363
/**
@@ -74,7 +74,7 @@ struct GenericAccessService {
7474
* Parameters Characteristic
7575
*/
7676
virtual ble_error_t set_peripheral_preferred_connection_parameters(
77-
const ::Gap::ConnectionParams_t& parameters
77+
const ::Gap::PreferredConnectionParams_t& parameters
7878
) = 0;
7979

8080
private:

features/FEATURE_BLE/source/generic/GenericGap.tpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ static bool is_in_range(T value, T lower_bound, T higher_bound)
7373
* timeout to be equal to 0xFFFF. When it is the case that value can be
7474
* interpreted as "non specific".
7575
*/
76-
static bool is_preferred_connection_params_valid(const ::Gap::ConnectionParams_t *params)
76+
static bool is_preferred_connection_params_valid(const ::Gap::PreferredConnectionParams_t *params)
7777
{
7878
if (params == NULL) {
7979
return false;

features/FEATURE_BLE/targets/TARGET_CORDIO/CordioGattServer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,12 @@ class GattServer : public ::ble::interface::GattServer<GattServer>,
142142
/**
143143
* @see ::GattServer::getPreferredConnectionParams
144144
*/
145-
::Gap::ConnectionParams_t getPreferredConnectionParams();
145+
::Gap::PreferredConnectionParams_t getPreferredConnectionParams();
146146

147147
/**
148148
* @see ::GattServer::setPreferredConnectionParams
149149
*/
150-
void setPreferredConnectionParams(const ::Gap::ConnectionParams_t& params);
150+
void setPreferredConnectionParams(const ::Gap::PreferredConnectionParams_t& params);
151151

152152
#if 0 // Disabled until reworked and reintroduced to GattServer API
153153
/**

features/FEATURE_BLE/targets/TARGET_CORDIO/CordioPalGenericAccessService.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class GenericAccessService : public ::ble::pal::GenericAccessService {
8787
#endif // Disabled until reworked and reintroduced to GattServer API
8888

8989
virtual ble_error_t get_peripheral_preferred_connection_parameters(
90-
::Gap::ConnectionParams_t& parameters
90+
::Gap::PreferredConnectionParams_t& parameters
9191
) {
9292
#if BLE_FEATURE_GATT_SERVER
9393
parameters = gatt_server().getPreferredConnectionParams();
@@ -98,7 +98,7 @@ class GenericAccessService : public ::ble::pal::GenericAccessService {
9898
}
9999

100100
virtual ble_error_t set_peripheral_preferred_connection_parameters(
101-
const ::Gap::ConnectionParams_t& parameters
101+
const ::Gap::PreferredConnectionParams_t& parameters
102102
) {
103103
#if BLE_FEATURE_GATT_SERVER
104104
gatt_server().setPreferredConnectionParams(parameters);

features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioGattServer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -800,17 +800,17 @@ bool GattServer::isOnDataReadAvailable_() const
800800
return true;
801801
}
802802

803-
::Gap::ConnectionParams_t GattServer::getPreferredConnectionParams()
803+
::Gap::PreferredConnectionParams_t GattServer::getPreferredConnectionParams()
804804
{
805-
::Gap::ConnectionParams_t params = { 0 };
805+
::Gap::PreferredConnectionParams_t params = { 0 };
806806
memcpy(&params.minConnectionInterval, generic_access_service.ppcp, 2);
807807
memcpy(&params.maxConnectionInterval, generic_access_service.ppcp + 2, 2);
808808
memcpy(&params.slaveLatency, generic_access_service.ppcp + 4, 2);
809809
memcpy(&params.connectionSupervisionTimeout, generic_access_service.ppcp + 6, 2);
810810
return params;
811811
}
812812

813-
void GattServer::setPreferredConnectionParams(const ::Gap::ConnectionParams_t& params)
813+
void GattServer::setPreferredConnectionParams(const ::Gap::PreferredConnectionParams_t& params)
814814
{
815815
memcpy(generic_access_service.ppcp, &params.minConnectionInterval, 2);
816816
memcpy(generic_access_service.ppcp + 2, &params.maxConnectionInterval, 2);

0 commit comments

Comments
 (0)