WARP Project Forums - Wireless Open-Access Research Platform

You are not logged in.

#1 2014-Nov-12 11:43:46

juvebogdan
Member
Registered: 2013-Sep-17
Posts: 76

Opportunistic spectrum access

I'm writting a MAC for opportunistic spectrum access. The boards are going to try to transmit if there is no or little primary network activity. My question is: Does warpmac_carriersense function returns same value regardless of how much capacity of channel is used by primary network?

Last edited by juvebogdan (2014-Nov-12 19:13:22)

Offline

 

#2 2014-Nov-12 19:54:59

murphpo
Administrator
From: Mango Communications
Registered: 2006-Jul-03
Posts: 5159

Re: Opportunistic spectrum access

Does warpmac_carriersense function returns same value regardless of how much capacity of channel is used by primary network?

Yes- this function returns 0 or 1, indiciting only whether the current energy sensed via RSSI exceeds the programmed threshold.

Also, just to make sure- this function is part of the OFDM Reference Design. If you're using WARP v3 hardware, we strongly recommend using the 802.11 Reference Design for any new projects. The 802.11 Ref Design code is much cleaner and easier to extend for custom MAC and PHY experiments.

Offline

 

#3 2014-Nov-13 12:23:36

juvebogdan
Member
Registered: 2013-Sep-17
Posts: 76

Re: Opportunistic spectrum access

I'm trying to program WARP board using SD card because i don't have Jtag. I use to be able to do this but now when i type win-dd --list i get this:

Win32 Available Volume Information
\\.\Volume{556c2cc5-f6c0-11de-b4ef-806e6f6e6963}\
  link to \\?\Device\HarddiskVolume1
  fixed media
  Not mounted

\\.\Volume{6c340846-135b-11e4-9049-002713dbd794}\
  link to \\?\Device\HarddiskVolume6
  removeable media
  Mounted on \\.\f:

\\.\Volume{556c2cc6-f6c0-11de-b4ef-806e6f6e6963}\
  link to \\?\Device\HarddiskVolume2
  fixed media
  Mounted on \\.\c:

\\.\Volume{556c2cc7-f6c0-11de-b4ef-806e6f6e6963}\
  link to \\?\Device\HarddiskVolume3
  fixed media
  Mounted on \\.\d:

\\.\Volume{25f1ab71-f679-11de-b699-806e6f6e6963}\
  link to \\?\Device\CdRom0
  CD-ROM
  Mounted on \\.\e:


NT Block Device Objects
\\?\Device\CdRom0
  size is 2147483647 bytes

Virtual input devices
/dev/zero   (null data)
/dev/random (pseudo-random data)
-           (standard input)

Virtual output devices
-           (standard output)
/dev/null   (discard the data)


SD card is mounted as f:
As you can see something is wrong with NT Block Device Objects. I tried on several computers but with same results. Can you help me with this?

Last edited by juvebogdan (2014-Nov-13 12:24:15)

Offline

 

#4 2014-Nov-14 14:23:56

murphpo
Administrator
From: Mango Communications
Registered: 2006-Jul-03
Posts: 5159

Re: Opportunistic spectrum access

\\.\Volume{6c340846-135b-11e4-9049-002713dbd794}\
  link to \\?\Device\HarddiskVolume6
  removeable media
  Mounted on \\.\f:

Isn't that the descriptor of your SD card (assuming it is mounted as F:)?

Offline

 

#5 2014-Nov-14 15:56:52

juvebogdan
Member
Registered: 2013-Sep-17
Posts: 76

Re: Opportunistic spectrum access

In your guide here that's a device descriptor for the SD card FAT partition. To find a SD card descriptor i should follow next steps.

Offline

 

#6 2014-Nov-14 16:08:55

murphpo
Administrator
From: Mango Communications
Registered: 2006-Jul-03
Posts: 5159

Re: Opportunistic spectrum access

Sorry, you're right; you need the entry under NT Block Device Objects. Are you logged with an admin account? Did you open the command prompt as administrator?

Offline

 

#7 2014-Nov-15 00:58:57

juvebogdan
Member
Registered: 2013-Sep-17
Posts: 76

Re: Opportunistic spectrum access

That worked, thank you

Offline

 

#8 2015-Jan-17 12:43:20

juvebogdan
Member
Registered: 2013-Sep-17
Posts: 76

Re: Opportunistic spectrum access

In CSMA.c sometimes printf is used and sometimes xil_printf. What's the difference? I also have warning implicit function declaration the first time when i use xil_printf?

And one more question: In my code i needed a function that returns 0 or 1 randomly (50% probability) hence stdlib.h and i did it like this

time(srand);

return rand() % 2;

Is this ok? I also have implicit function declaration warning in time(srand).

Offline

 

#9 2015-Jan-19 09:01:58

welsh
Administrator
From: Mango Communications
Registered: 2013-May-15
Posts: 612

Re: Opportunistic spectrum access

Within the C code on the node, you should only be using xil_printf.  The difference between xil_printf and printf is that xil_printf is a light-weight implementation of printf that requires much less code space in order to run.  While there is some functionality tradeoff, xil_printf will work for all the debug / informational printing that needs to be done on the node.  Can you point us to the CSMA.c file where you are seeing this?  Also, xil_printf is part of "stdio.h" on the microblaze so you should not have any warnings if that is part of your includes for the file. 

You can use "rand() % 2" to return 0 or 1 with %50 probability.  However, I don't understand what you are trying to do with "time(srand)".  If you are trying to set the seed for the random number generator, I would use a #define and pass that value to srand().  This way you have control over your seed and can log that value for different experiments.

Offline

 

#10 2015-Jan-19 12:51:50

juvebogdan
Member
Registered: 2013-Sep-17
Posts: 76

Re: Opportunistic spectrum access

Thank you

The reason of implicit function declaration warning with first use of xil_printf is the "stdlib.h" include that i added because of rand(). Is this ok?

Offline

 

#11 2015-Jan-19 14:17:58

welsh
Administrator
From: Mango Communications
Registered: 2013-May-15
Posts: 612

Re: Opportunistic spectrum access

I'm still not sure why you would be getting the warning by including "stdlib.h". 

In general, as long as everything links, it should be ok.  However, it is always good to understand warnings because they can indicate potential issues in your code.

Offline

 

#12 2015-Jan-19 14:29:03

juvebogdan
Member
Registered: 2013-Sep-17
Posts: 76

Re: Opportunistic spectrum access

When i remove stdlib warning goes away

Offline

 

Board footer