This is an old revision of the document!
There is a comprehensive user guide over on the Particle.io site, which provides detail descriptions and examples of the different built-in functions that you can use.
The following Particle Cloud Function APIs are working, whilst the remainder are not available for use (yet). Please note that there is a known bug in the Particle.subscribe() function, where specifying a unique device ID to subscribe to has no effect. This is a bug on their side, and the current workaround is the specify the MY_DEVICES constant instead, in order to limit the subscription to just the devices you own, rather than including all public events also.
All of the ESP8266 2.0.0 APIs are available
Some ESP8266 libraries that change the WiFi connection settings or state may break your Oak. So be prepared to break out a 3.3v USB to Serial adapter, and follow the recovery instructions to restore your Oak if you mess with thouse!
uint8_t Oak.getEmptyRom(void) - returns the number of the rom slot that is currently empty (0,4, or 8 - because there are sub slots as well that aren't currently used)
bool Oak.connect(void) - connect to the configured wifi only, not Particle - called automatically on boot as part of the Particle.connect()
bool Oak.connected(void) - returns true if wifi is connected (even if particle is not) bool Oak.waitForConnection(void) - loops until wifi connects or 15 seconds pass, returns true if connected at end
uint8_t Oak.bootReason(void) - get the reason for the last reboot from the bootloader
void Oak.rebootToUser(void) - reboot to the current user rom
void Oak.rebootToConfig(void) - reboot to the config rom
void Oak.rebootToFallbackUpdater(void) - reboot to the fallback force system updater - do not use
bool Oak.checkRomImage(uint8_t rom_number) - check if the rom image in the slot specified is valid
uint8_t Oak.currentRom(void) - get the slot of the currently running rom
uint8_t Oak.configRom(void) - get the slot of the config rom
uint8_t Oak.userRom(void) - get the slot of the user rom
uint8_t Oak.updateRom(void) - get the slot of the fallback update rom
uint8_t Oak.otaReboot(void) - was the last reboot caused by an attempt to update
When the Oak is in config mode it exposes an Access Point that the config wizard uses to change settings. This protocol is detailed here: https://github.com/spark/firmware/blob/845a5b489924d6953f966c8b6bb02b915d7f66ae/hal/src/photon/soft-ap.md
Commands are available via http, tcp, and serial.
Full list of commands implemented on the Oak are here: Oak Internal URLs