rem0te
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| rem0te [2011/12/21 18:26] – [Bridge] schneider | rem0te [2012/01/07 19:59] (current) – [Bridge] rene-dev | ||
|---|---|---|---|
| Line 41: | Line 41: | ||
| ====== Bridge ====== | ====== Bridge ====== | ||
| The firmware for the bridge is located in the file firmware/ | The firmware for the bridge is located in the file firmware/ | ||
| - | |||
| - | To build it you have to edit firmware/ | ||
| - | - deactivate CFG_USBMSC | ||
| - | - activate CFG_USBCDC | ||
| Then run: | Then run: | ||
| < | < | ||
| cd firmware | cd firmware | ||
| - | make APP=bridge | + | make clean |
| + | make APP=bridge | ||
| </ | </ | ||
| Line 121: | Line 118: | ||
| - the addition and removal of players | - the addition and removal of players | ||
| - new packets sent by players. This includes joins, nicknames and the state of the button | - new packets sent by players. This includes joins, nicknames and the state of the button | ||
| + | |||
| + | ===== Writing own libraries ===== | ||
| + | |||
| + | Have a look at the top of l0dables/ | ||
| + | |||
| + | To host a game do the following: | ||
| + | |||
| + | 1) Select a random 16bit GameID, select a random 5 Byte GameMAC, set a global ctr variable to 0, select the channel you want your game to run on | ||
| + | |||
| + | 2) Every second set the bridge channel and TX mac to the values recommended above and send an announce packet with the following content: | ||
| + | - len = 32 | ||
| + | - protocol = ' | ||
| + | - command = ' | ||
| + | - id = 0 | ||
| + | - ctr++ | ||
| + | - gameMAC | ||
| + | - gameChannel | ||
| + | - gameID | ||
| + | - gameFlags: | ||
| + | - 1 : Mass game. The players do not need to join the game | ||
| + | - 2 : Short packet. The players will only send 16 Byte responses. (EXPERIMENTAL) | ||
| + | - 4 : Long Recv: The players will have their radio for a longer time in receive mode | ||
| + | - interval: The interval in 5ms at which the button should be sampled by the l0dable and sent. | ||
| + | - jitter: The amount of randomisation on top of the the interval | ||
| + | - gameTitle: 8 Bytes with the name of the game | ||
| + | Now set the bridge back to receive on the gameChannel | ||
| + | |||
| + | 3) When a player sends a Join packet it will contain: | ||
| + | - len = 32 | ||
| + | - protocol = ' | ||
| + | - command = ' | ||
| + | - id = the player id | ||
| + | - ctr = the player ctr++ | ||
| + | - gameId = your gameId | ||
| + | Now send the following packet: | ||
| + | - len = 32 | ||
| + | - protocol = ' | ||
| + | - command = ' | ||
| + | - id = player id | ||
| + | - ctr = ctr of join packet | ||
| + | - flags = 1 if the join was OK, 0 if the join has failed | ||
| + | As destination MAC use the gameMac with the last byte incremented by 1. | ||
| + | 4) The player will start to send: | ||
| + | - len = 32 | ||
| + | - protocol = ' | ||
| + | - command = ' | ||
| + | - id = player id | ||
| + | - ctr = player ctr++ | ||
| + | - button = state of the button | ||
rem0te.1324488400.txt.gz · Last modified: by schneider
