ProfinetConnector/src/profinet/profinet_cb_connect_ind.hpp

39 lines
2.2 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#pragma once
#include "../../libs/include/pnet_api.h"
/**
* Indication to the application that a Connect request was received from the
* controller.
*
* This application call-back function is called by the Profinet stack on every
* Connect request from the Profinet controller.
*
* The connection will be opened if this function returns 0 (zero) and the stack
* is otherwise able to establish a connection.
*
* If this function returns something other than 0 (zero) then the Connect
* request is refused by the device. In case of error the application should
* provide error information in \a p_result.
*
* It is optional to implement this callback (assumes success if not
* implemented).
*
* Индикация приложению о том, что от контроллера получен запрос на подключение.
* Эта функция обратного вызова приложения вызывается стеком Profinet при каждом запросе Connect от контроллера Profinet.
* Соединение будет открыто, если эта функция вернет 0 (ноль) и стек в противном случае сможет установить соединение.
* Если эта функция возвращает значение, отличное от 0 (нуля), то запрос на подключение отклоняется устройством.
* В случае ошибки приложение должно предоставить информацию об ошибке в p_result.
* Реализовать этот обратный вызов необязательно (предполагается успех, если он не реализован).
*
* @param net InOut: The p-net stack instance
* @param arg InOut: User-defined data (not used by p-net)
* @param arep In: The AREP.
* @param p_result Out: Detailed error information if return != 0.
* @return 0 on success.
* -1 if an error occurred.
*/
int profinet_cb_connect_ind( pnet_t * net,
void * arg,
uint32_t arep,
pnet_result_t * p_result);