finish #19
This commit is contained in:
1 parent
cf2b1e888e
commit
69d541b9eb
9 files changed
+29
-51
No files matched your search
@@ -40,9 +40,7 @@ void setup()
|
||||
|
||||
// Configure and Start Device Information Service
|
||||
bledis.setManufacturer("Adafruit Industries");
|
||||
bledis.setModel("Bluefruit Feather 52");
|
||||
bledis.setHardwareRev("Rev E");
|
||||
bledis.setFirmwareRev(ARDUINO_BSP_VERSION); // ARDUINO_BSP_VERSION is BSP Libraries version
|
||||
bledis.setModel("Bluefruit Feather52");
|
||||
bledis.start();
|
||||
|
||||
/* Start BLE MIDI
|
||||
|
||||
@@ -44,9 +44,7 @@ void setup()
|
||||
|
||||
// Configure and Start Device Information Service
|
||||
bledis.setManufacturer("Adafruit Industries");
|
||||
bledis.setModel("Bluefruit Feather 52");
|
||||
bledis.setHardwareRev("Rev E");
|
||||
bledis.setFirmwareRev(ARDUINO_BSP_VERSION); // ARDUINO_BSP_VERSION is BSP Libraries version
|
||||
bledis.setModel("Bluefruit Feather52");
|
||||
bledis.start();
|
||||
|
||||
// Configure and Start BLE Uart Service
|
||||
|
||||
@@ -63,8 +63,7 @@ void setup()
|
||||
// Configure and Start the Device Information Service
|
||||
Serial.println("Configuring the Device Information Service");
|
||||
bledis.setManufacturer("Adafruit Industries");
|
||||
bledis.setModel("nRF52 Feather");
|
||||
bledis.setFirmwareRev("1.0.0");
|
||||
bledis.setModel("Bluefruit Feather52");
|
||||
bledis.start();
|
||||
|
||||
// Start the BLE Battery Service and set it to 100%
|
||||
|
||||
@@ -30,9 +30,7 @@ void setup()
|
||||
|
||||
// Configure and Start Device Information Service
|
||||
bledis.setManufacturer("Adafruit Industries");
|
||||
bledis.setModel("Bluefruit Feather 52");
|
||||
bledis.setHardwareRev("Rev E");
|
||||
bledis.setFirmwareRev(ARDUINO_BSP_VERSION); // ARDUINO_BSP_VERSION is BSP Libraries version
|
||||
bledis.setModel("Bluefruit Feather52");
|
||||
bledis.start();
|
||||
|
||||
// Configure and Start BLE Uart Service
|
||||
|
||||
@@ -35,9 +35,7 @@ void setup()
|
||||
|
||||
// Configure and Start Device Information Service
|
||||
bledis.setManufacturer("Adafruit Industries");
|
||||
bledis.setModel("Bluefruit Feather 52");
|
||||
bledis.setHardwareRev("Rev E");
|
||||
bledis.setFirmwareRev(ARDUINO_BSP_VERSION); // ARDUINO_BSP_VERSION is BSP Libraries version
|
||||
bledis.setModel("Bluefruit Feather52");
|
||||
bledis.start();
|
||||
|
||||
// Configure and Start BLE Uart Service
|
||||
|
||||
@@ -47,9 +47,7 @@ void setup(void)
|
||||
|
||||
// Configure and Start Device Information Service
|
||||
bledis.setManufacturer("Adafruit Industries");
|
||||
bledis.setModel("Bluefruit Feather 52");
|
||||
bledis.setHardwareRev("Rev E");
|
||||
bledis.setFirmwareRev(ARDUINO_BSP_VERSION); // ARDUINO_BSP_VERSION is BSP Libraries version
|
||||
bledis.setModel("Bluefruit Feather52");
|
||||
bledis.start();
|
||||
|
||||
// Configure and Start BLE Uart Service
|
||||
|
||||
@@ -683,12 +683,16 @@ bool AdafruitBluefruit::_loadBondKeys(uint16_t ediv)
|
||||
char filename[BOND_FILENAME_LEN];
|
||||
sprintf(filename, BOND_FILENAME, ediv);
|
||||
|
||||
return Nffs.readFile(filename, &_bond_data, sizeof(_bond_data)) > 0;
|
||||
bool result = Nffs.readFile(filename, &_bond_data, sizeof(_bond_data)) > 0;
|
||||
|
||||
if ( result ) {
|
||||
LOG_LV1(BOND, "Load Keys from %s", filename);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void AdafruitBluefruit::_loadBondedCCCD(uint16_t ediv)
|
||||
{
|
||||
bool loaded = false;
|
||||
@@ -710,6 +714,8 @@ void AdafruitBluefruit::_loadBondedCCCD(uint16_t ediv)
|
||||
if (ERROR_NONE == sd_ble_gatts_sys_attr_set(_conn_hdl, sys_attr, len, SVC_CONTEXT_FLAG) )
|
||||
{
|
||||
loaded = true;
|
||||
|
||||
LOG_LV1(BOND, "Load CCCD from %s", filename);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -36,26 +36,19 @@
|
||||
|
||||
#include "bluefruit.h"
|
||||
|
||||
BLEDis::BLEDis(void) : BLEService(UUID16_SVC_DEVICE_INFORMATION)
|
||||
{
|
||||
_model = NULL;
|
||||
_serial = NULL;
|
||||
_firmware_rev = NULL;
|
||||
_hardware_rev = NULL;
|
||||
_software_rev = NULL;
|
||||
_manufacturer = NULL;
|
||||
}
|
||||
static char bledis_serial_str[16+1];
|
||||
static char bledis_fw_str[16+1];
|
||||
|
||||
BLEDis::BLEDis(const char * model, const char * serial, const char * firmware_rev,
|
||||
const char * hardware_rev, const char * software_rev, const char * manufacturer)
|
||||
|
||||
BLEDis::BLEDis(void)
|
||||
: BLEService(UUID16_SVC_DEVICE_INFORMATION)
|
||||
{
|
||||
_model = model;
|
||||
_serial = serial;
|
||||
_firmware_rev = firmware_rev;
|
||||
_hardware_rev = hardware_rev;
|
||||
_software_rev = software_rev;
|
||||
_manufacturer = manufacturer;
|
||||
_model = "Bluefruit Feather52";
|
||||
_serial = bledis_serial_str;
|
||||
_firmware_rev = bledis_fw_str;
|
||||
_hardware_rev = NULL;
|
||||
_software_rev = ARDUINO_BSP_VERSION;
|
||||
_manufacturer = "Adafruit Industries";
|
||||
}
|
||||
|
||||
void BLEDis::setModel(const char* model)
|
||||
@@ -63,16 +56,6 @@ void BLEDis::setModel(const char* model)
|
||||
_model = model;
|
||||
}
|
||||
|
||||
void BLEDis::setSerial(const char* serial)
|
||||
{
|
||||
_serial = serial;
|
||||
}
|
||||
|
||||
void BLEDis::setFirmwareRev(const char* fw_rev)
|
||||
{
|
||||
_firmware_rev = fw_rev;
|
||||
}
|
||||
|
||||
void BLEDis::setHardwareRev(const char* hw_rev)
|
||||
{
|
||||
_hardware_rev = hw_rev;
|
||||
@@ -92,6 +75,10 @@ err_t BLEDis::start(void)
|
||||
{
|
||||
VERIFY_STATUS( this->addToGatt() );
|
||||
|
||||
sprintf(bledis_serial_str, "%08lX%08lX", NRF_FICR->DEVICEID[1], NRF_FICR->DEVICEID[0]);
|
||||
sprintf(bledis_fw_str, "%d.%d.%d,S132,2.0.1",
|
||||
U32_BYTE2(bootloaderVersion), U32_BYTE3(bootloaderVersion), U32_BYTE4(bootloaderVersion));
|
||||
|
||||
for(uint8_t i=0; i<arrcount(_strarr); i++)
|
||||
{
|
||||
if ( _strarr[i] != NULL )
|
||||
|
||||
@@ -59,12 +59,8 @@ class BLEDis : public BLEService
|
||||
|
||||
public:
|
||||
BLEDis(void);
|
||||
BLEDis(const char * model, const char * serial, const char * firmware_rev,
|
||||
const char * hardware_rev, const char * software_rev, const char * manufacturer);
|
||||
|
||||
void setModel(const char* model);
|
||||
void setSerial(const char* serial);
|
||||
void setFirmwareRev(const char* fw_rev);
|
||||
void setHardwareRev(const char* hw_rev);
|
||||
void setSoftwareRev(const char* sw_rev);
|
||||
void setManufacturer(const char* manufacturer);
|
||||
|
||||
Reference in new issue
Block a user