/*
This software is subject to the license described in the License.txt file
included with this software distribution. You may not use this file except in compliance
with this license.
Copyright (c) Dynastream Innovations Inc. 2015
All rights reserved.
*/

/**@file
 * @brief Commands used in ANT Scan and Forward
 *
 * @defgroup ant_scan_and_forward_example ANT Scan and Forward Demo
 * @{
 * @ingroup nrf_ant_scan_and_forward
 *
 */

#ifndef __COMMANDS_H__
#define __COMMANDS_H__

// Page numbers

#define DATA_PAGE_IND                   0
#define MOBILE_COMMAND_PAGE             ((uint8_t) 0x10)    /**< Data page for sending control commands */
#define DEVICE_STATUS_PAGE              ((uint8_t) 0x20)    /**< Data page for sending the device status */
#define INTERNAL_COMMAND_PAGE           ((uint8_t) 0x30)    /**< Data page for sending control commands inside the network */

// Page Indices for Device Status Data Page

#define DEVICE_STATUS_NODE_IND          1
#define DEVICE_STATUS_SEQ_NUM_IND       6
#define DEVICE_STATUS_STATE_IND         7

// Page Indices for Internal Command Data Page

#define INTERNAL_CMD_DST_IND            1
#define INTERNAL_CMD_SEQ_NUM_IND        6
#define INTERNAL_CMD_CMD_IND            7
#define INTERNAL_CMD_CMD_DATA1_IND      5
#define INTERNAL_CMD_CMD_DATA2_IND      4

// Page Indices for Mobile Command Data Page

#define MOBILE_CMD_DST_IND              2
#define MOBILE_CMD_CMD_IND              7
#define MOBILE_CMD_CMD_DATA1_IND        5                   /**< Configuration Command - Command Page Rotation % */
#define MOBILE_CMD_CMD_DATA2_IND        4                   /**< Configuration Command - Command Page Hi Priority */

// Page Indices for BLE Command Page

#define BLE_CMD_DST_IND                 1
#define BLE_CMD_DATA0_IND               2
#define BLE_CMD_DATA1_IND               3
#define BLE_CMD_DATA2_IND               4

// Device status

#define STATUS_LIGHT_OFF                ((uint8_t) 0x00)    /**< Device light is currently off */
#define STATUS_LIGHT_ON                 ((uint8_t) 0x01)    /**< Device light is currently on */

// Device command - Light

#define COMMAND_LIGHT_OFF               ((uint8_t) 0x00)    /**< Turn off device light */
#define COMMAND_LIGHT_ON                ((uint8_t) 0x01)    /**< Turn on device light */

// Device command - Configuration

#define COMMAND_CHG_CMD_PG_SET          ((uint8_t) 0x03)    /**< Change the device's internal page rotation */
#define SUBCOMMAND_ENABLE_HI_PRI_CMD    ((uint8_t) 0x01)    /**< Enable the high priority command page feature */
#define SUBCOMMAND_DISABLE_HI_PRI_CMD   ((uint8_t) 0x00)    /**< Disable the high priority command page feature */

#define ADDRESS_ALL_NODES               ((uint8_t) 0x00)                /**< Send command to all nodes  */

#define RESERVED                        ((uint8_t) 0xFF)                /**< Reserved/Invalid value  */

#endif

/**
 *@}
 **/
