====== Nodes ====== ===== GetDeviceAddress ===== Returns device address. This address is generated from LPC microcontrollers UUID and should be unique. Syntax: \\ **GetDeviceAddress**() [200] Returns: \\ **GetDeviceAddress**(int deviceAddress) [200] message, where deviceAddress is 32bit address. ===== AddNode ===== Adds device (address) to the recognised device (node) list. Syntax: \\ **AddNode**(int deviceAddress) [210] Parameters: \\ int **deviceAddress** - the target device address. ===== DeleteNode ===== Removes device (address) from the recognized device (node) list. Syntax: \\ **DeleteNode**(int deviceAddress) [211] Parameters: \\ int **deviceAddress** - the target device address. ===== ClearNodes ===== Removes all devices from the recognized device (node) list. Syntax: \\ **ClearNodes**() [212] ===== GetNodes ===== Returns the list of recognized devices (addresses). Syntax: \\ **GetNodes**() [213] Returns: \\ **GetNodes**(int deviceAddress0, int deviceAddress1, ...) [213]. ===== GetNodeInfo ===== Returns the list of recognized devices (addresses). Syntax: \\ **GetNodeInfo**(int deviceAddress) [214] Parameters: \\ int **deviceAddress** - the target device address. Returns: \\ **GetNodeInfo**(int deviceAddress, int incomingSignalQuality, int outgoingSignalQuality) [214] FIXME: to be documented! ====== Settings ====== ===== SetSystemSettings ===== Sets system settings. Currently this command is only available in the devices with node firmware. Syntax: \\ **SetSystemSettings**(int powerOnTimeout, int powerDownTimeout) [250] Parameters: \\ int **powerOnTimeout** - time in **milliseconds**, how long the device should be active while in power save mode \\ int **powerDownTimeout** - time in **seconds**, how long the device should sleep while in power save mode \\ ===== GetSystemSettings ===== Returns current system settings. Currently this command is only available in the devices with node firmware. Syntax: \\ **GetSystemSettings**() [251] Returns: \\ **GetSystemSettings**(int powerOnTimeout, int powerDownTimeout) [250], for parameter meaning see SetSystemSettings command. ===== SetRFSettings ===== Sets and reconfigures devices RF settings. Syntax: \\ **SetRFSettings**(int frequency, int datarate, int modulation, int frequencyDeviation, int txPower, int networkID, int maxRetryCount, int ackWaitTimeout, byte[] aesKey, int csmaConfig) [203] Parameters: \\ int **frequency** - main carrier frequency in hertz. \\ int **datarate** - data transfer rate in bits per second. \\ int **modulation** - FIXME \\ int **frequencyDeviation** - frequency deviation in hertz. \\ int **txPower** - transmitter power in dBm. \\ int **networkID** - arbitraty network number, which allows usage of two separate networks using the same frequency. \\ int **maxRetryCount** - a maximum number of times a packet is retried to be sent before dropping it. The maximum number of times a packet will be transmitted is maxRetryCount + 1. \\ int **ackWaitTimeout** - a number of milliseconds to wait for ACK packet after sending the data packet. \\ byte[] **aesKey** - 16 byte (128bit) long array which is used as AES key. \\ int csmaConfig - FIXME ===== GetRFSettings ===== Returns devices RF settings. Syntax: \\ **GetRFSettings**() [204] Returns: \\ **GetRFSettings**(int frequency, int datarate, int modulation, int frequencyDeviation, int txPower, int networkID, int maxRetryCount, int ackWaitTimeout, int csmaConfig) [203], see SetRFSettings for parameter explanation. ===== SaveSettings ===== Saves current system, RF and node settings into non-volatile memory. These settings will be automatically loaded the next time devices restarts. Please note that after restart, devices with node firmware will enter power saving mode automatically if they find saved settings. See EnterPowerSave command to know why this can be an issue. Syntax: \\ **SaveSettings**() [220] ====== Traffic information ====== ===== GetTrafficInfo ===== Returns device information. Syntax: \\ **GetTrafficInfo**() [201] Returns: \\ **GetTrafficInfo**(int sendTotal, int sendSuccessful, int sendRetry, int sequenceUpdate) [201] message, where: \\ int **sendTotal** - a number of packets that were attempted to be sent. \\ int **sendSuccessfull** - a number of outgoing packets that received correct ACK. \\ int **sendRetry** - a number of times a packet was retried. \\ int **sequenceUpdate** - a number of successful re-synchronization events. \\ ===== ClearTrafficInfo ===== Resets traffic info fields to 0. Syntax: \\ **ClearTrafficInfo**() [202] ====== Other ====== ===== Ping ===== Pings the target device. Syntax: \\ **Ping**(int deviceAddress) [205] Parameters: \\ int **deviceAddress** - the target device address. Returns: \\ **Pong**(int deviceAddress, int delay) [206], if the target device successfully responded within the timeout period (10 seconds). The delay is ping-pong packet roundtrip time expressed in milliseconds. ===== EnterPowerSave ===== Transitions device into power saving mode. In power saving mode USB is disabled, therefore no changes to the configuration can be made without resetting the device. FIXME: how to reset? This command is only available in devices with node firmware, because router is always in the active state. Syntax: \\ **EnterPowerSave**() [221] ===== GetDeviceInfo ===== Returns device information. Syntax: \\ **GetDeviceInfo**() [255] Returns: \\ **GetDeviceInfo**(int firmwareVersion, byte[] UID, int lpcPartNumber, int lpcBootCodeVersion) [255] message, where: \\ int firmwareVersion - [31:24] bits are device (firmware) type which is 0x77 (ASCII 'w') for wUPER board, [23:16] bits are firmware major version and [15:0] bits are firmware minor version. \\ byte[] UID - 16 byte long Unique IDentifier of the device (LPC microcontroller). \\ int lpcPartNumber - device part number of the device (LPC microcontroller). \\ int lpcBootCodeVersion - device bootload code version of the device (LPC microcontroller). \\