Skip to content

Commit

Permalink
Add documentation for CRTP link services
Browse files Browse the repository at this point in the history
  • Loading branch information
ataffanel committed Feb 16, 2022
1 parent b4178e9 commit b9013b5
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 3 deletions.
37 changes: 37 additions & 0 deletions docs/functional-areas/crtp/crtp_link.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: Link layer services
page_id: crtp_link
---

This ports handle various link-related low level services. It most notably host the *null packet* used by the radio
link to pull downlink packets.

## CRTP channels

| port | channel | Function |
|------|---------|----------|
| 13 | 0 | [Echo](#platform-commands) |
| 13 | 1 | [Source](#platform-commands) |
| 13 | 2 | [Sink](#app-channel) |
| 13 | 3 | [*Null packets*](#null-packet) |

## Echo

Packets sent to the Echo channel are send back unaltered.

## Source

When receiving any packet on the source channel, the Crazyflie sends back a 32 bytes packet on the source channel.

Since protocol version 1, this packet contains the string "Bitcraze Crazyflie" followed by zeros. Before version 1 the
content of the packet was not defined. This allows to detect firmware protocol version bellow 1 (the getProtocolVersion
packet was only implemented after version 1 of the protocol).

## Sink

Packet sent to the sink channel are dropped and ignored.

## Null packet

Null packets must be dropped. The data part of NULL packet is used for some out-of-band communication at the link
level or by the bootloader. The Crazyflie firmware and lib should ignore them.
4 changes: 2 additions & 2 deletions docs/functional-areas/crtp/crtp_platform.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Answer:
| 1 | Version |

Returns the CRTP protocol version. See the
[protocl versioning and stability guarantee](../#protocol-version-and-stability-guarantee) documentation for more
[protocl versioning and stability guarantee](index.md#protocol-version-and-stability-guarantee) documentation for more
information.

### Get firmware version
Expand Down Expand Up @@ -114,4 +114,4 @@ Returns a String representation of the device type the firmware is running on. T

The app channel is intended to be used by user apps on the Crazyflie and on the ground to exchange data. Every packet
sent and received from the app channel (port:channel) (13:2) will be available through the
[app channel API](/docs/userguides/app_layer/#app-channel-packet-based-communication-between-the-crazyflie-and-the-python-lib).
[app channel API](/docs/userguides/app_layer.md#app-channel-packet-based-communication-between-the-crazyflie-and-the-python-lib).
2 changes: 1 addition & 1 deletion docs/functional-areas/crtp/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ its handling on the ground.
| 7 | [Generic Setpoint](crtp_generic_setpoint.md) | Generic instantaneous setpoints (ie. position control and more) |
| 13 | [Platform](crtp_platform.md) | Used for misc platform control, like debugging and power off |
| 14 | Client-side debugging | Debugging the UI and exists only in the Crazyflie Python API and not in the Crazyflie itself.|
| 15 | Link layer | Low level link-related service. For example *echo* to ping the Crazyflie |
| 15 | [Link layer](crtp_link.md) | Low level link-related service. For example *echo* to ping the Crazyflie |

Connection procedure
--------------------
Expand Down

0 comments on commit b9013b5

Please sign in to comment.