Skip to content

Commit 5126f41

Browse files
Merge pull request #1 from ARMmbed/development
rebase 28.2
2 parents 59a3036 + 7413ebd commit 5126f41

File tree

410 files changed

+3616
-2108
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

410 files changed

+3616
-2108
lines changed

check_tools/config-update.py

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
import sys, os
2+
import re
3+
import subprocess
4+
5+
def split_into_pairs(l):
6+
for i in range(0, len(l), 2):
7+
yield l[i:i + 2]
8+
9+
def main(file):
10+
file_h = open(file, 'r+')
11+
file = file_h.read()
12+
snippet_indices = [m.start() for m in re.finditer('```', file)]
13+
14+
blocks = {}
15+
for i in range(0, int(len(snippet_indices) / 2)):
16+
# Need to rerun on every loop as the indices change each iteration
17+
snippet_indices = [m.start() for m in re.finditer('```', file)]
18+
ranges = list(split_into_pairs(snippet_indices))
19+
start = ranges[i][0]
20+
end = ranges[i][1]
21+
22+
try:
23+
blocks[i] = file[start : end + 3]
24+
if ('Name: ' in blocks[i]):
25+
lib = blocks[i].split('Name: ')[1].split('.')[0]
26+
print("================= %s =================" % lib)
27+
out = str(subprocess.check_output(["mbed", "compile", "--config", "-v", "--prefix", lib]))
28+
file = file[:start+4] + out[:out.index("Macros") - 1] + file[end:]
29+
30+
# Originally added for debugging purposes, catch and display exceptions before
31+
# continuing without exiting to provide a complete list of errors found
32+
except Exception as e:
33+
print("Error")
34+
print(e)
35+
print("____________________")
36+
exc_type, exc_obj, exc_tb = sys.exc_info()
37+
fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
38+
print(exc_type, fname, exc_tb.tb_lineno)
39+
pass
40+
41+
file_h.truncate(0)
42+
file_h.seek(0)
43+
file_h.write(file)
44+
file_h.close()
45+
46+
if __name__ == '__main__':
47+
if (len(sys.argv) < 2):
48+
path = '../docs/reference/configuration'
49+
else:
50+
path = sys.argv[1]
51+
52+
if (path == '-h' or path == '--help'):
53+
print("By default the script runs out of the docs tools directory and iterates through reference/configuration.\n"
54+
"You may pass in a directory path that will run on all files contained within, or a single file path optionally.")
55+
exit(0)
56+
57+
if (os.path.isfile(path)):
58+
main(path)
59+
elif (os.path.isdir(path)):
60+
for doc in os.listdir(path):
61+
if (doc != 'configuration.md'):
62+
print('_____ %s _____' % os.path.join(path, doc))
63+
main(os.path.join(path, doc))
64+
else:
65+
print("Please provide a valid file or directory path")

docs.json

Lines changed: 457 additions & 663 deletions
Large diffs are not rendered by default.

docs/api/api.md

Lines changed: 48 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,36 +8,39 @@
88
<tbody>
99
<tr>
1010
<td><a href="wait.html">Wait</a></td>
11-
<td><a href="rtc.html">RTC</a></td>
12-
<td><a href="shared-pointer.html">Shared pointer</a></td>
13-
<td><a href="mpu-management.html">MPU management</a></td>
11+
<td><a href="time.html">Time</a></td>
12+
<td><a href="noncopyable.html">NonCopyable</a></td>
13+
<td><a href="circularbuffer.html">CircularBuffer</a></td>
1414
</tr>
1515
<tr>
1616
<td><a href="callback.html">Callback</a></td>
17-
<td><a href="debug.html">Debug</a></td>
18-
<td><a href="span.html">Span</a></td>
19-
<td><a href="scopedramexecutionlock.html">ScopedRamExecutionLock</a></td>
17+
<td><a href="rtc.html">RTC</a></td>
18+
<td><a href="shared-pointer.html">Shared pointer</a></td>
19+
<td><a href="atcmdparser.html">ATCmdParser</a></td>
2020
</tr>
2121
<tr>
2222
<td><a href="deepsleeplock.html">DeepSleepLock</a></td>
23-
<td><a href="memory-tracing.html">Memory tracing</a></td>
24-
<td><a href="platformmutex.html">PlatformMutex</a></td>
25-
<td><a href="scopedromwritelock.html">ScopedRomWriteLock</a></td>
23+
<td><a href="debug.html">Debug</a></td>
24+
<td><a href="span.html">Span</a></td>
25+
<td><a href="mbed-statistics.html">Mbed statistics</a></td>
2626
</tr>
2727
<tr>
2828
<td><a href="power-management.html">Power management</a></td>
29-
<td><a href="error-handling.html">Error handling</a></td>
30-
<td><a href="circularbuffer.html">CircularBuffer</a></td>
29+
<td><a href="memory-tracing.html">Memory tracing</a></td>
30+
<td><a href="filehandle.html">FileHandle</a></td>
31+
<td><a href="mpu-management.html">MPU management</a></td>
3132
</tr>
3233
<tr>
3334
<td><a href="idle-loop.html">Idle loop</a></td>
34-
<td><a href="assert.html">Assert</a></td>
35-
<td><a href="atcmdparser.html">ATCmdParser</a></td>
35+
<td><a href="error-handling.html">Error handling</a></td>
36+
<td><a href="poll.html">Poll</a></td>
37+
<td><a href="scopedramexecutionlock.html">ScopedRamExecutionLock</a></td>
3638
</tr>
3739
<tr>
3840
<td><a href="criticalsectionlock.html">CriticalSectionLock</a></td>
39-
<td><a href="noncopyable.html">NonCopyable</a></td>
40-
<td><a href="mbed-statistics.html">Mbed statistics</a></td>
41+
<td><a href="assert.html">Assert</a></td>
42+
<td><a href="platformmutex.html">PlatformMutex</a></td>
43+
<td><a href="scopedromwritelock.html">ScopedRomWriteLock</a></td>
4144
</tr>
4245
</tbody>
4346
</table>
@@ -123,6 +126,30 @@ The [Mbed OS RTOS](rtos.html) capabilities include managing objects such as thre
123126
</tbody>
124127
</table>
125128

129+
### USB APIs
130+
131+
The Mbed OS classes providing USB peripheral functionality, also known as [USB components](../apis/usb.html), inherit from USBDevice and provide specific USB peripherial functionality.
132+
133+
<table>
134+
<tbody>
135+
<tr>
136+
<td><a href="usbserial.html">USBSerial</a></td>
137+
<td><a href="usbcdc.html">USBCDC</a></td>
138+
<td><a href="usbmouse.html">USBMouse</a></td>
139+
</tr>
140+
<tr>
141+
<td><a href="usbaudio.html">USBAudio</a></td>
142+
<td><a href="usbmsd.html">USBMSD</a></td>
143+
<td><a href="usbkeyboard.html">USBKeyboard</a></td>
144+
</tr>
145+
<tr>
146+
<td><a href="usbhid.html">USBHID</a></td>
147+
<td><a href="usbmidi.html">USBMIDI</a></td>
148+
<td><a href="usbmousekeyboard.html">USBMouseKeyboard</a></td>
149+
</tr>
150+
</tbody>
151+
</table>
152+
126153
### Network socket APIs
127154

128155
[Network socket APIs](network-socket.html) include the application programming interface for IP networking. In Mbed OS, this API supports both TCP and UDP protocols.
@@ -132,15 +159,16 @@ The [Mbed OS RTOS](rtos.html) capabilities include managing objects such as thre
132159
<tr>
133160
<td><a href="socket.html">Socket</a></td>
134161
<td><a href="socketaddress.html">SocketAddress</a></td>
135-
<td><a href="dtlssocket.html">DTLSSocket</a></td>
162+
<td><a href="tlssocket.html">TLSSocket</a></td>
136163
</tr>
137164
<tr>
138165
<td><a href="udpsocket.html">UDPSocket</a></td>
139-
<td><a href="dns-resolver.html">DNS Resolver</a></td>
140-
<td><a href="socketstats.html">SocketStats</a></td>
166+
<td><a href="non-ip-cellular-socket.html">Non-IP cellular socket</a></td>
167+
<td><a href="dtlssocket.html">DTLSSocket</a></td>
141168
<tr>
142169
<td><a href="tcpsocket.html">TCPSocket</a></td>
143-
<td><a href="tlssocket.html">TLS Socket</a></td>
170+
<td><a href="dns-resolver.html">DNS resolver</a></td>
171+
<td><a href="socketstats.html">SocketStats</a></td>
144172
</tr>
145173
</tbody>
146174
</table>
@@ -153,7 +181,7 @@ The [Mbed OS RTOS](rtos.html) capabilities include managing objects such as thre
153181
<tbody>
154182
<tr>
155183
<td><a href="ethernet.html">Ethernet</a></td>
156-
<td><a href="mesh-api.html">6LoWPAN Mesh</a></td>
184+
<td><a href="mesh-api.html">Mesh</a></td>
157185
</tr>
158186
<tr>
159187
<td><a href="wi-fi.html">Wi-Fi</a></td>

docs/api/bluetooth/Gap.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,16 @@ You may set preferred PHYs (separately for RX and TX) using `setPreferredPhys()`
5252

5353
You may query the currently used PHY using `readPhy()`, which returns the result through a call to the registered event handler. You may register the handler with `setEventHandler()`. The events inform about the currently used PHY and of any changes to PHYs, which the controller or the peer may trigger autonomously.
5454

55+
#### Data length (over-the-air MTU)
56+
57+
In addition to modulation schemes, Maximum Transmission Unit (MTU) size also strongly affects throughput. Newer controllers allow you to negotiate bigger MTUs. Because each packet contains overhead, bigger packets maximize throughput.
58+
59+
There are two separate MTUs to consider: the `ATT_MTU` (maximum attribute size) and data length. `GattServer` and `GattClient` affect `ATT_MTU`. `Gap` only deals with data length, which is the maximum size of the packet that carries attributes that are fragmented across many such packets.
60+
61+
The default value of data length supported by all controllers is 23 octets. If both controllers support data length extension and a higher value is negotiated, the BLE stack will call `onDataLengthChange` in the `Gap::EventHandler` registered by the user.
62+
63+
`ATT_MTU` and data length are independent of each other.
64+
5565
### GAP class reference
5666

5767
[![View code](https://www.mbed.com/embed/?type=library)](https://os.mbed.com/docs/development/mbed-os-api-doxy/class_gap.html)

docs/api/bluetooth/GattClient.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## GattClient
22

3-
GattClient defines procedures required for interacting with a remote GattServer.
3+
You can use Generic Attribute Profile (GATT) to discover services, characteristics and descriptors and to perform operations on them. The interaction happens between two peers, one of which is the client (which initiates interactions) and the other is the server (which responds). You can use Attribute Protocol (ATT) to implement this interaction. `GattClient` defines procedures required for interacting with a remote `GattServer`.
44

55
#### Discovery procedures
66

@@ -16,6 +16,16 @@ As a result of the discovery process, the client can start interacting with the
1616

1717
Mbed BLE abstracts read and write operations to offer a single API that can be used to read or write characteristic values. The application code does not have to handle the necessary fragmentation or reassembly process if the attribute value to be transported can't fit in a single data packet.
1818

19+
#### Attribute Protocol Maximum Transmission Unit (ATT_MTU)
20+
21+
`ATT_MTU` is the maximum size of the attribute protocol packet. Operation on attributes too large to fit into a single packet are split across multiple operations.
22+
23+
This is independent of the data length, which controls the over-the-air packet payload size (which the GAP handles). An L2CAP packet containing the attribute protocol packet is fragmented over many packets if required.
24+
25+
Only `GattClient` can trigger the exchange of `ATT_MTU` between client and server. Depending on the implementation of the bluetooth stack, the client may trigger the exchange upon connection. You may also manually request the exchange using `negotiateAttMtu`. If an exchange happens, the biggest value possible across both devices will be used. Negotiation is only a best-effort process and does not guarantee a higher value being set.
26+
27+
`ATT_MTU` is at least 23 octets by default. If a larger size is negotiated, the user application will be informed through the `onAttMtuChange` function called in the `GattClient::EventHandler`. (`GattServer::EventHandler` is also informed.)
28+
1929
#### Server initiated events
2030

2131
When a server updates a characteristic value, it can forward the new value to any registered clients. Clients may register for these updates on a per-characteristic basis. The server sends the updates by using notifications (no confirmation from client) or indications (client confirms receipt). This mechanism minimizes the number of transactions between a client and a server by avoiding polling.

docs/api/bluetooth/GattServer.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
## GattServer
22

3-
A GattServer is a collection of GattServices. These services contain characteristics that a peer connected to the device may read or write. These characteristics may also emit updates to subscribed clients when their values change.
3+
You can use Generic Attribute Profile (GATT) to discover services, characteristics and descriptors and to perform operations on them. The interaction happens between two peers, one of which is the client (which initiates interactions) and the other is the server (which responds). You can use Attribute Protocol (ATT) to implement this interaction.
4+
5+
`GattServer` is a collection of GattServices. These services contain characteristics that a `GattClient` on the peer connected to the device may read or write. These characteristics may also emit updates to subscribed clients when their values change.
46

57
#### Server layout
68

@@ -14,6 +16,10 @@ You must access values of the characteristic and the characteristic descriptor p
1416

1517
You can query the server by invoking the function `areUpdatesEnabled()` to find out if a client has subscribed to a given characteristic's value update.
1618

19+
#### Attribute Protocol Maximum Transmission Unit (ATT_MTU)
20+
21+
The Attribute Protocol Maximum Transmission Unit (`ATT_MTU`) is the maximum size of the attribute protocol packet. For details, please see the [GattClient Documentation](../apis/gattclient.html).
22+
1723
#### Events
1824

1925
You can register several event handlers with the GattServer that it will call to notify you of client (remote application connected to the server) and server activities:

docs/api/drivers/AnalogOut.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ Use the AnalogOut interface to set the output voltage of an analog output pin sp
1010

1111
### AnalogOut hello, world
1212

13-
[![View code](https://www.mbed.com/embed/?url=https://os.mbed.com/teams/mbed_example/code/AnalogOut_HelloWorld/)](https://os.mbed.com/teams/mbed_example/code/DigitalIn_HelloWorld/file/9377dcb1cef3/main.cpp)
13+
[![View code](https://www.mbed.com/embed/?url=https://os.mbed.com/teams/mbed_example/code/AnalogOut_HelloWorld/)](https://os.mbed.com/teams/mbed_example/code/AnalogOut_HelloWorld/file/f2c29bab3feb/main.cpp)
1414

1515
### AnalogOut example
1616

1717
Create a sine wave.
1818

19-
[![View code](https://www.mbed.com/embed/?url=https://os.mbed.com/teams/mbed_example/code/AnalogOut_ex_1/)](https://os.mbed.com/teams/mbed_example/code/DigitalIn_ex_1/file/ad8683db322a/main.cpp)
19+
[![View code](https://www.mbed.com/embed/?url=https://os.mbed.com/teams/mbed_example/code/AnalogOut_ex_1/)](https://os.mbed.com/teams/mbed_example/code/AnalogOut_ex_1/file/e758daa05e53/main.cpp)

docs/api/drivers/CAN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ Controller-Area Network (CAN) is a bus standard that allows microcontrollers and
1414

1515
This example sends a counter from one CAN bus (can1) and listens for a packet on the other CAN bus (can2). Each bus controller should be connected to a CAN bus transceiver. These should be connected together at a CAN bus.
1616

17-
[![View code](https://www.mbed.com/embed/?url=https://os.mbed.com/teams/mbed_example/code/CAN_ex_1/)](https://os.mbed.com/teams/mbed_example/code/CAN_ex_1/file/d6cbcdb04ada/main.cpp/)
17+
[![View code](https://www.mbed.com/embed/?url=https://os.mbed.com/teams/mbed_example/code/CAN_ex_1/)](https://os.mbed.com/teams/mbed_example/code/CAN_ex_1/file/d6cbcdb04ada/main.cpp)

docs/api/drivers/I2CSlave.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ Try this example to see how an I2C responder works.
1515
```c++ TODO
1616
#include <mbed.h>
1717

18+
#if !DEVICE_I2CSLAVE
19+
#error [NOT_SUPPORTED] I2C Slave is not supported
20+
#endif
21+
1822
I2CSlave slave(p9, p10);
1923

2024
int main() {

docs/api/networkinterfaces/CellularInterface.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
<h2 id="cellular-api">Cellular</h2>
1+
<h2 id="cellular-api">Cellular API</h2>
22

3-
<span class="images">![](https://os.mbed.com/docs/development/mbed-os-api-doxy/class_cellular_base.png)<span>CellularBase class hierarchy</span></span>
3+
<span class="images">![](https://os.mbed.com/docs/development/mbed-os-api-doxy/class_cellular_interface.png)<span>CellularInterface class hierarchy</span></span>
44

5-
The [CellularBase](https://os.mbed.com/docs/development/mbed-os-api-doxy/_cellular_base_8h_source.html) provides a C++ API for connecting to the internet over a Cellular device.
6-
7-
Arm Mbed OS provides a [reference implementation of CellularBase](https://os.mbed.com/docs/development/mbed-os-api-doxy/_cellular_context_8h_source.html), which has more information.
5+
The [CellularInterface](https://os.mbed.com/docs/development/mbed-os-api-doxy/class_cellular_interface.html) class provides a C++ API for connecting to the internet over a Cellular device.
86

97
##### Getting started
108

@@ -48,15 +46,15 @@ You can use and extend a cellular interface in various different ways. For examp
4846
- The easy cellular connection uses standard 3GPP AT 27.007 AT commands to set up the cellular modem and to register to the network.
4947
- After registration, the driver opens a PPP pipe using LWIP with the cellular modem and connects to the internet. If AT only mode is in use, then modem-specific AT commands are used for socket data control.
5048

51-
### CellularBase class reference
49+
### CellularInterface class reference
5250

53-
[![View code](https://www.mbed.com/embed/?type=library)](https://os.mbed.com/docs/development/mbed-os-api-doxy/class_cellular_base.html)
51+
[![View code](https://www.mbed.com/embed/?type=library)](https://os.mbed.com/docs/development/mbed-os-api-doxy/class_cellular_interface.html)
5452

5553
### Usage
5654

5755
To bring up the network interface:
5856

59-
1. Instantiate an implementation of the CellularBase class.
57+
1. Instantiate an implementation of the CellularInterface class.
6058
1. Call the `connect(pincode, apn)` function with a PIN code for your SIM card and an APN for your network.
6159
1. Once connected, you can use Mbed OS [network sockets](network-socket.html) as usual.
6260

@@ -69,6 +67,6 @@ This example establishes connection with the cellular network using Mbed OS Cell
6967
### Related content
7068

7169
- [Network socket](network-socket.html) API reference overview.
72-
- [Cellular architecture](../reference/cellular.html).
70+
- [Cellular overview](../reference/cellular.html) describes cellular architecture and its usage in more detail.
7371
- [Cellular TCP sockets example](../tutorials/cellular-tcp-sockets.html).
7472
- [Cellular configuration documentation](../reference/configuration-connectivity.html).

docs/api/networkinterfaces/MeshInterface.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<h2 id="mesh-api">6LoWPAN Mesh</h2>
1+
<h2 id="mesh-api">Mesh</h2>
22

33
<span class="images">![](https://os.mbed.com/docs/development/mbed-os-api-doxy/class_mesh_interface.png)<span>MeshInterface class hierarchy</span></span>
44

@@ -41,11 +41,10 @@ See the example application [mbed-os-example-mesh-minimal](https://github.com/AR
4141

4242
### Mesh example
4343

44-
The application below demonstrates a simple light control application, where devices can control the LED status of all devices in the network. You can build the application for the unsecure 6LoWPAN-ND or Thread network.
45-
46-
[![View code](https://www.mbed.com/embed/?url=https://github.com/ARMmbed/mbed-os-example-mesh-minimal)](https://github.com/ARMmbed/mbed-os-example-mesh-minimal/blob/mbed-os-5.10.0/main.cpp)
44+
To learn how to use mesh, please see our [light control tutorial](../tutorials/light-control.html), which demonstrates a light control application, where devices can control the LED status of all devices in the network. You can build the application for the unsecure 6LoWPAN-ND or Thread network.
4745

4846
### Related content
4947

5048
- [Nanostack](../reference/mesh-tech.html#nanostack) technology reference material.
5149
- [6LoWPAN and Thread Mesh configuration documentation](../reference/configuration-mesh.html).
50+
- [Light control tutorial](../tutorials/light-control.html).

0 commit comments

Comments
 (0)