Microchip® Advanced Software Framework

wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c File Reference
#include <asf.h>
#include "conf_board.h"
#include "led.h"
#include "common_sw_timer.h"
#include "app_config.h"
#include "rf4ce.h"
#include "vendor_data.h"
#include "pb_pairing.h"
#include "zid.h"
#include "zid_device.h"

Macros

#define ACCELEROMETER_SAMPLE_TIME   10000
 
#define APP_USER_STRING_SIZE   (15)
 
#define APPX_5_DEGREE_VALUE   10
 
#define BUTTON_1   0x10
 
#define BUTTON_2   0x20
 
#define BUTTON_3   0x40
 
#define BUTTON_4   0x80
 
#define BUTTON_DELETE   (76)
 
#define BUTTON_DOWN_E   (81)
 
#define BUTTON_ESC   (41)
 
#define BUTTON_FUNCTION_F5   (62)
 
#define BUTTON_GAME_MODE   (0xFD)
 
#define BUTTON_INVALID   (0xFF)
 
#define BUTTON_LEFT_E   (80)
 
#define BUTTON_LEFT_SINGLE_CLK   (90)
 
#define BUTTON_MEDIA_MODE   (0xFE)
 
#define BUTTON_MIDDLE_CLK   (94)
 
#define BUTTON_MOUSE_MODE   (0xFB)
 
#define BUTTON_MPLAYER   (0x0008)
 
#define BUTTON_MUTE   (0x0001)
 
#define BUTTON_NEXT   (0x0040)
 
#define BUTTON_PAGE_DOWN   (78)
 
#define BUTTON_PAGE_UP   (75)
 
#define BUTTON_PAUSE   (0x0100)
 
#define BUTTON_PLAY   (0x0080)
 
#define BUTTON_PPT_MODE   (0xFC)
 
#define BUTTON_PREVIOUS   (0x0020)
 
#define BUTTON_REPEAT   (0x0200)
 
#define BUTTON_RIGHT_E   (79)
 
#define BUTTON_RIGHT_SINGLE_CLK   (91)
 
#define BUTTON_SCROLL_DOWN   (93)
 
#define BUTTON_SCROLL_UP   (92)
 
#define BUTTON_STOP   (0x0010)
 
#define BUTTON_TAB   (43)
 
#define BUTTON_THROTTLE_DOWN   0x14
 
#define BUTTON_THROTTLE_UP   0x11
 
#define BUTTON_UP_E   (82)
 
#define BUTTON_VOLUME_N   (0x0004)
 
#define BUTTON_VOLUME_P   (0x0002)
 
#define INTER_FRAME_DURATION_MOUSE_US   (5000) /* 5ms */
 
#define INTER_FRAME_DURATION_US   (200000) /* 200ms */
 
#define MOUSE_NEGATIVE_DISPLACEMENT   (-2)
 
#define MOUSE_POSITIVE_DISPLACEMENT   (2)
 
#define TOTAL_NO_OF_ZID_KEY_RC   (27)
 
#define TX_OPTIONS
 
#define VENDOR_STRING_LEN_SIZE   (7)
 
#define ZID_APP_LED   (LED0)
 
#define ZID_ATTRIBUTE_REQ_SIZE   (10)
 
#define ZID_COLD_START   (0)
 

Typedefs

typedef enum node_status_tag node_status_t
 

Enumerations

enum  node_status_tag {
  IDLE,
  WARM_START,
  COLD_START,
  CONFIGURING_ATTRIBUTES,
  CONNECTING,
  TRANSMITTING,
  IDLE,
  WARM_START,
  COLD_START,
  TRANSMITTING,
  IDLE = 0,
  RESETTING,
  POWER_SAVE,
  STARTING,
  PUSH_BUTTON_PAIRING,
  CMD_DISCOVERING,
  ALL_IN_ONE_START,
  WARM_STARTING,
  PRINTING_PAIRING_TABLE,
  UNPAIRING,
  CH_AGILITY_EXECUTION,
  BASE_CHANNEL_CHANGE,
  GETTING_CH_AG_NIBS,
  IDLE = 0,
  RESETTING,
  POWER_SAVE,
  STARTING,
  PUSH_BUTTON_PAIRING,
  CMD_DISCOVERING,
  ALL_IN_ONE_START,
  WARM_STARTING,
  PRINTING_PAIRING_TABLE,
  UNPAIRING,
  CH_AGILITY_EXECUTION,
  BASE_CHANNEL_CHANGE,
  GETTING_CH_AG_NIBS,
  IDLE,
  WARM_START,
  COLD_START,
  TRANSMITTING,
  RESET,
  TRX_OFF_START,
  TRX_OFF_CONFIRM,
  TRX_ON_START,
  IDLE,
  WARM_START,
  COLD_START,
  CONFIGURING_ATTRIBUTES,
  CONNECTING,
  TRANSMITTING,
  IDLE,
  WARM_START,
  COLD_START,
  CONFIGURING_ATTRIBUTES,
  CONNECTING,
  TRANSMITTING,
  IDLE = 0,
  RESETTING,
  POWER_SAVE,
  STARTING,
  ZID_CONNECTING,
  ALL_IN_ONE_START,
  WARM_STARTING,
  PRINTING_PAIRING_TABLE,
  UNPAIRING
}
 

Functions

static void acc_read_cb (void *parameter)
 
static void app_alert (void)
 application failure indication More...
 
static void app_calculate_offset ()
 Offset calculation function. More...
 
static void app_nlme_rx_enable_confirm (nwk_enum_t Status)
 The NLME-RX-ENABLE.confirm primitive reports the results of the attempt to enable or disable the receiver. More...
 
static void app_task (void)
 Application task and state machine. More...
 
bool check_zid_adaptor_compatibility (uint8_t PairingRef, uint8_t payload_length, uint8_t *payload)
 nlde_data_confirm The NLDE-DATA.confirm primitive is generated by the NWK layer entity in response to an NLDE-DATA.request primitive. More...
 
static void correct_negative_offset (uint16_t *temp_val, uint16_t temp_offset)
 Negative offset correction function. More...
 
static void correct_positive_offset (uint16_t *temp_val, uint16_t temp_offset)
 Positive offset correction function. More...
 
 FLASH_DECLARE (uint16_t VendorIdentifier)
 
 FLASH_DECLARE (uint8_t app_user_string[APP_USER_STRING_SIZE])
 
uint8_t get_zid_keyrc_button (button_id_t button_id)
 get_zid_keyrc_button This function will get the index for each key More...
 
static void indicate_fault_behavior (void)
 Indicating malfunction. More...
 
int main (void)
 Main function, initialization and main message loop. More...
 
void nlde_data_confirm (nwk_enum_t Status, uint8_t PairingRef, profile_id_t ProfileId)
 nlde_data_confirm The NLDE-DATA.confirm primitive is generated by the NWK layer entity in response to an NLDE-DATA.request primitive. More...
 
static void nlme_reset_confirm (nwk_enum_t Status)
 nlme_reset_confirm The NLME-RESET.confirm primitive allows the NLME to notify the application of the status of its request to reset the NWK layer. More...
 
static void nlme_start_confirm (nwk_enum_t Status)
 nlme_start_confirm The NLME-START.confirm primitive allows the NLME to notify the application of the status of its request to start a network. More...
 
void vendor_app_alive_req (void)
 Vendor-specific callback; handles reaction to incoming alive request. More...
 
static void zid_connect_confirm (nwk_enum_t Status, uint8_t PairingRef)
 Push button pairing confirm; target and controller use. More...
 
static void zid_data_confirm (nwk_enum_t Status, uint8_t PairingRef)
 zid_data_confirm is call back of zid_data_request which gives the status of the data request More...
 
static void zid_get_report_indication (uint8_t PairingRef, zid_report_types_t zid_report_type, zid_report_desc_t zid_report_desc, uint8_t RxLinkQuality, uint8_t RxFlags)
 zid_data_confirm is call back to the application layer. More...
 
static void zid_heartbeat_confirm (nwk_enum_t Status, uint8_t PairingRef)
 heart beat confirm; target and controller use More...
 
static void zid_report_data_confirm (nwk_enum_t Status, uint8_t PairingRef)
 zid_report_data_confirm is call back of zid_report_data_request which gives the status of the report data request More...
 
static void zid_report_data_indication (uint8_t PairingRef, uint8_t num_report_records, zid_report_data_record_t *zid_report_data_record_ptr, uint8_t RxLinkQuality, uint8_t RxFlags)
 ZID Report Data indication used to know if the adaptor sends any output report to the ZID Device. More...
 
static void zid_set_attribute_confirm (nwk_enum_t status, uint8_t PairingRef, zid_attribute_t ZIDAttribute, uint8_t ZIDAttributeIndex)
 zid_set_attribute_confirm ZID Set attribute confirm callback allows to check whether attributes are sent to the ZID Adaptor. More...
 

Variables

uint16_t ADC_val
 
static uint8_t APP_TIMER_ACC_READ
 
uint8_t b_state = 0xFF
 
uint16_t button_mode = BUTTON_MEDIA_MODE
 
button_id_t button_val
 
void(* Correct_x_offset )(uint16_t *temp_val, uint16_t temp_offset)
 
void(* Correct_y_offset )(uint16_t *temp_val, uint16_t temp_offset)
 
void(* Correct_z_offset )(uint16_t *temp_val, uint16_t temp_offset)
 
static uint8_t key_mapping_gamepad [TOTAL_NO_OF_ZID_KEY_RC]
 
static uint16_t key_mapping_media [TOTAL_NO_OF_ZID_KEY_RC]
 
static uint8_t key_mapping_mouse [TOTAL_NO_OF_ZID_KEY_RC]
 
static uint8_t key_mapping_ppt [TOTAL_NO_OF_ZID_KEY_RC]
 
static node_status_t node_status
 
static uint8_t pairing_ref = 0xFF
 
static uint8_t report_id = 0
 
static uint8_t set_attribute_index = 0
 
uint8_t status
 
uint16_t x_offset
 
uint16_t x_val
 
uint16_t y_offset
 
uint16_t y_val
 
uint16_t z_offset
 
uint16_t z_val
 
static zid_indication_callback_t zid_ind
 
uint32_t zid_interframe_duration = INTER_FRAME_DURATION_US
 

#define ACCELEROMETER_SAMPLE_TIME   10000

Referenced by acc_read_cb(), and app_task().

#define APP_USER_STRING_SIZE   (15)
#define APPX_5_DEGREE_VALUE   10

Referenced by app_task().

#define BUTTON_1   0x10
#define BUTTON_2   0x20
#define BUTTON_3   0x40

Referenced by app_task().

#define BUTTON_4   0x80

Referenced by app_task().

#define BUTTON_DELETE   (76)
#define BUTTON_DOWN_E   (81)

Referenced by app_task().

#define BUTTON_ESC   (41)
#define BUTTON_FUNCTION_F5   (62)
#define BUTTON_GAME_MODE   (0xFD)

Referenced by app_task().

#define BUTTON_INVALID   (0xFF)

Referenced by app_task(), and get_zid_keyrc_button().

#define BUTTON_LEFT_E   (80)

Referenced by app_task().

#define BUTTON_LEFT_SINGLE_CLK   (90)

Referenced by app_task().

#define BUTTON_MEDIA_MODE   (0xFE)

Referenced by app_task().

#define BUTTON_MIDDLE_CLK   (94)

Referenced by app_task().

#define BUTTON_MOUSE_MODE   (0xFB)

Referenced by app_task().

#define BUTTON_MPLAYER   (0x0008)
#define BUTTON_MUTE   (0x0001)
#define BUTTON_NEXT   (0x0040)
#define BUTTON_PAGE_DOWN   (78)
#define BUTTON_PAGE_UP   (75)
#define BUTTON_PAUSE   (0x0100)
#define BUTTON_PLAY   (0x0080)
#define BUTTON_PPT_MODE   (0xFC)

Referenced by app_task().

#define BUTTON_PREVIOUS   (0x0020)
#define BUTTON_REPEAT   (0x0200)
#define BUTTON_RIGHT_E   (79)

Referenced by app_task().

#define BUTTON_RIGHT_SINGLE_CLK   (91)

Referenced by app_task().

#define BUTTON_SCROLL_DOWN   (93)

Referenced by app_task().

#define BUTTON_SCROLL_UP   (92)

Referenced by app_task().

#define BUTTON_STOP   (0x0010)
#define BUTTON_TAB   (43)
#define BUTTON_THROTTLE_DOWN   0x14

Referenced by app_task().

#define BUTTON_THROTTLE_UP   0x11

Referenced by app_task().

#define BUTTON_UP_E   (82)

Referenced by app_task().

#define BUTTON_VOLUME_N   (0x0004)
#define BUTTON_VOLUME_P   (0x0002)
#define INTER_FRAME_DURATION_MOUSE_US   (5000) /* 5ms */

Referenced by app_task().

#define INTER_FRAME_DURATION_US   (200000) /* 200ms */

Referenced by app_task().

#define MOUSE_NEGATIVE_DISPLACEMENT   (-2)

Referenced by app_task().

#define MOUSE_POSITIVE_DISPLACEMENT   (2)

Referenced by app_task().

#define TOTAL_NO_OF_ZID_KEY_RC   (27)

Referenced by get_zid_keyrc_button().

#define TX_OPTIONS
Value:
#define TXO_ACK_REQ
Tx option - ACK requested.
Definition: atmel_rf4ce/lib/rf4ce.h:71
#define TXO_DST_ADDR_NET
Tx option - destination address: short.
Definition: atmel_rf4ce/lib/rf4ce.h:65
#define TXO_MULTI_CH
Tx option - multi-channel transmission.
Definition: atmel_rf4ce/lib/rf4ce.h:77
#define TXO_VEND_NOT_SPEC
Tx option - no vendor-specific data.
Definition: atmel_rf4ce/lib/rf4ce.h:85
#define TXO_CH_NOT_SPEC
Tx option - channel not specified.
Definition: atmel_rf4ce/lib/rf4ce.h:81
#define TXO_SEC_REQ
Tx option - security requested.
Definition: atmel_rf4ce/lib/rf4ce.h:75
#define TXO_UNICAST
Tx option - unicast.
Definition: atmel_rf4ce/lib/rf4ce.h:61

Referenced by app_task(), and zid_get_report_indication().

#define VENDOR_STRING_LEN_SIZE   (7)
#define ZID_ATTRIBUTE_REQ_SIZE   (10)
#define ZID_COLD_START   (0)

Referenced by main().

Enumerator
IDLE 
WARM_START 
COLD_START 
CONFIGURING_ATTRIBUTES 
CONNECTING 
TRANSMITTING 
IDLE 
WARM_START 
COLD_START 
TRANSMITTING 
IDLE 
RESETTING 
POWER_SAVE 
STARTING 
PUSH_BUTTON_PAIRING 
CMD_DISCOVERING 
ALL_IN_ONE_START 
WARM_STARTING 
PRINTING_PAIRING_TABLE 
UNPAIRING 
CH_AGILITY_EXECUTION 
BASE_CHANNEL_CHANGE 
GETTING_CH_AG_NIBS 
IDLE 
RESETTING 
POWER_SAVE 
STARTING 
PUSH_BUTTON_PAIRING 
CMD_DISCOVERING 
ALL_IN_ONE_START 
WARM_STARTING 
PRINTING_PAIRING_TABLE 
UNPAIRING 
CH_AGILITY_EXECUTION 
BASE_CHANNEL_CHANGE 
GETTING_CH_AG_NIBS 
IDLE 
WARM_START 
COLD_START 
TRANSMITTING 
RESET 
TRX_OFF_START 
TRX_OFF_CONFIRM 
TRX_ON_START 
IDLE 
WARM_START 
COLD_START 
CONFIGURING_ATTRIBUTES 
CONNECTING 
TRANSMITTING 
IDLE 
WARM_START 
COLD_START 
CONFIGURING_ATTRIBUTES 
CONNECTING 
TRANSMITTING 
IDLE 
RESETTING 
POWER_SAVE 
STARTING 
ZID_CONNECTING 
ALL_IN_ONE_START 
WARM_STARTING 
PRINTING_PAIRING_TABLE 
UNPAIRING 

static void app_alert ( void  )
static

application failure indication

void app_calculate_offset ( )
static
static void app_nlme_rx_enable_confirm ( nwk_enum_t  Status)
static

The NLME-RX-ENABLE.confirm primitive reports the results of the attempt to enable or disable the receiver.

Parameters
StatusStatus of the nlme_rx_enable_req

References COLD_START, delay_ms, FUNC_PTR, IDLE, indicate_fault_behavior(), LED_Off, LED_On, nlme_reset_confirm(), nlme_reset_request(), node_status, NWK_SUCCESS, WARM_START, and ZID_APP_LED.

static void app_task ( void  )
static

Application task and state machine.

References acc_read_cb(), ACCELEROMETER_SAMPLE_TIME, ADC_val, aplHIDStdDescCompsList, app_calculate_offset(), APP_TIMER_ACC_READ, APPX_5_DEGREE_VALUE, b_state, mouse_desc_tag::button0, mouse_desc_tag::button1, mouse_desc_tag::button2, BUTTON_1, BUTTON_2, BUTTON_3, BUTTON_4, BUTTON_DOWN_E, BUTTON_GAME_MODE, BUTTON_INVALID, BUTTON_LEFT_E, BUTTON_LEFT_SINGLE_CLK, BUTTON_MEDIA_MODE, BUTTON_MIDDLE_CLK, button_mode, BUTTON_MOUSE_MODE, BUTTON_PPT_MODE, BUTTON_RIGHT_E, BUTTON_RIGHT_SINGLE_CLK, BUTTON_SCROLL_DOWN, BUTTON_SCROLL_UP, BUTTON_THROTTLE_DOWN, BUTTON_THROTTLE_UP, BUTTON_UP_E, CONFIGURING_ATTRIBUTES, CONTACT_DATA, Correct_x_offset, Correct_y_offset, FUNC_PTR, get_zid_keyrc_button(), IDLE, INPUT, INTER_FRAME_DURATION_MOUSE_US, INTER_FRAME_DURATION_US, keyboard_input_desc_tag::key_code, key_mapping_gamepad, key_mapping_media, key_mapping_mouse, key_mapping_ppt, KEYBOARD, LED_Off, LED_On, keyboard_input_desc_tag::modifier_keys, MOUSE, MOUSE_NEGATIVE_DISPLACEMENT, MOUSE_POSITIVE_DISPLACEMENT, node_status, NULL, nwk_stack_idle(), pairing_ref, PINCH_GESTURE, zid_report_data_record_tag::report_data, zid_report_data_record_tag::report_desc_identifier, zid_report_data_record_tag::report_type, ROTATE_GESTURE, SCROLL_GESTURE, set_attribute_index, SW_TIMEOUT_RELATIVE, sw_timer_get_time(), sw_timer_start(), SYNC, TAP_GESTURE, TAP_SUPPORT_PROPERTIES, TOUCH_SENSOR_PROPERTIES, TRANSMITTING, TX_OPTIONS, mouse_desc_tag::x_coordinate, x_offset, x_val, mouse_desc_tag::y_coordinate, y_offset, y_val, z_val, ZID_ATTRIBUTE_REQ_SIZE, zid_interframe_duration, zid_report_data_confirm(), zid_report_data_request(), zid_set_attribute_confirm(), and zid_set_attribute_request().

Referenced by main().

bool check_zid_adaptor_compatibility ( uint8_t  PairingRef,
uint8_t  payload_length,
uint8_t *  payload 
)

nlde_data_confirm The NLDE-DATA.confirm primitive is generated by the NWK layer entity in response to an NLDE-DATA.request primitive.

Parameters
PairingRefPairingRef for the current transaction
payload_lengthpayload length
payloadpayload to check the adaptor compatibility
Returns
bool true or false
static void correct_negative_offset ( uint16_t *  temp_val,
uint16_t  temp_offset 
)
static

Negative offset correction function.

Parameters
temp_valvalue to be corrected
temp_offsetOffset value

Referenced by app_calculate_offset().

static void correct_positive_offset ( uint16_t *  temp_val,
uint16_t  temp_offset 
)
static

Positive offset correction function.

Parameters
temp_valvalue to be corrected
temp_offsetOffset value

Referenced by app_calculate_offset().

FLASH_DECLARE ( uint16_t  VendorIdentifier)
FLASH_DECLARE ( uint8_t  app_user_string[APP_USER_STRING_SIZE])
uint8_t get_zid_keyrc_button ( button_id_t  button_id)

get_zid_keyrc_button This function will get the index for each key

Parameters
button_idpressed button id will be given as input
Returns
uint8_t button index

References BUTTON_INVALID, and TOTAL_NO_OF_ZID_KEY_RC.

Referenced by app_task(), and main().

static void indicate_fault_behavior ( void  )
static
static void nlme_reset_confirm ( nwk_enum_t  Status)
static

nlme_reset_confirm The NLME-RESET.confirm primitive allows the NLME to notify the application of the status of its request to reset the NWK layer.

Parameters
Statusstatus from the network layer corresponds to the nlme_reset_req
static void nlme_start_confirm ( nwk_enum_t  Status)
static

nlme_start_confirm The NLME-START.confirm primitive allows the NLME to notify the application of the status of its request to start a network.

Parameters
Statusstatus from the network layer corresponds to the nlme_start_req
void vendor_app_alive_req ( void  )

Vendor-specific callback; handles reaction to incoming alive request.

Vendor data alive request.

References delay_ms, LED_Off, LED_On, and ZID_APP_LED.

static void zid_connect_confirm ( nwk_enum_t  Status,
uint8_t  PairingRef 
)
static

Push button pairing confirm; target and controller use.

The push button pairing confirm is a callback that provides the status of the push pairing request.

Parameters
StatusStatus of the last pairing transaction
PairingRefIf pairing was successful, PairingRef contains assigned pairing reference.

References app_alert(), COLD_START, CONNECTING, delay_ms, FUNC_PTR, IDLE, indicate_fault_behavior(), LED_Off, LED_On, nlme_reset_confirm(), nlme_reset_request(), node_status, NWK_SUCCESS, pairing_ref, WARM_START, ZID_APP_LED, zid_state, and ZID_STATE_IDLE.

Referenced by zid_set_attribute_confirm().

static void zid_data_confirm ( nwk_enum_t  Status,
uint8_t  PairingRef 
)
static

zid_data_confirm is call back of zid_data_request which gives the status of the data request

Parameters
StatusStatus of the zid_data_request
PairingRefpairing reference for current transaction

References IDLE, indicate_fault_behavior(), LED_Off, node_status, NWK_SUCCESS, and ZID_APP_LED.

Referenced by zid_get_report_indication().

static void zid_get_report_indication ( uint8_t  PairingRef,
zid_report_types_t  zid_report_type,
zid_report_desc_t  zid_report_desc,
uint8_t  RxLinkQuality,
uint8_t  RxFlags 
)
static

zid_data_confirm is call back to the application layer.

    HID adaptor shall create a get report command frame and transmit
    it to the appropriate HID class device. On receipt of the
    corresponding report data  command frame, the HID adaptor shall pass

the report to the HID class driver.

Parameters
zid_report_typeReport type
PairingRefpairing reference for current transaction
zid_report_desczid report descriptor type
RxLinkQualityReceived frame link quality
RxFlagsReceived frame RxFlags

References mouse_desc_tag::button0, mouse_desc_tag::button1, mouse_desc_tag::button2, FUNC_PTR, IDLE, INPUT, MOUSE, node_status, pairing_ref, zid_report_data_record_tag::report_data, zid_report_data_record_tag::report_desc_identifier, zid_report_data_record_tag::report_type, TRANSMITTING, TX_OPTIONS, mouse_desc_tag::x_coordinate, mouse_desc_tag::y_coordinate, zid_data_confirm(), and zid_report_data_request().

Referenced by main().

static void zid_heartbeat_confirm ( nwk_enum_t  Status,
uint8_t  PairingRef 
)
static

heart beat confirm; target and controller use

The heart beat confirm is a callback that provides the status of the ZID Adaptor. HID class device can periodically check in with the HID adaptor to give it the opportunity to send a message back

Parameters
StatusStatus of the heartbeat command
PairingRefPairingRef contains assigned pairing reference.
static void zid_report_data_confirm ( nwk_enum_t  Status,
uint8_t  PairingRef 
)
static

zid_report_data_confirm is call back of zid_report_data_request which gives the status of the report data request

Parameters
StatusStatus of the zid_report_data_request
PairingRefpairing reference for current transaction

References IDLE, indicate_fault_behavior(), LED_Off, node_status, NWK_SUCCESS, report_id, and ZID_APP_LED.

Referenced by app_task().

static void zid_report_data_indication ( uint8_t  PairingRef,
uint8_t  num_report_records,
zid_report_data_record_t zid_report_data_record_ptr,
uint8_t  RxLinkQuality,
uint8_t  RxFlags 
)
static

ZID Report Data indication used to know if the adaptor sends any output report to the ZID Device.

Parameters
PairingRefPairingRef contains assigned pairing reference.
num_report_recordstotal no of reports in the report data
zid_report_data_record_ptrpointer to the report data
RxLinkQualityLink Quality of the received report
RxFlagsFlags for the Received frame

Referenced by main().

static void zid_set_attribute_confirm ( nwk_enum_t  status,
uint8_t  PairingRef,
zid_attribute_t  ZIDAttribute,
uint8_t  ZIDAttributeIndex 
)
static

zid_set_attribute_confirm ZID Set attribute confirm callback allows to check whether attributes are sent to the ZID Adaptor.

Parameters
Statusstatus from the network layer corresponds to the zid_set_attribute_request
PairingRefcurrent pairing ref
ZIDAttributeattribute name
ZIDAttributeIndexattribute index

References aplHIDStdDescCompsList, app_alert(), APP_CAPABILITIES, COLD_START, CONNECTING, DEV_TYPE_REMOTE_CONTROL, DEV_TYPE_WILDCARD, FUNC_PTR, indicate_fault_behavior(), LED_Off, nlme_reset_confirm(), nlme_reset_request(), node_status, NUM_SUPPORTED_PROFILES, NWK_SUCCESS, PROFILE_ID_ZID, set_attribute_index, WARM_START, ZID_APP_LED, ZID_ATTRIBUTE_REQ_SIZE, zid_connect_confirm(), and zid_org_connect_request().

Referenced by app_task().

uint16_t ADC_val
uint8_t APP_TIMER_ACC_READ
static

Referenced by acc_read_cb(), app_task(), and main().

uint8_t b_state = 0xFF
uint16_t button_mode = BUTTON_MEDIA_MODE
button_id_t button_val
void(* Correct_x_offset)(uint16_t *temp_val, uint16_t temp_offset)
void(* Correct_y_offset)(uint16_t *temp_val, uint16_t temp_offset)
void(* Correct_z_offset)(uint16_t *temp_val, uint16_t temp_offset)

Referenced by app_calculate_offset().

uint8_t key_mapping_gamepad[TOTAL_NO_OF_ZID_KEY_RC]
static
Initial value:
=
BUTTON_INVALID
}
#define BUTTON_GAME_MODE
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:137
#define BUTTON_MOUSE_MODE
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:135
#define BUTTON_2
Definition: wireless/avr2102_rf4control/apps/zid/dev/qt_remote/main.c:102
#define BUTTON_4
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:161
#define BUTTON_3
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:160
#define BUTTON_INVALID
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:168
#define BUTTON_1
Definition: wireless/avr2102_rf4control/apps/zid/dev/qt_remote/main.c:101
#define BUTTON_PPT_MODE
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:136
#define BUTTON_THROTTLE_UP
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:162
#define BUTTON_MEDIA_MODE
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:138
#define BUTTON_THROTTLE_DOWN
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:163

Referenced by app_task().

uint16_t key_mapping_media[TOTAL_NO_OF_ZID_KEY_RC]
static
Initial value:
=
}
#define BUTTON_MPLAYER
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:125
#define BUTTON_MUTE
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:131
#define BUTTON_GAME_MODE
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:137
#define BUTTON_MOUSE_MODE
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:135
#define BUTTON_VOLUME_P
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:129
#define BUTTON_INVALID
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:168
#define BUTTON_PAUSE
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:124
#define BUTTON_PPT_MODE
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:136
#define BUTTON_PREVIOUS
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:128
#define BUTTON_NEXT
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:127
#define BUTTON_STOP
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:126
#define BUTTON_REPEAT
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:132
#define BUTTON_MEDIA_MODE
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:138
#define BUTTON_VOLUME_N
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:130
#define BUTTON_PLAY
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:123
uint8_t key_mapping_mouse[TOTAL_NO_OF_ZID_KEY_RC]
static
Initial value:
=
}
#define BUTTON_SCROLL_UP
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:155
#define BUTTON_DOWN_E
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:144
#define BUTTON_MIDDLE_CLK
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:157
#define BUTTON_RIGHT_E
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:146
#define BUTTON_LEFT_E
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:145
#define BUTTON_LEFT_SINGLE_CLK
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:153
#define BUTTON_GAME_MODE
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:137
#define BUTTON_MOUSE_MODE
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:135
#define BUTTON_RIGHT_SINGLE_CLK
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:154
#define BUTTON_INVALID
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:168
#define BUTTON_PPT_MODE
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:136
#define BUTTON_UP_E
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:143
#define BUTTON_MEDIA_MODE
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:138
#define BUTTON_SCROLL_DOWN
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:156

Referenced by app_task().

uint8_t key_mapping_ppt[TOTAL_NO_OF_ZID_KEY_RC]
static
Initial value:
=
}
#define BUTTON_TAB
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:142
#define BUTTON_PAGE_DOWN
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:149
#define BUTTON_DOWN_E
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:144
#define BUTTON_ESC
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:141
#define BUTTON_FUNCTION_F5
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:150
#define BUTTON_RIGHT_E
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:146
#define BUTTON_DELETE
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:147
#define BUTTON_LEFT_E
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:145
#define BUTTON_GAME_MODE
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:137
#define BUTTON_MOUSE_MODE
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:135
#define BUTTON_INVALID
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:168
#define BUTTON_PAGE_UP
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:148
#define BUTTON_PPT_MODE
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:136
#define BUTTON_UP_E
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:143
#define BUTTON_MEDIA_MODE
Definition: wireless/avr2102_rf4control/apps/zid/dev/key_remote/main.c:138

Referenced by app_task().

uint8_t pairing_ref = 0xFF
static
uint8_t report_id = 0
static

Referenced by zid_report_data_confirm().

uint8_t set_attribute_index = 0
static
uint8_t status
uint16_t x_offset
uint16_t x_val
uint16_t y_offset
uint16_t y_val
uint16_t z_offset

Referenced by app_calculate_offset().

uint16_t z_val
zid_indication_callback_t zid_ind
static
uint32_t zid_interframe_duration = INTER_FRAME_DURATION_US

Referenced by app_task().