Skip to content

Commit

Permalink
Corrections 28/12
Browse files Browse the repository at this point in the history
- Add lib in requires
- Change name of demo class
- Add captions to remaining figures
- Correct current time images
  • Loading branch information
Abbas Bracken Ziad authored and paul-szczepanek-arm committed Dec 29, 2020
1 parent 95b2fd8 commit 7414fad
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 6 deletions.
10 changes: 9 additions & 1 deletion BLE_GattServer_ExperimentalServices/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Table 1 shows the byte stream required to set the device's current time to Wed,

| B0 | B1 | B2 | B3 | B4 | B5 | B6 | B7 | B8 | B9 |
|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:|
| 0xD9 | 0x07 | 0x0A | 0x13 | 0x0B | 0x23 | 0x25 | 0x03 | 0x00 | 0x00 |
| 0xD9 | 0x07 | 0x0A | 0x1C | 0x0B | 0x23 | 0x25 | 0x03 | 0x00 | 0x00 |

**Table 1. Byte stream required to set the device's current time to Wed, 28 Oct 2009 11:35:37**

Expand Down Expand Up @@ -79,16 +79,24 @@ The illustrations will be different for other clients.

![](img/select_cts.png)

**Fig. 6. Selecting the Current Time Service**

* Press the upward pointing arrow to interact with the current time characteristic (Fig. 7)

![](img/interact_current_time.png)

**Fig. 7. Interacting with the current time characteristic**

* Create a new write value for the byte stream in Table 1, save and load it, and press send (Fig. 8)

![](img/write_current_time.png)

**Fig. 8. Writing the current time characteristic**

* Confirm that the value parameter was updated with the correct date/time after the write (Fig. 9)

![](img/read_current_time.png)

**Fig. 9. Reading the current time characteristic**

* The current time in seconds should appear at your terminal, i.e. "1256729737"
Binary file modified BLE_GattServer_ExperimentalServices/img/read_current_time.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified BLE_GattServer_ExperimentalServices/img/select_lls.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified BLE_GattServer_ExperimentalServices/img/write_alert_level.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified BLE_GattServer_ExperimentalServices/img/write_current_time.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion BLE_GattServer_ExperimentalServices/mbed_app.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"target_overrides": {
"*": {
"platform.stdio-baud-rate": 115200,
"target.requires": ["ble-service-link-loss"]
"target.requires": ["ble-service-link-loss","ble-current-time-service"]
},
"K64F": {
"target.components_add": ["BlueNRG_MS"],
Expand Down
8 changes: 4 additions & 4 deletions BLE_GattServer_ExperimentalServices/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ const static char DEVICE_NAME[] = "ExperimentalServices";
static events::EventQueue event_queue(/* event count */ 10 * EVENTS_EVENT_SIZE);
static ChainableGapEventHandler chainable_gap_event_handler;

class LinkLossDemo : ble::Gap::EventHandler, LinkLossService::EventHandler, CurrentTimeService::EventHandler {
class ExperimentalServicesDemo : ble::Gap::EventHandler, LinkLossService::EventHandler, CurrentTimeService::EventHandler {
public:
LinkLossDemo(BLE &ble, events::EventQueue &event_queue, ChainableGapEventHandler &chainable_gap_event_handler) :
ExperimentalServicesDemo(BLE &ble, events::EventQueue &event_queue, ChainableGapEventHandler &chainable_gap_event_handler) :
_ble(ble),
_event_queue(event_queue),
_chainable_gap_event_handler(chainable_gap_event_handler),
Expand All @@ -42,7 +42,7 @@ class LinkLossDemo : ble::Gap::EventHandler, LinkLossService::EventHandler, Curr

void start()
{
_ble.init(this, &LinkLossDemo::on_init_complete);
_ble.init(this, &ExperimentalServicesDemo::on_init_complete);

_event_queue.dispatch_forever();
}
Expand Down Expand Up @@ -177,7 +177,7 @@ int main()

set_time(1256729737); // Set RTC time to Wed, 28 Oct 2009 11:35:37

LinkLossDemo demo(ble, event_queue, chainable_gap_event_handler);
ExperimentalServicesDemo demo(ble, event_queue, chainable_gap_event_handler);
demo.start();

return 0;
Expand Down

0 comments on commit 7414fad

Please sign in to comment.