-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
title: Peer to Peer API | ||
page_id: p2p_api | ||
--- | ||
|
||
## Introduction | ||
Currently peer to peer communication on the crazyflie is **in development**. Now an API is made available to send P2P | ||
messages in broadcast mode, and we are going to extend this to unicast. | ||
|
||
## Peer to Peer broadcast | ||
#### Sending P2P broadcast | ||
|
||
|
||
From the STM, a packet can be sent by the following function | ||
|
||
radiolinkSendP2PPacketBroadcast() | ||
|
||
which exists in *src/hal/interface/radiolink.h*. Make sure that the packet port is | ||
0x00 for now and that the packet data length does not exceed **60** entries. | ||
#### Receiving P2P broadcast | ||
|
||
If you want to receive packet in your function, you can register a callback with: | ||
|
||
p2pRegisterCB(p2pcallbackHandler); | ||
|
||
|
||
with a function of the form of: | ||
|
||
void p2pcallbackHandler(P2PPacket *p) | ||
{ | ||
... | ||
|
||
} | ||
|