mirror of
https://github.com/sascha-hemi/pycom-documentation.git
synced 2026-03-21 03:04:13 +01:00
GitBook: [master] 56 pages modified
This commit is contained in:
committed by
gitbook-bot
parent
5f16b80d28
commit
ce660025fb
@@ -7,7 +7,7 @@ To get started, read through the Getting Started Guide then feel free to jump st
|
||||
* [Products](products.md)
|
||||
* [Getting Started](gettingstarted/introduction.md)
|
||||
* [Tutorials](tutorials/introduction.md)
|
||||
* [Product Info](datasheets/introduction.md)
|
||||
* [Product Info](product-info/introduction.md)
|
||||
* [API Documentation](firmwareapi/introduction.md)
|
||||
* [Pybytes](pybytes/introduction.md)
|
||||
|
||||
|
||||
50
SUMMARY.md
50
SUMMARY.md
@@ -150,31 +150,31 @@
|
||||
|
||||
## Product Info
|
||||
|
||||
* [Introduction](datasheets/introduction.md)
|
||||
* [Development Modules](datasheets/development/README.md)
|
||||
* [WiPy 2.0](datasheets/development/wipy2.md)
|
||||
* [WiPy 3.0](datasheets/development/wipy3.md)
|
||||
* [LoPy](datasheets/development/lopy.md)
|
||||
* [LoPy 4](datasheets/development/lopy4.md)
|
||||
* [SiPy](datasheets/development/sipy.md)
|
||||
* [GPy](datasheets/development/gpy.md)
|
||||
* [FiPy](datasheets/development/fipy.md)
|
||||
* [OEM Modules](datasheets/oem/README.md)
|
||||
* [W01](datasheets/oem/w01.md)
|
||||
* [L01](datasheets/oem/l01.md)
|
||||
* [L04](datasheets/oem/l04.md)
|
||||
* [G01](datasheets/oem/g01.md)
|
||||
* [L01 OEM Baseboard Reference](datasheets/oem/l01_reference.md)
|
||||
* [Universal OEM Baseboard Reference](datasheets/oem/universal_reference.md)
|
||||
* [Expansion Boards and Shields](datasheets/boards/README.md)
|
||||
* [Expansion Board 3.0](datasheets/boards/expansion3.md)
|
||||
* [Pytrack](datasheets/boards/pytrack.md)
|
||||
* [Pysense](datasheets/boards/pysense.md)
|
||||
* [Pyscan](datasheets/boards/pyscan.md)
|
||||
* [Expansion Board 2.0](datasheets/boards/expansion2.md)
|
||||
* [Deep Sleep Shield](datasheets/boards/deepsleep/README.md)
|
||||
* [Deep Sleep API](datasheets/boards/deepsleep/api.md)
|
||||
* [Notes](datasheets/notes.md)
|
||||
* [Introduction](product-info/introduction.md)
|
||||
* [Development Modules](product-info/development/README.md)
|
||||
* [WiPy 2.0](product-info/development/wipy2.md)
|
||||
* [WiPy 3.0](product-info/development/wipy3.md)
|
||||
* [LoPy](product-info/development/lopy.md)
|
||||
* [LoPy 4](product-info/development/lopy4.md)
|
||||
* [SiPy](product-info/development/sipy.md)
|
||||
* [GPy](product-info/development/gpy.md)
|
||||
* [FiPy](product-info/development/fipy.md)
|
||||
* [OEM Modules](product-info/oem/README.md)
|
||||
* [W01](product-info/oem/w01.md)
|
||||
* [L01](product-info/oem/l01.md)
|
||||
* [L04](product-info/oem/l04.md)
|
||||
* [G01](product-info/oem/g01.md)
|
||||
* [L01 OEM Baseboard Reference](product-info/oem/l01_reference.md)
|
||||
* [Universal OEM Baseboard Reference](product-info/oem/universal_reference.md)
|
||||
* [Expansion Boards and Shields](product-info/boards/README.md)
|
||||
* [Expansion Board 3.0](product-info/boards/expansion3.md)
|
||||
* [Pytrack](product-info/boards/pytrack.md)
|
||||
* [Pysense](product-info/boards/pysense.md)
|
||||
* [Pyscan](product-info/boards/pyscan.md)
|
||||
* [Expansion Board 2.0](product-info/boards/expansion2.md)
|
||||
* [Deep Sleep Shield](product-info/boards/deepsleep/README.md)
|
||||
* [Deep Sleep API](product-info/boards/deepsleep/api.md)
|
||||
* [Notes](product-info/notes.md)
|
||||
|
||||
## Pybytes
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ GAP allows for devices to take various roles but generic flow works with devices
|
||||
|
||||
## Constructors
|
||||
|
||||
#### class network.Bluetooth\(id=0, ...\)
|
||||
### class network.Bluetooth\(id=0, ...\)
|
||||
|
||||
Create a Bluetooth object, and optionally configure it. See init for params of configuration.
|
||||
|
||||
@@ -56,7 +56,7 @@ bluetooth = Bluetooth()
|
||||
|
||||
## Methods
|
||||
|
||||
#### bluetooth.init\(id=0, mode=Bluetooth.BLE, antenna=None\)
|
||||
### bluetooth.init\(id=0, mode=Bluetooth.BLE, antenna=None\)
|
||||
|
||||
* `id` Only one Bluetooth peripheral available so must always be 0
|
||||
* `mode` currently the only supported mode is `Bluetooth.BLE`
|
||||
@@ -72,11 +72,11 @@ bluetooth = Bluetooth()
|
||||
|
||||
Initialises and enables the Bluetooth radio in BLE mode.
|
||||
|
||||
#### bluetooth.deinit\(\)
|
||||
### bluetooth.deinit\(\)
|
||||
|
||||
Disables the Bluetooth radio.
|
||||
|
||||
#### bluetooth.start\_scan\(timeout\)
|
||||
### bluetooth.start\_scan\(timeout\)
|
||||
|
||||
Starts performing a scan listening for BLE devices sending advertisements. This function always returns immediately, the scanning will be performed on the background. The return value is `None`. After starting the scan the function `get_adv()` can be used to retrieve the advertisements messages from the FIFO. The internal FIFO has space to cache 16 advertisements.
|
||||
|
||||
@@ -91,15 +91,15 @@ bluetooth.start_scan(10) # starts scanning and stop after 10 seconds
|
||||
bluetooth.start_scan(-1) # starts scanning indefinitely until bluetooth.stop_scan() is called
|
||||
```
|
||||
|
||||
#### bluetooth.stop\_scan\(\)
|
||||
### bluetooth.stop\_scan\(\)
|
||||
|
||||
Stops an ongoing scanning process. Returns `None`.
|
||||
|
||||
#### bluetooth.isscanning\(\)
|
||||
### bluetooth.isscanning\(\)
|
||||
|
||||
Returns `True` if a Bluetooth scan is in progress. `False` otherwise.
|
||||
|
||||
#### bluetooth.get\_adv\(\)
|
||||
### bluetooth.get\_adv\(\)
|
||||
|
||||
Gets an named tuple with the advertisement data received during the scanning. The tuple has the following structure: `(mac, addr_type, adv_type, rssi, data)`
|
||||
|
||||
@@ -121,11 +121,11 @@ adv = bluetooth.get_adv() #
|
||||
ubinascii.hexlify(adv.mac) # convert hexadecimal to ascii
|
||||
```
|
||||
|
||||
#### bluetooth.get\_advertisements\(\)
|
||||
### bluetooth.get\_advertisements\(\)
|
||||
|
||||
Same as the `get_adv()` method, but this one returns a list with all the advertisements received.
|
||||
|
||||
#### bluetooth.resolve\_adv\_data\(data, data\_type\)
|
||||
### bluetooth.resolve\_adv\_data\(data, data\_type\)
|
||||
|
||||
Parses the advertisement data and returns the requested `data_type` if present. If the data type is not present, the function returns `None`.
|
||||
|
||||
@@ -155,7 +155,7 @@ while bluetooth.isscanning():
|
||||
print(ubinascii.hexlify(mfg_data))
|
||||
```
|
||||
|
||||
#### bluetooth.connect\(mac\_addr\)
|
||||
### bluetooth.connect\(mac\_addr\)
|
||||
|
||||
Opens a BLE connection with the device specified by the `mac_addr` argument. This function blocks until the connection succeeds or fails. If the connections succeeds it returns a object of type `GATTCConnection`.
|
||||
|
||||
@@ -165,7 +165,7 @@ Connections are initiated by the central device. There is a maximum of 4 simulta
|
||||
bluetooth.connect('112233eeddff') # mac address is accepted as a string
|
||||
```
|
||||
|
||||
#### bluetooth.callback\(trigger=None, handler=None, arg=None\)
|
||||
### bluetooth.callback\(trigger=None, handler=None, arg=None\)
|
||||
|
||||
Creates a callback that will be executed when any of the triggers occurs. The arguments are:
|
||||
|
||||
@@ -175,7 +175,7 @@ Creates a callback that will be executed when any of the triggers occurs. The ar
|
||||
|
||||
An example of how this may be used can be seen in the [`bluetooth.events()`](./#bluetooth-events) method.
|
||||
|
||||
#### bluetooth.events\(\)
|
||||
### bluetooth.events\(\)
|
||||
|
||||
Returns a value with bit flags identifying the events that have occurred since the last call. Calling this function clears the events.
|
||||
|
||||
@@ -199,7 +199,7 @@ bluetooth.callback(trigger=Bluetooth.CLIENT_CONNECTED | Bluetooth.CLIENT_DISCONN
|
||||
bluetooth.advertise(True)
|
||||
```
|
||||
|
||||
#### bluetooth.set\_advertisement\(\* , name=None, manufacturer\_data=None, service\_data=None, service\_uuid=None\)
|
||||
### bluetooth.set\_advertisement\(\* , name=None, manufacturer\_data=None, service\_data=None, service\_uuid=None\)
|
||||
|
||||
Configure the data to be sent while advertising. If left with the default of `None` the data won’t be part of the advertisement message.
|
||||
|
||||
@@ -216,11 +216,11 @@ Example:
|
||||
bluetooth.set_advertisement(name="advert", manufacturer_data="lopy_v1")
|
||||
```
|
||||
|
||||
#### bluetooth.advertise\(\[Enable\]\)
|
||||
### bluetooth.advertise\(\[Enable\]\)
|
||||
|
||||
Start or stop sending advertisements. The `set_advertisement()` method must have been called prior to this one.
|
||||
|
||||
#### bluetooth.service\(uuid, \* , isprimary=True, nbr\_chars=1, start=True\)
|
||||
### bluetooth.service\(uuid, \* , isprimary=True, nbr\_chars=1, start=True\)
|
||||
|
||||
Create a new service on the internal GATT server. Returns a object of type `BluetoothServerService`.
|
||||
|
||||
@@ -235,7 +235,7 @@ The arguments are:
|
||||
bluetooth.service('abc123')
|
||||
```
|
||||
|
||||
#### bluetooth.disconnect\_client\(\)
|
||||
### bluetooth.disconnect\_client\(\)
|
||||
|
||||
Closes the BLE connection with the client.
|
||||
|
||||
|
||||
30
products.md
30
products.md
@@ -8,12 +8,12 @@ Below you will find tables of all Pycom products. These tables illustrate the fu
|
||||
|
||||
| Module | WiFi | Bluetooth | LoRa | Sigfox | LTE CAT-M1NB-IoT |
|
||||
| :--- | :--- | :--- | :--- | :--- | :--- |
|
||||
| [ WiPy 3.0](datasheets/development/wipy3.md) | ✔ | ✔ | | | |
|
||||
| [SiPy](datasheets/development/sipy.md) | ✔ | ✔ | | ✔ | |
|
||||
| [GPy](datasheets/development/gpy.md) | ✔ | ✔ | | | ✔ |
|
||||
| [LoPy](datasheets/development/lopy.md) | ✔ | ✔ | ✔ | | |
|
||||
| [LoPy4](datasheets/development/lopy4.md) | ✔ | ✔ | ✔ | ✔ | |
|
||||
| [FiPy](datasheets/development/fipy.md) | ✔ | ✔ | ✔ | ✔ | ✔ |
|
||||
| [ WiPy 3.0](product-info/development/wipy3.md) | ✔ | ✔ | | | |
|
||||
| [SiPy](product-info/development/sipy.md) | ✔ | ✔ | | ✔ | |
|
||||
| [GPy](product-info/development/gpy.md) | ✔ | ✔ | | | ✔ |
|
||||
| [LoPy](product-info/development/lopy.md) | ✔ | ✔ | ✔ | | |
|
||||
| [LoPy4](product-info/development/lopy4.md) | ✔ | ✔ | ✔ | ✔ | |
|
||||
| [FiPy](product-info/development/fipy.md) | ✔ | ✔ | ✔ | ✔ | ✔ |
|
||||
| Antennas | [External WiFi/BT Antenna Kit](https://pycom.io/product/external-wifi-antenna/) | [External WiFi/BT Antenna Kit](https://pycom.io/product/external-wifi-antenna/) | [LoRa & Sigfox Antenna Kit](https://pycom.io/product/lora-antenna-kit/) | [LoRa & Sigfox Antenna Kit](https://pycom.io/product/lora-antenna-kit/) | [LTE-M Antenna Kit](https://pycom.io/product/lte-m-antenna-kit/) |
|
||||
|
||||
## Accessories
|
||||
@@ -22,13 +22,13 @@ Below you will find tables of all Pycom products. These tables illustrate the fu
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="text-align:left">Accessory</th>
|
||||
<th style="text-align:left"><a href="datasheets/boards/expansion3.md">Expansion Board</a>
|
||||
<th style="text-align:left"><a href="product-info/boards/expansion3.md">Expansion Board</a>
|
||||
</th>
|
||||
<th style="text-align:left"><a href="datasheets/boards/pysense.md">Pysense</a>
|
||||
<th style="text-align:left"><a href="product-info/boards/pysense.md">Pysense</a>
|
||||
</th>
|
||||
<th style="text-align:left"><a href="datasheets/boards/pytrack.md">Pytrack</a>
|
||||
<th style="text-align:left"><a href="product-info/boards/pytrack.md">Pytrack</a>
|
||||
</th>
|
||||
<th style="text-align:left"><a href="datasheets/boards/pyscan.md">Pyscan</a>
|
||||
<th style="text-align:left"><a href="product-info/boards/pyscan.md">Pyscan</a>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -101,10 +101,10 @@ Below you will find tables of all Pycom products. These tables illustrate the fu
|
||||
</tbody>
|
||||
</table>## OEM Modules
|
||||
|
||||
| OEM Module | [L01/W01 Reference Board](datasheets/oem/l01_reference.md) | [Universal Reference Board](datasheets/oem/universal_reference.md) |
|
||||
| OEM Module | [L01/W01 Reference Board](product-info/oem/l01_reference.md) | [Universal Reference Board](product-info/oem/universal_reference.md) |
|
||||
| :--- | :--- | :--- |
|
||||
| [W01](datasheets/oem/w01.md) | ✔ | ✔ |
|
||||
| [L01](datasheets/oem/l01.md) | ✔ | ✔ |
|
||||
| [L04](datasheets/oem/l04.md) | | ✔ |
|
||||
| [G01](datasheets/oem/g01.md) | | ✔ |
|
||||
| [W01](product-info/oem/w01.md) | ✔ | ✔ |
|
||||
| [L01](product-info/oem/l01.md) | ✔ | ✔ |
|
||||
| [L04](product-info/oem/l04.md) | | ✔ |
|
||||
| [G01](product-info/oem/g01.md) | | ✔ |
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ All of the included sensors are connected to the Pycom device via the I2C interf
|
||||
|
||||
You can find the datasheet and more info here:
|
||||
|
||||
{% page-ref page="../datasheets/boards/pytrack.md" %}
|
||||
{% page-ref page="../product-info/boards/pytrack.md" %}
|
||||
|
||||
## Pysense
|
||||
|
||||
@@ -46,7 +46,7 @@ All of the included sensors are connected to the Pycom device via the I2C interf
|
||||
|
||||
You can find the datasheet and more info here:
|
||||
|
||||
{% page-ref page="../datasheets/boards/pysense.md" %}
|
||||
{% page-ref page="../product-info/boards/pysense.md" %}
|
||||
|
||||
## Pyscan
|
||||
|
||||
@@ -70,5 +70,5 @@ All of the included sensors are connected to the Pycom device via the I2C interf
|
||||
|
||||
You can find the datasheet and more info here:
|
||||
|
||||
{% page-ref page="../datasheets/boards/pyscan.md" %}
|
||||
{% page-ref page="../product-info/boards/pyscan.md" %}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
At present, basic BLE functionality is available. More features will be implemented in the near future, such as pairing. This page will be updated in line with these features.
|
||||
|
||||
Full info on `bluetooth` can be found within [Bluetooth page](../../firmwareapi/pycom/network/bluetooth/) of the Firmware API Reference.
|
||||
Full info on `bluetooth` can be found within [Bluetooth page]() of the Firmware API Reference.
|
||||
|
||||
## Scan for BLE Devices
|
||||
|
||||
|
||||
Reference in New Issue
Block a user