Implemented a few new callbacks
This commit is contained in:
parent
e698dfb274
commit
ebf7f07789
@ -223,7 +223,11 @@ static void setBLEEnabledCb(bool *enabled, SettingMode_e mode)
|
||||
if(!ble_modem_on(true, true))
|
||||
APP_LOG_ERROR("Failed to start BLE modem with service");
|
||||
else
|
||||
{
|
||||
// We generate and set the pairing passkey
|
||||
ble_service_set_pairing_passkey(random_gen_6_digit());
|
||||
watch_face_set_bluetooth_indicator(&watchFace, BLUETOOTH_STATE_ON);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -265,6 +269,16 @@ static void getBLEDeviceNameCb(const char **dev_name)
|
||||
*dev_name = BLE_DEVICE_NAME;
|
||||
}
|
||||
|
||||
static void getBLEDeviceMACCb(const uint8_t **dev_mac)
|
||||
{
|
||||
*dev_mac = ble_service_get_device_mac_address();
|
||||
}
|
||||
|
||||
static void getBLEDevicePairingKeyCb(const uint32_t *pairing_key)
|
||||
{
|
||||
*pairing_key = ble_service_get_active_pairing_passkey();
|
||||
}
|
||||
|
||||
static void getBatteryVoltageCb(uint16_t *battery_voltage)
|
||||
{
|
||||
*battery_voltage = _battery_stats.battery_voltage;
|
||||
@ -324,6 +338,8 @@ SettingsScreenAPIInterface_t settingsScreenAPIInterface =
|
||||
.setWiFiEnabledSettingsCb = &(setWiFiEnabledCb),
|
||||
.setLanguageSettingsCb = &(setLanguageCb),
|
||||
.getBLEDeviceNameCb = &(getBLEDeviceNameCb),
|
||||
.getBLEDeviceMACCb = &(getBLEDeviceMACCb),
|
||||
.getBLEDevicePairingKeyCb = &(getBLEDevicePairingKeyCb),
|
||||
.getBatteryVoltageCb = &(getBatteryVoltageCb),
|
||||
.getMagnetometerRawDataCb = &(getMagnetometerRawDataCb),
|
||||
.getBMP280DataCb = &(getBMP280DataCb),
|
||||
|
Loading…
Reference in New Issue
Block a user