The Sora SDK is written entirely in C and Assembler. EXE code can be written and compiled in Visual Studio Express, available for free off http://www.microsoft.com/express/Downloads/. Other code needs to be built using the Windows Driver Kits Chkbuild and Freebuild utilities.
Take note that in order to get full usage of Visual Studio Express, you must request a registration key from Microsoft.
As of 05/19/10, wireless 802.11b SoftWifi sample code was released by Microsoft. This code is available at:
http://research.microsoft.com/en-us/downloads/fe7833ba-afaf-4d3c-b966-ac211a387d2b/default.aspx and is further explained in the SoftWifi article.
It should be noted that Sora requires the WDK (Windows Driver Kit) framework as well as the Sora SDK, available at: http://www.microsoft.com/whdc/devtools/WDK/default.mspx.
Certain library and header files that Sora requires to build are within this framework, notably ntddk.h and wdm.h/wdm.lib, as well as various others.As mentioned before, the build utilities are also included within the WDK.
IN ORDER TO WORK WITH THE SORA SDK HEADERS IN VISUAL STUDIO, YOU MUST BE SURE TO INCLUDE ALL RELATED WDK AND SORA LIBRARIES AND HEADERS.
Here's how to do this in Visual Studio 2008:
Project-> HelloSora Properties-> Configuration Properties-> Linker-> General
- Add "C:\Program Files\Microsoft Research Asia\SoraSDK\lib\free" and "C:\WinDDK\7600.16385.1\lib\wxp\i386" (or whichever directories are appropriate) to Additional Library Directories.
Project-> HelloSora Properties-> Configuration Properties-> Linker-> Input
- Add "ksora.lib" and "wdm.lib" to Additional Dependancies.
Project-> HelloSora Properties-> Configuration Properties-> C/C++ -> General
- Add "C:\Program Files\Microsoft Research Asia\SoraSDK\inc" and C:\WinDDK\7600.16385.1\inc" (or whichever directories are appropriate) to Additional Include Directories.
After this, you should be free to code away.
How It WorksEdit
Sora.h is the main header file, which calls all other Sora-related headers (.h) included in the SDK. The library (.lib) files basically tell the overall program how to use these headers.
The most notable are as follows:
|_radio_manager.h||Required for allocation of radios, transmission.|
|packet_base.h||Code for packet support, used with transmission|
|_hw_op.h||Code for hardware related occurences (RAM use, LEDs, clocks). Used with receiving.|
|_core_thread.h||Code for real-time support.|
|_phy_frame_cache.h||Code for the frame sample cache, used for quicker transmission through a cache of frames instead of full packets.|
|_fsm.h||Code for Finite State Machines. 802.11, for example, has three states: Tx, Rx, and Carrier Sense.|
|_phy.h||Used for reception, to set and read scan points.|
|_WARP_Control.h||Used with WARP front-ends.|
|_WARP_Regs.h||Used with WARP front-ends.|
|soradsp.h||Used with XMM registers that hold the raw I/Q samples.|
With this code called and all libraries properly referenced, programming involving these functions can begin, though Sora consists of many more. It should be noted that most of these other headers have interdependancies, in that Sora's _phy_frame_cache.h, sora.h, and packet_base.h all have functions that call _hw.op.h.
An Important Note: StructuresEdit
Due to Sora's code mainly consisting of the C programming language, a lot of Sora's code is implemented within structures.
For example, the radio itself is considered a structure, _SORA_RADIO.
Packets are also considered to be a structure, PACKET_BASE, with five possible statuses of communication (this takes place within the packet_base.h header):
- PACKET_NOT_MOD (after the function SoraPacketGetTxResource is called)
- PACKET_CAN_TX (after the function SORA_HW_TX_TRANSFER is called, found in _hw_op.h)
- PACKET_TF_FAIL (if the packet transfer to the RCB's onboard RAM fails due to not enough resources allocated - this is possibly due to SoraPacketGetTxResource and SoraPacketFreeTxResource)
- PACKET_TX_PEND (The packet has been transmitted, but delivery has not been confirmed - this could be potentially useful for cases of ACK acknowledgements, required for 802.11 transmissions)
- PACKET_TX_DONE (The packet is believed to have successfully transmitted, but no confirmation is neccesary. This is run by SoraPacketSetTxDone, a function called by another function, SORA_HW_BEGIN_TX, which is again found in _hw_op.h)
Sora's code seems to largely revolve around such results and statuses, often using S_OK as a result of a given function, and if another function receives that the prior was S_OK, it runs.
This is, of course, a very light look into Sora's core code; a more in-depth look involves HResults in a far more drawn out sense (These are all defined in the _const.h header), as well as a much deeper analysis of structure-based (object oriented) code and kernel mode versus user mode programming.