#include <asf.h>
#include "conf_board.h"
#include "led.h"
#include "common_sw_timer.h"
#include "keyboard.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 | INTER_FRAME_DURATION_US 200000 /* 200 ms */ |
#define | TX_OPTIONS |
Typedefs | |
typedef enum node_status_tag | node_status_t |
Functions | |
static void | app_alert (void) |
static void | app_nlme_rx_enable_confirm (nwk_enum_t Status) |
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) |
This function checks the Adaptor compatibility while pairing decides whether push button pairing request should be allowed. More... | |
static void | extended_delay_ms (uint16_t delay_ms) |
Extended blocking delay. More... | |
FLASH_DECLARE (uint16_t VendorIdentifier) | |
FLASH_DECLARE (uint8_t vendor_string[7]) | |
FLASH_DECLARE (uint8_t app_user_string[15]) | |
static void | indicate_fault_behavior (void) |
Indicating malfunction. More... | |
static key_state_t | key_state_read (key_id_t key_no) |
Read key_state. More... | |
int | main (void) |
Main function of the ZID Device application. More... | |
void | nlde_data_confirm (nwk_enum_t Status, uint8_t PairingRef, profile_id_t ProfileId) |
NLDE-DATA.confirm primitive API. More... | |
static void | nlme_reset_confirm (nwk_enum_t Status) |
static void | nlme_start_confirm (nwk_enum_t Status) |
void | vendor_app_alive_req (void) |
Vendor-spefic 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) |
Confirmation status to the application for its ZID 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) |
Notify the application when ZID report data is received from the paired device. More... | |
static void | zid_report_data_confirm (nwk_enum_t Status, uint8_t PairingRef) |
Confirmation status to the application for its 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) |
static void | zid_set_attribute_confirm (nwk_enum_t status, uint8_t PairingRef, zid_attribute_t ZIDAttribute, uint8_t ZIDAttributeIndex) |
Variables | |
key_state_t | key_state = KEY_RELEASED |
static bool | loop_end = false |
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 |
static zid_indication_callback_t | zid_ind |
#define INTER_FRAME_DURATION_US 200000 /* 200 ms */ |
Referenced by app_task().
#define TX_OPTIONS |
Referenced by app_task(), and zid_get_report_indication().
typedef enum node_status_tag node_status_t |
enum node_status_tag |
|
static |
|
static |
References COLD_START, extended_delay_ms(), IDLE, indicate_fault_behavior(), LED0, LED_Off, LED_On, node_status, NWK_SUCCESS, and WARM_START.
|
static |
Application task and state machine.
References aplHIDStdDescCompsList, pinch_gesture_report_tag::center_x, pinch_gesture_report_tag::center_y, CONFIGURING_ATTRIBUTES, sync_report_tag::contact_count, CONTACT_DATA, scroll_gesture_report_tag::direction, pinch_gesture_report_tag::direction, rotation_gesture_report_tag::direction, scroll_gesture_report_tag::distance, pinch_gesture_report_tag::distance, tap_support_properties_tag::double_tap, scroll_gesture_report_tag::finger_count, pinch_gesture_report_tag::finger_present, rotation_gesture_report_tag::finger_present, FUNC_PTR, sync_report_tag::gesture, touch_sensor_properties_tag::gestures, IDLE, INPUT, INTER_FRAME_DURATION_US, keyboard_input_desc_tag::key_code, KEY_PRESSED, key_state_read(), KEYBOARD, tap_support_properties_tag::long_tap, loop_end, rotation_gesture_report_tag::magnitude, touch_sensor_properties_tag::max_coordinate_x, touch_sensor_properties_tag::max_coordinate_y, keyboard_input_desc_tag::modifier_keys, MOUSE, node_status, nwk_stack_idle(), touch_sensor_properties_tag::origin, pairing_ref, PINCH_GESTURE, touch_sensor_properties_tag::reliable_index, zid_report_data_record_tag::report_data, zid_report_data_record_tag::report_desc_identifier, report_id, zid_report_data_record_tag::report_type, touch_sensor_properties_tag::resolution_x, touch_sensor_properties_tag::resolution_y, ROTATE_GESTURE, SCROLL_GESTURE, SELECT_KEY, set_attribute_index, touch_sensor_properties_tag::shape, tap_support_properties_tag::single_tap, sw_timer_get_time(), SYNC, tap_support_properties_tag::tap_and_a_half, TAP_GESTURE, TAP_SUPPORT_PROPERTIES, TOUCH_SENSOR_PROPERTIES, TRANSMITTING, TX_OPTIONS, scroll_gesture_report_tag::type, 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 | ||
) |
This function checks the Adaptor compatibility while pairing decides whether push button pairing request should be allowed.
nlde_data_confirm The NLDE-DATA.confirm primitive is generated by the NWK layer entity in response to an NLDE-DATA.request primitive.
Decision could be based on one of the parameter.
PairingRef | Pairing reference. |
payload_length | Length of the Payload |
*payload | Pointer to the Payload Adaptor attributes can be extracted from the payload. |
|
static |
Extended blocking delay.
delay_ms | Delay value in ms |
References delay_ms.
Referenced by app_nlme_rx_enable_confirm(), indicate_fault_behavior(), and zid_connect_confirm().
FLASH_DECLARE | ( | uint16_t | VendorIdentifier | ) |
FLASH_DECLARE | ( | uint8_t | vendor_string[7] | ) |
FLASH_DECLARE | ( | uint8_t | app_user_string[15] | ) |
|
static |
Indicating malfunction.
References extended_delay_ms(), LED0, LED_Off, and LED_On.
Referenced by app_nlme_rx_enable_confirm(), nlde_data_confirm(), zid_connect_confirm(), zid_data_confirm(), and zid_report_data_confirm().
|
static |
Read key_state.
key_no | Keyid to be read. |
References ioport_get_pin_level(), KEY_PRESSED, KEY_RELEASED, and SELECT_KEY.
Referenced by app_task(), and main().
|
static |
|
static |
void vendor_app_alive_req | ( | void | ) |
|
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.
Status | Status of the last pairing transaction |
PairingRef | If pairing was successful, PairingRef contains assigned pairing reference. |
References app_alert(), CONNECTING, extended_delay_ms(), IDLE, indicate_fault_behavior(), LED0, LED_Off, LED_On, node_status, NWK_SUCCESS, and pairing_ref.
Referenced by zid_set_attribute_confirm().
|
static |
Confirmation status to the application for its ZID data request.
Status | nwk status |
PairingRef | Pairing reference. |
References IDLE, indicate_fault_behavior(), LED0, LED_Off, node_status, and NWK_SUCCESS.
Referenced by zid_get_report_indication().
|
static |
Notify the application when ZID report data is received from the paired device.
PairingRef | Pairing reference. |
num_report_records | number of Report records. |
*zid_report_data_record_ptr | pointer to the report data received. |
RxLinkQuality | LQI value of the report data frame. |
RxFlags | Receive flags. |
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 |
Confirmation status to the application for its report data request.
Status | nwk status |
PairingRef | Pairing reference. |
References IDLE, indicate_fault_behavior(), LED0, LED_Off, node_status, NWK_SUCCESS, and report_id.
Referenced by app_task().
|
static |
Referenced by main().
|
static |
References aplHIDStdDescCompsList, app_alert(), APP_CAPABILITIES, CONNECTING, DEV_TYPE_REMOTE_CONTROL, DEV_TYPE_WILDCARD, FUNC_PTR, LED0, LED_Off, node_status, NUM_SUPPORTED_PROFILES, NWK_SUCCESS, PROFILE_ID_ZID, set_attribute_index, zid_connect_confirm(), and zid_org_connect_request().
Referenced by app_task().
key_state_t key_state = KEY_RELEASED |
Referenced by app_task(), and main().
|
static |
Referenced by app_task().
|
static |
|
static |
Referenced by app_task(), zid_connect_confirm(), and zid_get_report_indication().
|
static |
Referenced by app_task(), and zid_report_data_confirm().
|
static |
Referenced by app_task(), and zid_set_attribute_confirm().
|
static |