/*******************************************************************************
* Project:      Amped'RF Bluetooth
* File name:    SDK_AT_Signals.h
* Description:  AT Signals
*
* Copyright (c) 2016 Amped'RF Technology Inc, All rights reserved.
*******************************************************************************/
#ifndef _SDK_AT_SIGNALS_H_
#define _SDK_AT_SIGNALS_H_

//--------------------------------------
// state id for state machine
//--------------------------------------
typedef enum tAT_MainState{
  eAT_StartState=0,             // for state initialization
  eAT_CommandState,             // looking for AT command
  eAT_BypassState,              // bypass state
  eAT_ReturnToCommandState,     // got Escape string, and waiting Escape timeout
  eAT_ModemHangupState,         // waiting for Modem Hangup
  eAT_RemoteCmdNoBypassState,   // remote command mode without bypass mode
  eAT_RemoteCmdWithBypassState, // remote command mode with bypass
  eAT_ReturnToRemoteCmdState    // waiting for Escape timeout
}tAT_MainState;


//--------------------------------------
// 0001 : SIG_AT_TX_DONE
//--------------------------------------
typedef struct tSIG_AtTxDone{
  uint32        Transac;
  tSysBufHdr    *pBufHdr;           // tx buffer pointer
}tSIG_AtTxDone;


//--------------------------------------
// 0002 : SIG_AT_RX_DONE
//--------------------------------------
typedef struct tSIG_AtRxDone{
  uint32        Transac;
  tSysBufHdr    *pBufHdr;           // rx buffer pointer
  uint16        RxLen;              // rx buffer length
  uint16        HandleIndex;        // Used for MP and Broadcast
}tSIG_AtRxDone;



enum {
    SIG_AT_DEVICE_UP = 40001,
    SIG_AT_ENABLE_BLE_ADV,
    SIG_AT_TX_DONE,
    SIG_AT_RX_DONE,
    SIG_AT_OUT_BYPASS_MODE,
    SIG_AT_FLUSH_SUSPECT_ESCAPE,
    SIG_AT_REQUEST_SHUTDOWN,
    SIG_AT_BOND_ENABLE_EXPIRE,
    SIG_AT_BREAK_SEQUENCE_DONE,
    SIG_AT_MODEM_HANGUP_SENT,
    SIG_AT_SVC_SEARCH_DELAY,
    SIG_AT_RECONFIG_GAP_DELAY_EXPIRE,
    SIG_AT_MODEM_BUTTON_PUSH,
    SIG_AT_MODEM_DEBOUNCE_TIMER_EXPIRE,
    SIG_AT_MODEM_DEBOUNCE_TIMER_START,
    SIG_AT_ENABLE_SECURITY,
    SIG_AT_DSM_DEBOUNCE_TIMER_EXPIRE,
    SIG_AT_DSM_DEBOUNCE_TIMER_START,
    SIG_AT_DSM_GPIO_BLOCK,
    SIG_AT_DSM_GPIO_UNBLOCK,
    SIG_AT_LINK_MODE_HOST_EVENT,
    SIG_AT_DISCOVERY_TIMEOUT,
    SIG_AT_100MS_TIMEOUT,
    SIG_AUTO_SNIFF_TIMEOUT,
    SIG_AUTO_RECONNECT,
    SIG_SMART_CABLE_CONNECT,
    SIG_SMART_PRINTER_CONNECT,
    SIG_AT_ROLE_SWITCH_SECURITY_ENABLE,
    SIG_AT_CHANGE_BAUD,
    SIG_AT_RESET,
    SIG_AT_CONFIG_SEND,
    SIG_AT_HANDLE_HCI_EVENT,
    SIG_AT_SCO_REMOVED,
    SIG_AT_SCO_ADDED,
    SIG_AT_GPIO3_EVENT,
    SIG_AT_GPIO3_DEBOUNCE_EXPIRE,
    SIG_AT_GPIO4_EVENT,
    SIG_AT_GPIO4_DEBOUNCE_EXPIRE,
    SIG_AT_SPI_SLAVE_POLL,
    SIG_AT_DSM_ENABLE_DELAY,
    SIG_MP_PACKET_TIMEOUT,
    SIG_CUSTOM_MP_PACKET_TIMEOUT,
    SIG_AT_GPIO_INTERRUPT,
    SIG_AT_CALIBRATE,
    SIG_AT_CALIBRATE_HSE,
    SIG_AT_SET_DISCOVERY_MODE,
    SIG_AT_SET_DISCOVERY_MODE_TIMEOUT,
    SIG_AT_SET_HCI_BAUDRATE,
    SIG_AT_SPPSEND_WFCONNECTION_TIMEOUT,
    SIG_AT_SPPSEND_CONNECTION_TIMEOUT,
    SIG_AT_HCI_MONITOR_TIMER,
    SIG_AT_TEST_TIMER,
    SIG_AT_TEST_SUITE,
    SIG_AT_TEST_SLEEP,
    SIG_AT_TEST_AWAKE
};

#endif // _SDK_AT_SIGNALS_H_
