Currently, I am intending to record the cca and sfd value using a timer.
Due to the high frequency sampling rate (5ms/ sample), the output of the
printf would flush themselves like follows:
[26804][26820]cca:1, sfd:0.
[26823][26831]cca:1, sfd:0.
[26834]cca:1, sfd:0.
[26841]cca:1, [26847]cca:0, sfd:0.
[26853][26868]cca:0, sfd:1.
[26876][26895]cca:1, sfd:0.
[26898][26914]cca:1, sfd:0.
[26917]cca:1, sfd:0.
[26924]cca:1, [26928]cca:1, sfd:0.
[26934][26938]cca:1, sfd:0.
[26946][26965]cca:1, sfd:0.
[26968][26985]cca:1, sfd:0.
[26988][26994]cca:1, sfd:0.
[26998][27014]cca:1, sfd:0.
[27020]cca:1, sfd:0.
[27027]cca:1, [27036]cca:1, sfd:0.
[27040][27055]cca:1, sfd:0.
[27058][27074]cca:0, sfd:0.
[27077][27084]cca:0, sfd:0.
[27087]cca:0, sfd:0.
[27097]cca:1, [27100]cca:1, sfd:0.
[27107][27116]cca:1, sfd:0.
[27119][27135]cca:1, sfd:0.
However, the correct format of output data should be "[time]cca:x, sfd:x".
like follows:
[269842]cca:0, sfd:0.
[269859]cca:1, sfd:0.
[269872]cca:1, sfd:0.
[269887]cca:0, sfd:1.
[269905]cca:0, sfd:0.
[269918]cca:0, sfd:0.
[269932]cca:1, sfd:0.
[269947]cca:0, sfd:0.
[269962]cca:0, sfd:0.
[269977]cca:0, sfd:0.
[269992]cca:1, sfd:0.
[270007]cca:0, sfd:0.
[270024]cca:0, sfd:0.
[270038]cca:1, sfd:0.
[270053]cca:0, sfd:0.
[270067]cca:0, sfd:0.
[270082]cca:1, sfd:0.
So how to achieve the high rate sampling and recording with intended data
format? My code is based on the TestNetworkLplC.nc, and I just add the
periodic sampling timer as follows.
event void WhiteSpaceTimer.fired(){
uint32_t cur = call Timer.getNow();
printf("[%ld]cca:%d, sfd:%d.\n", cur, call CCA.get(), call SFD.get());
}
The WhiteSpaceTimer is set to 5ms. and the packet send interval and wakeup
interval both are 60ms.
Is there any approach can achieve my purpose ? Thanks!
--
View this message in context:
http://tinyos-help.10906.n7.nabble.com/how-to-printf-the-sample-data-with-a-high-sampling-rate-tp25034.html
Sent from the TinyOS - Help mailing list archive at Nabble.com.
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help