#include <ctype.h>
#include "conf_board.h"
#include <asf.h>
#include "app_config.h"
#include "led.h"
#include "delay.h"
#include "vendor_data.h"
#include "pb_pairing.h"
#include "common_sw_timer.h"
#include "zid.h"
Macros | |
#define | LED_DATA (LED0) |
#define | LED_DATA (LED0) |
#define | LED_NWK_SETUP (LED0) |
#define | LED_START (LED0) |
Typedefs | |
typedef enum node_status_tag | node_status_t |
Functions | |
static void | app_alert (void) |
static void | app_task (void) |
Application task. More... | |
FLASH_DECLARE (uint16_t VendorIdentifier) | |
FLASH_DECLARE (uint8_t vendor_string[7]) | |
FLASH_DECLARE (uint8_t app_user_string[15]) | |
static void | handle_input (uint8_t input_char) |
Handle keyboard input. More... | |
static void | led_handling (void *callback_parameter) |
Function to handle the LED States based on application state. More... | |
int | main (void) |
Main function, initialization and main message loop. More... | |
static void | nlme_get_confirm (nwk_enum_t Status, nib_attribute_t NIBAttribute, uint8_t NIBAttributeIndex, void *NIBAttributeValue) |
Notify the application of the status of its request for the value of a NIB attribute. More... | |
static void | nlme_reset_confirm (nwk_enum_t Status) |
Notify the application of the status of its request to reset the NWK layer. More... | |
static void | nlme_rx_enable_confirm (nwk_enum_t Status) |
Notify the application of the status of its rx enable request. More... | |
static void | nlme_start_confirm (nwk_enum_t Status) |
Notify the application of the status of its request to start the NWK. More... | |
static void | nlme_unpair_indication (uint8_t PairingRef) |
Notify the application of the removal of link by another device. More... | |
bool | pbp_allow_pairing (nwk_enum_t Status, uint64_t SrcIEEEAddr, uint16_t OrgVendorId, uint8_t OrgVendorString[7], uint8_t OrgUserString[15], uint8_t KeyExTransferCount) |
This function decides whether push button pairing request should be allowed. More... | |
static void | print_app_header (void) |
Print the head lines of the application to the terminal program. More... | |
static void | print_main_menu (void) |
Print main menu to terminal program. More... | |
static void | print_node_status (void) |
Print the node status to the terminal program. More... | |
static void | print_pairing_table (bool start_from_scratch, uint8_t *table_entry, uint8_t index) |
Print the pairing table to the terminal program. More... | |
static void | zid_connect_confirm (nwk_enum_t Status, uint8_t PairingRef) |
Notify the application of the status of its connect request. More... | |
static void | zid_heartbeat_indication (uint8_t PairingRef) |
Notify the application of the status of its heartbeat request. More... | |
static void | zid_indication_callback_init (void) |
This function registers the callback function for indications from the stack. 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) |
Notify the application when ZID report data is received from the paired device. More... | |
Variables | |
static uint8_t | APP_TIMER |
static bool | duplicate_pair_entry = false |
static node_status_t | node_status |
static uint8_t | number_of_paired_dev = 0 |
static nwk_indication_callback_t | nwk_ind |
static node_status_t | previous_node_status |
static zid_indication_callback_t | zid_ind |
#define LED_DATA (LED0) |
#define LED_DATA (LED0) |
#define LED_NWK_SETUP (LED0) |
Referenced by led_handling(), and main().
typedef enum node_status_tag node_status_t |
enum node_status_tag |
|
static |
|
static |
Application task.
References handle_input(), nwk_stack_idle(), and sio2host_getchar_nowait().
Referenced by main().
FLASH_DECLARE | ( | uint16_t | VendorIdentifier | ) |
FLASH_DECLARE | ( | uint8_t | vendor_string[7] | ) |
FLASH_DECLARE | ( | uint8_t | app_user_string[15] | ) |
|
static |
Handle keyboard input.
input_char | character typed from input device. |
References ALL_IN_ONE_START, APP_CAPABILITIES, DEVICE_TYPE_LIST_SIZE, FUNC_PTR, nlme_reset_confirm(), nlme_reset_request(), nlme_start_confirm(), nlme_start_request(), node_status, NULL, previous_node_status, print_main_menu(), print_pairing_table(), PRINTING_PAIRING_TABLE, PROFILE_ID_LIST_SIZE, RESETTING, STARTING, SUPPORTED_DEV_TYPE_0, SUPPORTED_PROFILE_ID_0, WARM_STARTING, zid_connect_confirm(), ZID_CONNECTING, and zid_rec_connect_request().
Referenced by app_task().
|
static |
Function to handle the LED States based on application state.
callback_parameter | callback parameter if any. |
References ALL_IN_ONE_START, APP_TIMER, FUNC_PTR, LED_DATA, LED_NWK_SETUP, LED_Off, LED_Toggle, node_status, NULL, SW_TIMEOUT_RELATIVE, sw_timer_start(), sw_timer_stop(), and ZID_CONNECTING.
|
static |
Notify the application of the status of its request for the value of a NIB attribute.
Status | nwk status |
NIBAttribute | NIBAttribute |
NIBAttributeIndex | NIBAttributeIndex |
NIBAttributeValue | Value of the NIB attribute. |
|
static |
Notify the application of the status of its request to reset the NWK layer.
Status | nwk status |
|
static |
Notify the application of the status of its rx enable request.
Status | nwk status |
|
static |
Notify the application of the status of its request to start the NWK.
Status | nwk status |
|
static |
Notify the application of the removal of link by another device.
The NLME-UNPAIR.indication primitive allows the NLME to notify the application of the removal of a pairing link by another device.
PairingRef | Pairing Ref for which entry is removed from pairing table. |
|
static |
Print the head lines of the application to the terminal program.
Referenced by print_main_menu().
|
static |
Print main menu to terminal program.
References print_app_header(), and print_node_status().
Referenced by handle_input().
|
static |
Print the node status to the terminal program.
References ALL_IN_ONE_START, FUNC_PTR, IDLE, nlme_get_confirm(), nlme_get_request(), node_status, number_of_paired_dev, nwkBaseChannel, PRINTING_PAIRING_TABLE, RESETTING, STARTING, and ZID_CONNECTING.
Referenced by print_main_menu().
|
static |
Print the pairing table to the terminal program.
start_from_scratch | Whether pairing table has to printed from scratch. |
table_entry | Table entry |
index | Index of the table entry to be printed. |
References pairing_table_tag::DestinationIEEEaddress, pairing_table_tag::DestinationLogicalChannel, pairing_table_tag::DestinationNetworkAddress, pairing_table_tag::DestinationPANidentifier, FUNC_PTR, nlme_get_confirm(), nlme_get_request(), nwkPairingTable, pairing_table_tag::RecipientCapabilities, pairing_table_tag::RecipientFrameCounter, pairing_table_tag::SecurityLinkKey, and pairing_table_tag::SourceNetworkAddress.
Referenced by handle_input().
|
static |
Notify the application of the status of its connect request.
Status | nwk status. |
PairingRef | Pairing reference. |
References duplicate_pair_entry, IDLE, node_status, number_of_paired_dev, and NWK_SUCCESS.
Referenced by handle_input().
|
static |
Notify the application of the status of its heartbeat request.
PairingRef | Pairing reference. |
|
static |
This function registers the callback function for indications from the stack.
|
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, pinch_gesture_report_tag::center_x, pinch_gesture_report_tag::center_y, sync_report_tag::contact_count, CONTACT_DATA, contact_data_report_tag::contact_index, contact_data_report_tag::contact_state, contact_data_report_tag::contact_type, 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, tap_gesture_report_tag::finger_count, scroll_gesture_report_tag::finger_count, pinch_gesture_report_tag::finger_present, rotation_gesture_report_tag::finger_present, sync_report_tag::gesture, touch_sensor_properties_tag::gestures, INPUT, keyboard_input_desc_tag::key_code, KEYBOARD, contact_data_report_tag::location_x, tap_gesture_report_tag::location_x, contact_data_report_tag::location_y, tap_gesture_report_tag::location_y, tap_support_properties_tag::long_tap, rotation_gesture_report_tag::magnitude, contact_data_report_tag::major_axis_length, contact_data_report_tag::major_axis_orientation, touch_sensor_properties_tag::max_coordinate_x, touch_sensor_properties_tag::max_coordinate_y, contact_data_report_tag::minor_axis_length, keyboard_input_desc_tag::modifier_keys, MOUSE, touch_sensor_properties_tag::no_of_additional_contacts, touch_sensor_properties_tag::origin, PINCH_GESTURE, contact_data_report_tag::pressure, touch_sensor_properties_tag::reliable_index, zid_report_data_record_tag::report_desc_identifier, zid_report_data_record_tag::report_type, touch_sensor_properties_tag::resolution_x, touch_sensor_properties_tag::resolution_y, ROTATE_GESTURE, SCROLL_GESTURE, touch_sensor_properties_tag::shape, tap_support_properties_tag::single_tap, SYNC, tap_support_properties_tag::tap_and_a_half, TAP_GESTURE, TAP_SUPPORT_PROPERTIES, TOUCH_SENSOR_PROPERTIES, tap_gesture_report_tag::type, scroll_gesture_report_tag::type, mouse_desc_tag::x_coordinate, and mouse_desc_tag::y_coordinate.
|
static |
Referenced by led_handling(), and main().
|
static |
Referenced by zid_connect_confirm().
|
static |
Referenced by handle_input(), led_handling(), print_node_status(), and zid_connect_confirm().
|
static |
Referenced by print_node_status(), and zid_connect_confirm().
|
static |
|
static |
Referenced by handle_input().
|
static |