static int32_t process_temperature_down ( const char* url_parameters, wiced_http_response_stream_t* stream, void* arg, wiced_http_message_body_t* http_data ); /****************************************************** * Variable Definitions ******************************************************/ static temp_data_t xively_data; static setpoint_t setpoint; static wiced_http_server_t http_server; static wiced_timed_event_t temperature_timed_event; static wiced_timed_event_t xively_timed_event; static gpio_keypad_t setpoint_control_keypad; static const configuration_entry_t const app_config[] = { {"Xively feed ID", DCT_OFFSET(user_dct_data_t, xively_feed_id), 11, CONFIG_STRING_DATA }, {"Xively API key", DCT_OFFSET(user_dct_data_t, xively_api_key), 49, CONFIG_STRING_DATA }, {"Xively Channel ID", DCT_OFFSET(user_dct_data_t, xively_channel_id), 51, CONFIG_STRING_DATA }, {"Sample interval (ms)", DCT_OFFSET(user_dct_data_t, sample_interval), 4 , CONFIG_UINT32_DATA }, {0,0,0,0} }; static START_OF_HTTP_PAGE_DATABASE(web_pages) ROOT_HTTP_PAGE_REDIRECT("/apps/temp_control/main.html"), { "/apps/temp_control/main.html", "text/html", WICED_RESOURCE_URL_CONTENT, .url_content.resource_data = &resources_apps_DIR_temp_control_DIR_main_html, }, { "/temp_report.html", "text/html", WICED_DYNAMIC_URL_CONTENT, .url_content.dynamic_data = {process_temperature_update, 0 }, }, { "/temp_up", "text/html", WICED_DYNAMIC_URL_CONTENT, .url_content.dynamic_data = {process_temperature_up, 0 }, }, { "/temp_down", "text/html", WICED_DYNAMIC_URL_CONTENT, .url_content.dynamic_data = {process_temperature_down, 0 }, }, { "/images/favicon.ico", "image/vnd.microsoft.icon", WICED_RESOURCE_URL_CONTENT, .url_content.resource_data = &resources_images_DIR_favicon_ico, }, { "/scripts/general_ajax_script.js", "application/javascript", WICED_RESOURCE_URL_CONTENT, .url_content.resource_data = &resources_scripts_DIR_general_ajax_script_js, }, { "/images/brcmlogo.png", "image/png", WICED_RESOURCE_URL_CONTENT, .url_content.resource_data = &resources_images_DIR_brcmlogo_png, },
/****************************************************** * Static Function Declarations ******************************************************/ static void light_keypad_handler( uart_key_code_t code, uart_key_event_t event ); static void curtain_keypad_handler( uart_key_code_t code, uart_key_event_t event ); static wiced_result_t device_init(); static void report_curtain_pos(void *arg); static void report_light_status(void *arg); /****************************************************** * Variable Definitions ******************************************************/ #if 0 static const configuration_entry_t app_config[] = { {"configured", DCT_OFFSET(smart_home_app_dct_t, device_configured), 4, CONFIG_UINT8_DATA }, {"device type", DCT_OFFSET(smart_home_app_dct_t, dev_type), 4, CONFIG_UINT8_DATA }, {"device index", DCT_OFFSET(smart_home_app_dct_t, dev_index), 4, CONFIG_UINT8_DATA }, {"device name", DCT_OFFSET(smart_home_app_dct_t, dev_name), 32, CONFIG_STRING_DATA }, {"light status", DCT_OFFSET(smart_home_app_dct_t, specific.light_config.light_status), 4, CONFIG_UINT8_DATA }, {"calibrated", DCT_OFFSET(smart_home_app_dct_t, specific.curtain_config.calibrated), 4, CONFIG_UINT8_DATA }, {"curr_pos_ms", DCT_OFFSET(smart_home_app_dct_t, specific.curtain_config.current_pos_ms), 4, CONFIG_UINT32_DATA }, {"full_pos_ms", DCT_OFFSET(smart_home_app_dct_t, specific.curtain_config.full_pos_ms), 4, CONFIG_UINT32_DATA }, {0,0,0,0} }; #endif static uart_keypad_t device_keypad; glob_info_t this_dev; //static wiced_semaphore_t link_up_semaphore; static const msg_type_t msg_bst_control = {0x42, 0x53, 0x54};