Backend API

Table of Contents
cyg_modbus_response -- Provide MODBUS response
cyg_modbus_raw_pdu -- Access raw PDU buffer
cyg_modbus_response_nocopy -- Provide MODBUS response (no copy)
cyg_modbus_response_exception -- Provide MODBUS exception response
cyg_modbus_get_uid -- Read “Unit ID” of request

These functions are provided for the user application attached backend handler routines. They are used to provide responses back to the remote client, with the necessary control thread and transport layer information referenced by the opaque cyg_handle_t ctx parameter passed to the backend handler function.

For handlers that can provide immediate responses the functions can be called directly from the handler function (in the main MODBUS control thread context). If the handler cannot provide an immediate response, then the processing should be deferred to another thread which can then subsequently use the same API to deliver a response.

Note: For valid responses it is the responsibility of the handler function to return a correctly formatted PDU object to the client.

Documentation license for this page: eCosPro License