- Posts: 1386
API for protocol development
- victzh
- Topic Author
- Offline
The first question is following. For ESky I need to switch to another frequency pair each time the controller is turned on. Do you have a function to find some kind of "controller time" - the number of starts, or function allowing me to store a key-value pair between sessions?
Please Log in or Create an account to join the conversation.
- rbe2012
- Offline
- So much to do, so little time...
- Posts: 1433
Please Log in or Create an account to join the conversation.
- victzh
- Topic Author
- Offline
- Posts: 1386
Please Log in or Create an account to join the conversation.
- rbe2012
- Offline
- So much to do, so little time...
- Posts: 1433
Please Log in or Create an account to join the conversation.
- victzh
- Topic Author
- Offline
- Posts: 1386
Also, do we have random number generator available?
Thanks for helping me.
Please Log in or Create an account to join the conversation.
- rbe2012
- Offline
- So much to do, so little time...
- Posts: 1433
u8 CONFIG_ReadModel(u8 model_num) {
crc32 = 0;
Transmitter.current_model = model_num;
clear_model(1);
...
As far as I know there is no random number generator... Do you need real randomness or only an sufficient randomly looking sequence? In this case you probably can use a predefined list.
Please Log in or Create an account to join the conversation.
- victzh
- Topic Author
- Offline
- Posts: 1386
Please Log in or Create an account to join the conversation.
- SeByDocKy
- Offline
- Posts: 1016
victzh wrote: To make things clear: ESky protocol uses a pair of frequencies during the whole session. It changes the pair at every TX start to reduce the probability of interference. It would be probably better just pick a random pair of frequencies, but for this we need truly random number, or at least some changing variable, like global time, randomized through PNG. Do we have global time or something resembling it? The number of restarts since last firmware reload?
Fix the seed of your RNG
Please Log in or Create an account to join the conversation.
- rbe2012
- Offline
- So much to do, so little time...
- Posts: 1433
We don't have, as far as I know. For Devo12 we could use the RTC.victzh wrote: ...Do we have global time or something resembling it? The number of restarts since last firmware reload?
When I have understood correctly the transmitter calculates two frequencies and gives them to the receiver. Wouldn't it be better to scan for free channels than to randomly select two? They could both be occupied by other rf transmitter...
We could possibly get something like randomness if we use the least significant bits of the A/D-converter. They could change quite often because the board layout does not seem to be optimized for high accuracy.
Please Log in or Create an account to join the conversation.
- vlad_vy
- Offline
- Posts: 3333
Please Log in or Create an account to join the conversation.
- Home
- Forum
- Development
- Protocol Development
- API for protocol development