Skip to content

Commit

Permalink
#488 started doc about p2p API
Browse files Browse the repository at this point in the history
  • Loading branch information
knmcguire committed Oct 21, 2019
1 parent ba5c269 commit bca6b00
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/_data/menu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
- {page_id: sensor_to_control}
- {page_id: ctrp_index}
- {page_id: deck_memory_format}
- {page_id: p2p_api}
- title: Development Instructions
subs:
- {page_id: starting_development}
Expand Down
34 changes: 34 additions & 0 deletions docs/p2p_api.md
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)
{
...

}

0 comments on commit bca6b00

Please sign in to comment.