Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: BLE_ANCS_SDAPI BLE_temperature BLE_HeartRate writable_gatt ... more
Diff: nRF51822n.cpp
- Revision:
- 113:2fb5fde31edc
- Parent:
- 96:f98c65780f4a
- Child:
- 342:dec88052ffee
--- a/nRF51822n.cpp Thu Apr 30 08:34:37 2015 +0100 +++ b/nRF51822n.cpp Thu Apr 30 08:34:38 2015 +0100 @@ -48,13 +48,20 @@ const char *nRF51822n::getVersion(void) { - static char versionString[10]; + static char versionString[32]; static bool versionFetched = false; if (!versionFetched) { ble_version_t version; - if (sd_ble_version_get(&version) == NRF_SUCCESS) { - snprintf(versionString, sizeof(versionString), "%u.%u", version.version_number, version.subversion_number); + if ((sd_ble_version_get(&version) == NRF_SUCCESS) && (version.company_id == 0x0059)) { + switch (version.version_number) { + case 0x07: + snprintf(versionString, sizeof(versionString), "Nordic BLE4.1 fw:%04x", version.subversion_number); + break; + default: + snprintf(versionString, sizeof(versionString), "Nordic (spec unknown) fw:%04x", version.subversion_number); + break; + } versionFetched = true; } else { strncpy(versionString, "unknown", sizeof(versionString));