Microchip® Advanced Software Framework

netconn_http_stats_example/network/httpserver/httpd.h File Reference

Httpd server.

Copyright (c) 2013-2018 Microchip Technology Inc. and its subsidiaries.

Data Structures

struct  BoardStatus
 

Typedefs

typedef struct BoardStatus BoardStatus
 
typedef int(* http_handler_t )(struct netconn *client, const char *name, char *revc_buf, size_t revc_len)
 

Enumerations

enum  {
  HTTP_CONTENT_JSON = 0,
  HTTP_CONTENT_HTML,
  HTTP_CONTENT_CSS,
  HTTP_CONTENT_JS,
  HTTP_CONTENT_PNG,
  HTTP_CONTENT_JPEG,
  HTTP_CONTENT_GIF,
  HTTP_CONTENT_PLAIN,
  HTTP_CONTENT_CNT
}
 

Functions

const char * get_ext (const char *name)
 Get filename extension type. More...
 
int http_getValue (char *tolenized_buf, size_t tolenized_buf_len, const char *key, char *value, size_t len)
 Get key value from tokenized buffer. More...
 
void http_request (void *pvParameters)
 Core HTTP server function processing the request. More...
 
void http_sendInternalErr (struct netconn *client, int content_type)
 Send HTTP internal server error code. More...
 
void http_sendOk (struct netconn *client, int content_type)
 Send the HTTP header with the appropriated content type. More...
 
int http_tokenizeGetRequest (char *raw_buf, size_t raw_len)
 Tokenize a buffer. More...
 

Variables

BoardStatus status
 

typedef struct BoardStatus BoardStatus
typedef int(* http_handler_t)(struct netconn *client, const char *name, char *revc_buf, size_t revc_len)

anonymous enum
Enumerator
HTTP_CONTENT_JSON 
HTTP_CONTENT_HTML 
HTTP_CONTENT_CSS 
HTTP_CONTENT_JS 
HTTP_CONTENT_PNG 
HTTP_CONTENT_JPEG 
HTTP_CONTENT_GIF 
HTTP_CONTENT_PLAIN 
HTTP_CONTENT_CNT 

const char* get_ext ( const char *  name)

Get filename extension type.

Parameters
nameString containing a filename.
Returns
Extension type on success, NULL otherwise.

References NULL.

Referenced by cgi_search(), and http_searchContentType().

int http_getValue ( char *  tolenized_buf,
size_t  tolenized_buf_len,
const char *  key,
char *  value,
size_t  len 
)

Get key value from tokenized buffer.

References http_decodeUrl().

void http_request ( void *  pvParameters)
void http_sendInternalErr ( struct netconn *  client,
int  content_type 
)

Send HTTP internal server error code.

References content, http_content_type, and http_html_hdr_500.

Referenced by http_request().

void http_sendOk ( struct netconn *  client,
int  content_type 
)

Send the HTTP header with the appropriated content type.

Parameters
clientSocket to send data to.
content_typeIndex in the http_content_type table.

References content, http_content_type, and http_html_hdr_200.

Referenced by cgi_chipInfo(), cgi_status(), and http_request().

int http_tokenizeGetRequest ( char *  raw_buf,
size_t  raw_len 
)

Tokenize a buffer.

Parameters
raw_bufBuffer to parse.
raw_lenBuffer length.
Returns
The number of found tokens.

BoardStatus status

Referenced by ADC_Handler(), adp_interface_read_response(), anp_client_connected_state_handler(), anp_client_init(), anp_custom_event(), app_indication_confirmation_handler(), app_init(), app_notification_confirmation_handler(), app_read_response_cb(), apply_channel_settings(), at25dfx_read_status(), at45dbx_mem_check(), at45dbx_wait_ready(), at_app_send_lecb(), at_ble_addr_set(), at_ble_adv_start(), at_ble_att_error(), at_ble_authenticate(), at_ble_connect(), at_ble_disconnect(), at_ble_event_get(), at_ble_gap_error(), at_ble_init(), at_ble_scan_start(), atCmd_Connect_Handler(), atCmd_DisConnect_Handler(), atCmd_Iperf_Handler(), bas_send_notification(), bat_char_changed_event(), bat_custom_event(), bat_update_char_value(), battery_service_advertise(), battery_set_advertisement_data(), battery_simulation_task(), battery_start_advertisement(), ble_advertisement_data_set(), ble_char_changed_app_event(), ble_check_device_state(), ble_connected_device_role(), ble_disconnected_app_event(), ble_disconnected_device_role(), ble_mgr_events_callback_handler(), ble_observer_custom_event(), ble_trans_char_changed_event(), blp_disconnection(), blp_sensor_adv(), blp_sensor_app_custom_event(), blp_sensor_init(), blp_sensor_send_indication(), blp_sensor_send_notification(), blp_sensor_service_define(), BOARD_TWI_Handler(), brd_adv_init(), brd_set_advertisement_data(), brd_start_broadcast(), buffered_uart_tx(), cgi_status(), check_status(), check_valid_freq_range(), conf_fsk(), conf_leg_oqpsk(), conf_ofdm(), conf_oqpsk(), CONF_TEST_SPI_HANDLER(), conf_trx_modulation(), config_phy(), csc_prf_connected_state_handler(), csc_prf_init(), csc_serv_send_data(), dbg_le_get_bd_addr_req_handler(), dbg_le_set_bd_addr_req_handler(), dbg_rd_mem_req_handler(), dbg_rd_mem_req_handler32(), dbg_set_tx_pw_req_handler(), dbg_wr_mem_req_handler(), dbg_wr_mem_req_handler32(), dbg_wr_mem_req_handler32_reset(), demo_set_special_mode_status(), device_information_advertise(), dis_custom_event(), dump_trx_register_values(), eddystone_adv_start(), eddystone_adv_stop(), eddystone_app_init(), eddystone_create_tlm_frame(), eddystone_create_url_frame(), eddystone_custom_event(), eddystone_set_beacon_interval(), eddystone_set_power_mode(), eddystone_tlm_frame_send(), eddystone_uid_frame_send(), eddystone_url_frame_send(), esurl_char_changed_event(), esurl_conf_adv_start(), esurl_conf_chars_reset(), esurl_conf_service_init(), esurl_write_authorize_event(), event_get(), fmp_custom_event(), fmp_locator_connected_state_handler(), fmp_locator_pair_done_handler(), fmp_locator_service_discover(), fmp_target_connected_state_handler(), freertos_twi_read_packet_async(), freertos_twi_write_packet_async(), fsk_rfcfg(), gap_dev_scan(), gapc_bond_cfm_handler_key_exch(), gapc_bond_cfm_handler_pair_resp(), gapc_bond_cmd_handler(), gapc_cmp_evt(), gapc_connection_cfm_handler(), gapc_disconnect_cmd_handler(), gapc_encrypt_cfm_handler(), gapc_encrypt_cmd_handler(), gapc_get_info_cmd_handler(), gapc_get_tx_pwr_req_handler(), gapc_param_update_cfm_handler(), gapc_param_update_cmd_handler(), gapc_security_cmd_handler(), gapc_set_tx_pwr_req_handler(), gapm_cancel_cmd_handler(), gapm_connection_cfm_handler(), gapm_reset_req_handler(), gapm_resolv_addr_cmd_handler(), gapm_set_dev_config_cmd_handler(), gapm_set_dev_name_handler(), gapm_start_adv_cmd_handler(), gapm_start_connection_cmd_handler(), gapm_start_scan_cmd_handler(), gapm_white_list_mgm_cmd(), gattc_complete_evt_handler(), gattc_disc_cmd_handler(), gattc_execute_write_cmd_handler(), gattc_mtu_cmd_handler(), gattc_read_cmd_handler_by_uuid(), gattc_read_cmd_handler_multible(), gattc_read_cmd_handler_simple_read(), gattc_reg_to_peer_handler(), gattc_send_evt_cmd_handler(), gattc_svc_changed_notification_cmd_handler(), gattc_write_cmd_handler(), gattc_write_cmd_ind(), gattc_write_cmd_ind_handler(), get_supported_channels_tuple(), handle_incoming_frame(), hid_boot_keyboardreport_update(), hid_boot_mousereport_update(), hid_custom_event(), hid_get_reportchar(), hid_get_reportid(), hid_serv_report_update(), hid_service_dbreg(), hr_sensor_adv(), hr_sensor_app_custom_event(), hr_sensor_char_write_request(), hr_sensor_disconnect(), hr_sensor_init(), hr_sensor_send_notification(), hr_sensor_service_define(), htp_init(), htp_temperature_send(), htpt_custom_event(), htpt_set_advertisement_data(), interface_send_wait(), ksz8851snl_update(), l2cap_custom_event(), local_twi_handler(), m2m_ssl_cb(), mac_gen_mcps_data_conf(), mac_gen_mlme_gts_conf(), mac_process_tal_tx_status(), mac_reset(), main(), mem_read_capacity(), mem_test_unit_ready(), memory_2_ram(), memory_2_usb(), mlme_get(), mlme_reset_request(), mlme_set(), mlme_set_request(), multirole_app_custom_event(), mxt_init(), mxt_init_device(), mxt_probe_device(), mxt_process_messages(), mxt_read_info_block(), mxt_read_touch_event(), nwkTxConfirm(), ofdm_rfcfg(), oqpsk_rfcfg(), pal_timer_get_id(), pal_timer_start(), pal_timer_stop(), parse_mpdu(), pas_client_char_read_response_handler(), pas_client_char_write_response_handler(), pas_client_discovery_complete_handler(), pas_client_init(), pas_client_write_notifications(), pas_custom_event(), peer_search_initiator_tx_done_cb(), per_mode_receptor_tx_done_cb(), PHY_TaskHandler(), platform_event_wait(), platform_init(), pxp_monitor_app_custom_event(), pxp_monitor_encryption_change_handler(), pxp_monitor_pair_done_handler(), pxp_monitor_service_discover(), pxp_monitor_service_found_handler(), pxp_reporter_connected_state_handler(), pxp_reporter_custom_event(), ram_2_memory(), rssi_update(), RTT_Handler(), run_buffer_access_test(), run_byte_access_test(), run_memory_check_test(), run_supc_test(), send_reset_conf(), set_paramter_on_recptor_node(), set_tal_pib_internal(), sio2host_tx(), sio2ncp_tx(), smc_ecc_get_status(), SPI_Handler(), sps_custom_event(), sps_service_advertise(), start_ack_wait_timer(), start_backoff(), stream_mem_to_mem(), SysTick_Handler(), tal_pib_get(), tal_pib_set(), tal_pib_set_all(), tal_tx_frame_done_cb(), time_info_adv(), time_info_connected_state_handler(), tip_app_custom_event(), trans_update_ctrl_char_value(), trans_update_tx_char_value(), transceive_data(), trx_reset(), twi_master_init(), twi_master_read(), twi_master_write(), twi_slave_read(), twi_slave_write(), tx_done_handling(), udi_msc_process_trans(), udi_msc_trans_ack(), usb_2_memory(), usr_cont_pulse_tx_confirm(), usr_cont_wave_tx_confirm(), usr_ed_scan_start_confirm(), usr_get_current_config_confirm(), usr_identify_board_confirm(), usr_identify_peer_node_confirm(), usr_mcps_data_conf(), usr_mlme_gts_conf(), usr_mlme_reset_conf(), usr_mlme_set_conf(), usr_peer_disconnect_confirm(), usr_per_test_end_indication(), usr_per_test_start_confirm(), usr_perf_get_confirm(), usr_perf_set_confirm(), usr_perf_start_confirm(), usr_pkt_stream_confirm(), usr_range_test_start_confirm(), usr_range_test_stop_confirm(), usr_register_dump_confirm(), usr_register_read_confirm(), usr_register_write_confirm(), usr_rx_on_confirm(), usr_sensor_data_get_confirm(), usr_set_default_config_confirm(), wifi_provision_scanlist_receive(), wifiprov_disable(), wifiprov_scan_list_ind_send(), wifiprov_scan_mode_change_ind_send(), wifiprov_start(), and wifiprov_wifi_con_update().