46 lines
2.5 KiB
C++
46 lines
2.5 KiB
C++
#pragma once
|
||
|
||
#include "../../libs/include/pnet_api.h"
|
||
|
||
/**
|
||
* Indication to the application that a DControl request was received from the
|
||
* controller. Typically this means that the controller is done writing
|
||
* parameters.
|
||
*
|
||
* This application call-back function is called by the Profinet stack on every
|
||
* DControl request from the Profinet controller.
|
||
*
|
||
* The application is not required to take any action but the function must
|
||
* return 0 (zero) for proper function of the stack. If this function returns
|
||
* something other than 0 (zero) then the DControl 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).
|
||
*
|
||
* Индикация приложению о том, что от контроллера получен запрос DControl. Обычно это означает, что контроллер закончил запись параметров.
|
||
*
|
||
* Эта функция обратного вызова приложения вызывается стеком Profinet при каждом запросе DControl от контроллера Profinet.
|
||
*
|
||
* От приложения не требуется никаких действий, но функция должна возвращать 0 (ноль) для правильной работы стека.
|
||
* Если эта функция возвращает значение, отличное от 0 (нуля), то запрос DControl отклоняется устройством.
|
||
* В случае ошибки приложение должно предоставить информацию об ошибке в \a 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 control_command In: The DControl command code.
|
||
* @param p_result Out: Detailed error information if return != 0.
|
||
* @return 0 on success.
|
||
* -1 if an error occurred.
|
||
*/
|
||
int profinet_cb_dcontrol_ind (
|
||
pnet_t * net,
|
||
void * arg,
|
||
uint32_t arep,
|
||
pnet_control_command_t control_command,
|
||
pnet_result_t * p_result); |