Function esp_idf_svc::hal::sys::protocomm_add_endpoint

source ยท
pub unsafe extern "C" fn protocomm_add_endpoint(
    pc: *mut protocomm,
    ep_name: *const i8,
    h: Option<unsafe extern "C" fn(_: u32, _: *const u8, _: isize, _: *mut *mut u8, _: *mut isize, _: *mut c_void) -> i32>,
    priv_data: *mut c_void,
) -> i32
Expand description

@brief Add endpoint request handler for a protocomm instance

This API will bind an endpoint handler function to the specified endpoint name, along with any private data that needs to be pass to the handler at the time of call.

@note

  • An endpoint must be bound to a valid protocomm instance, created using protocomm_new().
  • This function internally calls the registered add_endpoint() function of the selected transport which is a member of the protocomm_t instance structure.

@param[in] pc Pointer to the protocomm instance @param[in] ep_name Endpoint identifier(name) string @param[in] h Endpoint handler function @param[in] priv_data Pointer to private data to be passed as a parameter to the handler function on call. Pass NULL if not needed.

@return

  • ESP_OK : Success
  • ESP_FAIL : Error adding endpoint / Endpoint with this name already exists
  • ESP_ERR_NO_MEM : Error allocating endpoint resource
  • ESP_ERR_INVALID_ARG : Null instance/name/handler arguments