You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 24, 2019. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+19-18
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Getting started with mbed Client on mbed OS
2
2
3
-
This is the mbed Client Example for mbed OS (we also have one for [Linux](https://github.com/ARMmbed/mbed-client-linux-example)). It demonstrates how to register a device with mbed Device Connector, how to read and write values, and how to deregister. If you're unfamiliar with mbed Device Connector, we recommend you read [the introduction to the data model](https://docs.mbed.com/docs/mbed-device-connector-web-interfaces/en/latest/#the-mbed-device-connector-data-model) first.
3
+
This is the mbed Client example for mbed OS (we also have one for [Linux](https://github.com/ARMmbed/mbed-client-linux-example)). It demonstrates how to register a device with mbed Device Connector, how to read and write values, and how to deregister. If you are unfamiliar with mbed Device Connector, we recommend that you read [the introduction to the data model](https://docs.mbed.com/docs/mbed-device-connector-web-interfaces/en/latest/#the-mbed-device-connector-data-model) first.
4
4
5
5
The application:
6
6
@@ -36,17 +36,17 @@ To build the example application:
1. Go to [mbed Device Connector](https://connector.mbed.com) and log in with your mbed account.
39
-
1. On mbed Device Connector, go to [My Devices>Security credentials](https://connector.mbed.com/#credentials), and get new credentials for your device by clicking the *Get my device security credentials* button.
39
+
1. On mbed Device Connector, go to [My Devices > Security credentials](https://connector.mbed.com/#credentials), and get new credentials for your device by clicking the **Get my device security credentials** button.
40
40
1. Store the credentials as `source/security.h` in this project's directory.
41
41
1. Open a command line tool and navigate to the project’s directory.
42
-
1. Set yotta's build target. For example, if you're targeting the FRDM-K64F board: `yotta target frdm-k64f-gcc`.
42
+
1. Set yotta's build target. For example, if you are targeting the FRDM-K64F board: `yotta target frdm-k64f-gcc`.
43
43
1. Build the application by using the command `yotta build`. yotta builds a binary file in the project’s directory.
44
44
1. Plug the Ethernet cable into the board.
45
-
1. Plug the micro-USB cable into the *OpenSDA* port. The board is listed as a mass-storage device.
45
+
1. Plug the micro-USB cable into the **OpenSDA** port. The board is listed as a mass-storage device.
46
46
1. Drag the binary `build/frdm-k64f-gcc/source/mbed-client-examples.bin` to the board to flash the application.
47
-
1. The board is automatically programmed with the new binary. A flashing LED on it indicates that it is still working. When the LED stops blinking, the board is ready to work..
48
-
1. Press the *RESET* button to run the program.
49
-
1. For verification, continue to [here](#monitoring-the-application).
47
+
1. The board is automatically programmed with the new binary. A flashing LED on it indicates that it is still working. When the LED stops blinking, the board is ready to work.
48
+
1. Press the **RESET** button to run the program.
49
+
1. For verification, continue to the [Monitoring the application](#monitoring-the-application) chapter.
50
50
51
51
### IP address setup (optional)
52
52
@@ -60,17 +60,17 @@ Your device can connect to mbed Device Connector via one of two binding modes: U
60
60
61
61
To change the binding mode:
62
62
63
-
1. In `simpleclient.h`, find the parameter ``SOCKET_MODE``.
64
-
1. The default is ``M2MInterface::UDP``.
65
-
1. To switch to TCP, change it to ``M2MInterface::TCP``.
63
+
1. In the `simpleclient.h` file, find the parameter `SOCKET_MODE`.
64
+
1. The default is `M2MInterface::UDP`.
65
+
1. To switch to TCP, change it to `M2MInterface::TCP`.
66
66
67
67
Then re-build and flash the application.
68
68
69
69
**Tip:** The instructions in this document remain the same, irrespective of the socket mode you select.
70
70
71
71
## Monitoring the application
72
72
73
-
The application prints debug messages over the serial port, so you can monitor its activity with a serial port monitor.The application uses baud rate 115200.
73
+
The application prints debug messages over the serial port, so you can monitor its activity with a serial port monitor.The application uses baud rate 115200.
74
74
75
75
**Note:** Instructions to set this up are located [here](https://developer.mbed.org/handbook/SerialPC#host-interface-and-terminal-applications).
76
76
@@ -81,9 +81,10 @@ In app_start()
81
81
IP address 10.2.15.222
82
82
Device name 6868df22-d353-4150-b90a-a878130859d9
83
83
```
84
+
84
85
**Note:** Device name is the endpoint name you will need later on [Testing the application](https://github.com/ARMmbed/mbed-client-quickstart#testing-the-application) chapter.
85
86
86
-
And after you click the `SW2` button on your board you should see messages about the value changes:
87
+
After you click the `SW2` button on your board you should see messages about the value changes:
87
88
88
89
```
89
90
handle_button_click, new value of counter is 1
@@ -92,14 +93,14 @@ handle_button_click, new value of counter is 1
92
93
## Testing the application
93
94
94
95
1. Flash the application.
95
-
1. Verify that registration succeeded. You should see `Registered object successfully!` printed to the serial port.
96
-
1. On mbed Device Connector, go to [My devices>Connected devices](https://connector.mbed.com/#endpoints). Your device should be listed here.
96
+
1. Verify that the registration succeeded. You should see `Registered object successfully!` printed to the serial port.
97
+
1. On mbed Device Connector, go to [My devices > Connected devices](https://connector.mbed.com/#endpoints). Your device should be listed here.
97
98
1. Press the `SW2` button on the device a number of times (make a note of how many times you did that).
98
-
1. Go to [Device Connector>API Console](https://connector.mbed.com/#console).
99
-
1. Enter `https://api.connector.mbed.com/endpoints/DEVICE_NAME/3200/0/5501` in the URI field and click *TEST API*.
99
+
1. Go to [Device Connector > API Console](https://connector.mbed.com/#console).
100
+
1. Enter `https://api.connector.mbed.com/endpoints/DEVICE_NAME/3200/0/5501` in the URI field and click **TEST API**. Replace `DEVICE_NAME` with your actual endpoint name. The device name can be found in the `source/security.h` file, see variable `MBED_ENDPOINT_NAME` or it can be found from the traces [Monitoring the application](https://github.com/ARMmbed/mbed-client-quickstart#monitoring-the-application).
100
101
1. The number of times you pressed `SW2` is shown.
101
-
1. Press `SW3` button to unregister from mbed Device Connector. You should see `Unregistered Object Successfully` printed to the serial port and LED starts blinking.
102
-
This will also end your application run. Press `RESET` button to run the program again.
102
+
1. Press the `SW3` button to unregister from mbed Device Connector. You should see `Unregistered Object Successfully` printed to the serial port and LED starts blinking.
103
+
This will also stop your application. Press the`RESET` button to run the program again.
103
104
104
105
105
106

0 commit comments