Booting Up the Hardware
The GA1000 and WA2000 are booted by calling the wln.boot method. Below, we detail some of the differences in how this is done on the GA1000 and on the WA2000.
The WM2000 and WS1102 feature support for the the wln.autoconnect property, which vastly simplifies Wi-Fi configuration and communications. If wln.autoconnect is enabled, invoking wln.boot will return REJECTED.
GA1000
The GA1000 does not have ROM or flash memory and its internal processor executes the firmware out of its RAM. Before the GA1000 can start working, you need to upload its firmware into the module, and this is what wln.boot really does.
The firmware file is called "ga1000fw.bin" (the file can be downloaded from Tibbo's website). The file must be added to your Tibbo BASIC/C project as a binary resource file.
Access to resource files is through the romfile. object. First, you open the "ga1000fw.bin" file with the romfile.open method, then pass the pointer to this file (the value of the romfile.offset read-only property) to the wln.boot method:
'boot it up
romfile.open("ga1000fw.bin")
If wln.boot(romfile.offset) Then
'something is wrong, react to this
...
End If
The boot takes about 1.5 seconds to complete. The wln.boot method will return 0 — OK if the boot was completed successfully. At that moment, wln.enabled will become 1 — YES.
The boot will fail (return 1 — NG) if:
- The Wi-Fi hardware is not powered, not properly reset, mapped incorrectly, or malfunctioned.
- The offset to the firmware file is incorrect or the file is not included in your project.
- The GA1000 is already booted and operational.
WA2000
The WA2000 stores its firmware in its flash memory, so there is no need to upload the firmware file on each boot. For the WA2000, the wln.boot method must be executed with its argument set to 0.
The boot process may take up to five seconds to complete. If wln.getmoduletype is executed before wln.boot is called, the boot time will be shorter because the Wi-Fi module type is already known. If wln.boot is called without the prior execution of wln.getmoduletype, the boot time will be longer, because it will also involve determining the Wi-Fi module type.
The boot will fail (return 1 — NG) if:
- The Wi-Fi hardware is not powered, not properly reset, mapped incorrectly, or malfunctioned.
- The offset argument of wln.boot is anything but 0.
- The WA2000 is already booted and operational.
Booting Up Either Module
To make your app ready for working with either Wi-Fi add-on module, first determine the module type using wln.getmoduletype first, then call wln.boot in the right manner. An example of the code that does this is shown in Bringing Up the Wi-Fi Interface.