\doxysection{modbus\+\_\+slave.\+c}
\hypertarget{modbus__slave_8c_source}{}\label{modbus__slave_8c_source}\index{E:/.WORK/STM32/Diod\_Test/diode\_tester/Core/Modbus/Src/modbus\_slave.c@{E:/.WORK/STM32/Diod\_Test/diode\_tester/Core/Modbus/Src/modbus\_slave.c}}
\mbox{\hyperlink{modbus__slave_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00001}00001\ \textcolor{comment}{/**\ }}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00002}00002\ \textcolor{comment}{*******************************************************************************}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00003}00003\ \textcolor{comment}{*\ @file\ modbus\_slave.c}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00004}00004\ \textcolor{comment}{*\ @brief\ Модуль\ для\ реализации\ слейв\ MODBUS.}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00005}00005\ \textcolor{comment}{*******************************************************************************\ }}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00006}00006\ \textcolor{comment}{*\ @details\ }}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00007}00007\ \textcolor{comment}{Файл\ содержит\ реализацию\ функций\ для\ работы\ Modbus\ в\ режиме\ слейва.}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00008}00008\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00009}00009\ \textcolor{comment}{@section\ slave\ Функции\ и\ макросы}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00010}00010\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00011}00011\ \textcolor{comment}{-\/\ MB\_Slave\_Response()\ \ \ \ \ \ \ \ \ —\ Ответ\ на\ запрос}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00012}00012\ \textcolor{comment}{-\/\ MB\_Slave\_Collect\_Message()\ \ —\ Сбор\ сообщения\ в\ режиме\ слейва.}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00013}00013\ \textcolor{comment}{-\/\ MB\_Slave\_Parse\_Message()\ \ \ \ —\ Парс\ сообщения\ в\ режиме\ слейва.}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00014}00014\ \textcolor{comment}{******************************************************************************/}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00015}00015\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{modbus_8h}{modbus.h}}"{}}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00016}00016\ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00017}00017\ \textcolor{preprocessor}{\#ifdef\ MODBUS\_ENABLE\_SLAVE}\textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00018}00018\ \textcolor{comment}{/**\ }}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00019}00019\ \textcolor{comment}{\ \ *\ @brief\ \ \ \ Ответ\ на\ сообщение\ в\ режиме\ слейва.}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00020}00020\ \textcolor{comment}{\ \ *\ @param\ \ \ \ hmodbus\ \ \ \ \ Указатель\ на\ хендлер\ RS.}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00021}00021\ \textcolor{comment}{\ \ *\ @param\ \ \ \ modbus\_msg\ \ Указатель\ на\ структуру\ сообщения.}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00022}00022\ \textcolor{comment}{\ \ *\ @return\ \ \ RS\_RES\ \ Статус\ о\ результате\ ответа\ на\ комманду.}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00023}00023\ \textcolor{comment}{\ \ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00024}\mbox{\hyperlink{group___m_o_d_b_u_s___s_l_a_v_e_gacb44db7ef6ef32b08f4ffe0178eabee8}{00024}}\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga727154b368397b4796aa892de12a2289}{RS\_StatusTypeDef}}\ \mbox{\hyperlink{group___m_o_d_b_u_s___s_l_a_v_e_gacb44db7ef6ef32b08f4ffe0178eabee8}{MB\_Slave\_Response}}(\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\_HandleTypeDef}}\ *hmodbus,\ \mbox{\hyperlink{struct_r_s___msg_type_def}{RS\_MsgTypeDef}}\ *modbus\_msg)}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00025}00025\ \{}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00026}00026\ \ \ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga727154b368397b4796aa892de12a2289}{RS\_StatusTypeDef}}\ MB\_RES\ =\ 0;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00027}00027\ \ \ hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6fa98c2955d01e07dc59f73d072bb37e}{f}}.\mbox{\hyperlink{struct_r_s___flags_type_def_a98c9a17358406818f3017a2997787c3f}{MessageHandled}}\ =\ 0;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00028}00028\ \ \ hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6fa98c2955d01e07dc59f73d072bb37e}{f}}.\mbox{\hyperlink{struct_r_s___flags_type_def_a5f8d7960b41717c6edb84fc7bfc06d41}{EchoResponse}}\ =\ 0;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00029}00029\ \ \ RS\_Reset\_TX\_Flags(hmodbus);\ \ \ \ \ \textcolor{comment}{//\ reset\ flag\ for\ correct\ transmit}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00030}00030\ \ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00031}00031\ \ \ \mbox{\hyperlink{group___m_o_d_b_u_s___d_a_t_a___a_c_c_e_s_s___f_u_n_c_t_i_o_n_s_gae379458fa9cea50d5e313a68e716cb83}{MB\_Diagnostics\_BusMessageCnt}}();}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00032}00032\ \ \ \textcolor{keywordflow}{if}(hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a01e2c95a23aa3eed1f002e2329a10942}{ID}}\ ==\ 0\ ||\ modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a277ed439b65aedbf03bd112c073e6a32}{MbAddr}}\ ==\ 0)}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00033}00033\ \ \ \{}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00034}00034\ \ \ \ \ \mbox{\hyperlink{group___m_o_d_b_u_s___d_a_t_a___a_c_c_e_s_s___f_u_n_c_t_i_o_n_s_gabf80c0e24a0ed3736338218c003d001d}{MB\_Diagnostics\_SlaveNoResponseCnt}}();\ \ \textcolor{comment}{//\ <-\/-\/\ Устройство\ не\ отвечает\ на\ широковещательные\ сообщения}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00035}00035\ \ \ \ \ hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a8bbcb263ae7a61790b559bcb55cd9aa9}{RS\_STATUS}}\ =\ RS\_SKIP;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00036}00036\ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_gab43a3b93c85adee5e3c561922d7ea2ef}{RS\_Handle\_Receive\_Start}}(hmodbus,\ modbus\_msg);}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00037}00037\ \ \ \}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00038}00038\ \ \ \mbox{\hyperlink{group___m_o_d_b_u_s___d_a_t_a___a_c_c_e_s_s___f_u_n_c_t_i_o_n_s_ga22a48a04ef64f74b5974c4fdb1445936}{MB\_Diagnostics\_SlaveMessageCnt}}();}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00039}00039\ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00040}00040\ \ \ \textcolor{keywordflow}{if}(modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a176d779ab0d7fd06a4303e6e6acb6ca9}{FuncCode}}\ <\ \mbox{\hyperlink{group___m_o_d_b_u_s___m_e_s_s_a_g_e___d_e_f_i_n_e_s_ga822b0fd9ae9ff25dfa6748473e8e8627}{FC\_ERR\_VALUES\_START}})\textcolor{comment}{//\ if\ no\ errors\ after\ parsing}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00041}00041\ \ \ \{}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00042}00042\ \ \ \ \ \textcolor{keywordflow}{switch}\ (modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a176d779ab0d7fd06a4303e6e6acb6ca9}{FuncCode}})}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00043}00043\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00044}00044\ \ \ \ \ \ \ \textcolor{comment}{//\ Read\ Coils}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00045}00045\ \ \ \ \ \ \ \textcolor{keywordflow}{case}\ \mbox{\hyperlink{group___m_o_d_b_u_s___m_e_s_s_a_g_e___d_e_f_i_n_e_s_gga38d42495bf262b70048e6d6a7af175d2a399bcd53bc32faca81bbc3d1ff8b5bb6}{FC\_R\_COILS}}:\ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00046}00046\ \ \ \ \ \ \ \ \ hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6fa98c2955d01e07dc59f73d072bb37e}{f}}.\mbox{\hyperlink{struct_r_s___flags_type_def_a98c9a17358406818f3017a2997787c3f}{MessageHandled}}\ =\ \ \ \mbox{\hyperlink{group___m_o_d_b_u_s___c_m_d___p_r_o_c_e_s_s___f_u_n_c_t_i_o_n_s_ga39a02e8e4911a74a619d2ef29adcbad8}{MB\_Process\_Read\_Coils}}(hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6a3f47a1a3476d6e9df997e1dc9da8c4}{pMessagePtr}});}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00047}00047\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00048}00048\ \ \ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00049}00049\ \ \ \ \ \ \ \textcolor{comment}{//\ Read\ Hodling\ Registers}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00050}00050\ \ \ \ \ \ \ \textcolor{keywordflow}{case}\ \mbox{\hyperlink{group___m_o_d_b_u_s___m_e_s_s_a_g_e___d_e_f_i_n_e_s_gga38d42495bf262b70048e6d6a7af175d2ae03921b16750ef290fdd7d19a08a29a2}{FC\_R\_HOLD\_REGS}}:}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00051}00051\ \ \ \ \ \ \ \ \ hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6fa98c2955d01e07dc59f73d072bb37e}{f}}.\mbox{\hyperlink{struct_r_s___flags_type_def_a98c9a17358406818f3017a2997787c3f}{MessageHandled}}\ =\ \ \ \mbox{\hyperlink{group___m_o_d_b_u_s___c_m_d___p_r_o_c_e_s_s___f_u_n_c_t_i_o_n_s_gac28127757ba25fe0b611612a785f663b}{MB\_Process\_Read\_Hold\_Regs}}(hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6a3f47a1a3476d6e9df997e1dc9da8c4}{pMessagePtr}});}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00052}00052\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00053}00053\ \ \ \ \ \ \ \textcolor{keywordflow}{case}\ \mbox{\hyperlink{group___m_o_d_b_u_s___m_e_s_s_a_g_e___d_e_f_i_n_e_s_gga38d42495bf262b70048e6d6a7af175d2a76139e9b7ae78856fd3a297c9f751944}{FC\_R\_IN\_REGS}}:\ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00054}00054\ \ \ \ \ \ \ \ \ hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6fa98c2955d01e07dc59f73d072bb37e}{f}}.\mbox{\hyperlink{struct_r_s___flags_type_def_a98c9a17358406818f3017a2997787c3f}{MessageHandled}}\ =\ \ \ \mbox{\hyperlink{group___m_o_d_b_u_s___c_m_d___p_r_o_c_e_s_s___f_u_n_c_t_i_o_n_s_gad13d010f43c7ab08a85667b9e1906b7d}{MB\_Process\_Read\_Input\_Regs}}(hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6a3f47a1a3476d6e9df997e1dc9da8c4}{pMessagePtr}});}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00055}00055\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00056}00056\ \ \ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00057}00057\ \ \ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00058}00058\ \ \ \ \ \ \ \textcolor{comment}{//\ Write\ Single\ Coils}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00059}00059\ \ \ \ \ \ \ \textcolor{keywordflow}{case}\ \mbox{\hyperlink{group___m_o_d_b_u_s___m_e_s_s_a_g_e___d_e_f_i_n_e_s_gga38d42495bf262b70048e6d6a7af175d2a832b94af2c427d0daae721da2528f44a}{FC\_W\_COIL}}:\ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00060}00060\ \ \ \ \ \ \ \ \ hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6fa98c2955d01e07dc59f73d072bb37e}{f}}.\mbox{\hyperlink{struct_r_s___flags_type_def_a98c9a17358406818f3017a2997787c3f}{MessageHandled}}\ =\ \mbox{\hyperlink{group___m_o_d_b_u_s___c_m_d___p_r_o_c_e_s_s___f_u_n_c_t_i_o_n_s_ga918102931c9125a5e44a30e103d17e14}{MB\_Process\_Write\_Single\_Coil}}(hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6a3f47a1a3476d6e9df997e1dc9da8c4}{pMessagePtr}});\ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00061}00061\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}(hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6fa98c2955d01e07dc59f73d072bb37e}{f}}.\mbox{\hyperlink{struct_r_s___flags_type_def_a98c9a17358406818f3017a2997787c3f}{MessageHandled}})\ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00062}00062\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00063}00063\ \ \ \ \ \ \ \ \ \ \ hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6fa98c2955d01e07dc59f73d072bb37e}{f}}.\mbox{\hyperlink{struct_r_s___flags_type_def_a4f26eda2d03a726d98fa6623f1abb814}{DataUpdated}}\ =\ 1;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00064}00064\ \ \ \ \ \ \ \ \ \ \ hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6fa98c2955d01e07dc59f73d072bb37e}{f}}.\mbox{\hyperlink{struct_r_s___flags_type_def_a5f8d7960b41717c6edb84fc7bfc06d41}{EchoResponse}}\ =\ 1;\ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00065}00065\ \ \ \ \ \ \ \ \ \ \ hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a495a29011412451e53459f9e1513814d}{RS\_Message\_Size}}\ -\/=\ 2;\ \textcolor{comment}{//\ echo\ response\ if\ write\ ok\ (minus\ 2\ cause\ of\ two\ CRC\ bytes)}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00066}00066\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00067}00067\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00068}00068\ \ \ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00069}00069\ \ \ \ \ \ \ \textcolor{keywordflow}{case}\ \mbox{\hyperlink{group___m_o_d_b_u_s___m_e_s_s_a_g_e___d_e_f_i_n_e_s_gga38d42495bf262b70048e6d6a7af175d2a1b66683f704ef9072329e997312e3b83}{FC\_W\_HOLD\_REG}}:\ \ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00070}00070\ \ \ \ \ \ \ \ \ hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6fa98c2955d01e07dc59f73d072bb37e}{f}}.\mbox{\hyperlink{struct_r_s___flags_type_def_a98c9a17358406818f3017a2997787c3f}{MessageHandled}}\ =\ \mbox{\hyperlink{group___m_o_d_b_u_s___c_m_d___p_r_o_c_e_s_s___f_u_n_c_t_i_o_n_s_ga02e192a3d9f31737c45f074a04b37648}{MB\_Process\_Write\_Single\_Reg}}(hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6a3f47a1a3476d6e9df997e1dc9da8c4}{pMessagePtr}});\ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00071}00071\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}(hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6fa98c2955d01e07dc59f73d072bb37e}{f}}.\mbox{\hyperlink{struct_r_s___flags_type_def_a98c9a17358406818f3017a2997787c3f}{MessageHandled}})\ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00072}00072\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00073}00073\ \ \ \ \ \ \ \ \ \ \ hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6fa98c2955d01e07dc59f73d072bb37e}{f}}.\mbox{\hyperlink{struct_r_s___flags_type_def_a4f26eda2d03a726d98fa6623f1abb814}{DataUpdated}}\ =\ 1;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00074}00074\ \ \ \ \ \ \ \ \ \ \ hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6fa98c2955d01e07dc59f73d072bb37e}{f}}.\mbox{\hyperlink{struct_r_s___flags_type_def_a5f8d7960b41717c6edb84fc7bfc06d41}{EchoResponse}}\ =\ 1;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00075}00075\ \ \ \ \ \ \ \ \ \ \ hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a495a29011412451e53459f9e1513814d}{RS\_Message\_Size}}\ -\/=\ 2;\ \textcolor{comment}{//\ echo\ response\ if\ write\ ok\ (minus\ 2\ cause\ of\ two\ CRC\ bytes)}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00076}00076\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00077}00077\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00078}00078\ \ \ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00079}00079\ \ \ \ \ \ \ \textcolor{comment}{//\ Write\ Multiple\ Coils}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00080}00080\ \ \ \ \ \ \ \textcolor{keywordflow}{case}\ \mbox{\hyperlink{group___m_o_d_b_u_s___m_e_s_s_a_g_e___d_e_f_i_n_e_s_gga38d42495bf262b70048e6d6a7af175d2a43a1b810697ea15ef91008dbc0187127}{FC\_W\_COILS}}:\ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00081}00081\ \ \ \ \ \ \ \ \ hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6fa98c2955d01e07dc59f73d072bb37e}{f}}.\mbox{\hyperlink{struct_r_s___flags_type_def_a98c9a17358406818f3017a2997787c3f}{MessageHandled}}\ =\ \ \ \mbox{\hyperlink{group___m_o_d_b_u_s___c_m_d___p_r_o_c_e_s_s___f_u_n_c_t_i_o_n_s_ga6f4498cec8634820025aaa9c4623ba55}{MB\_Process\_Write\_Miltuple\_Coils}}(hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6a3f47a1a3476d6e9df997e1dc9da8c4}{pMessagePtr}});}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00082}00082\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}(hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6fa98c2955d01e07dc59f73d072bb37e}{f}}.\mbox{\hyperlink{struct_r_s___flags_type_def_a98c9a17358406818f3017a2997787c3f}{MessageHandled}})\ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00083}00083\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00084}00084\ \ \ \ \ \ \ \ \ \ \ hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6fa98c2955d01e07dc59f73d072bb37e}{f}}.\mbox{\hyperlink{struct_r_s___flags_type_def_a4f26eda2d03a726d98fa6623f1abb814}{DataUpdated}}\ =\ 1;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00085}00085\ \ \ \ \ \ \ \ \ \ \ hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6fa98c2955d01e07dc59f73d072bb37e}{f}}.\mbox{\hyperlink{struct_r_s___flags_type_def_a5f8d7960b41717c6edb84fc7bfc06d41}{EchoResponse}}\ =\ 1;\ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00086}00086\ \ \ \ \ \ \ \ \ \ \ hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a495a29011412451e53459f9e1513814d}{RS\_Message\_Size}}\ =\ 6;\ \textcolor{comment}{//\ echo\ response\ if\ write\ ok\ (withous\ data\ bytes)}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00087}00087\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00088}00088\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00089}00089\ \ \ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00090}00090\ \ \ \ \ \ \ \textcolor{comment}{//\ Write\ Multiple\ Registers}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00091}00091\ \ \ \ \ \ \ \textcolor{keywordflow}{case}\ \mbox{\hyperlink{group___m_o_d_b_u_s___m_e_s_s_a_g_e___d_e_f_i_n_e_s_gga38d42495bf262b70048e6d6a7af175d2affa24c54ee0b59e9810f1dbdc949e684}{FC\_W\_HOLD\_REGS}}:}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00092}00092\ \ \ \ \ \ \ \ \ hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6fa98c2955d01e07dc59f73d072bb37e}{f}}.\mbox{\hyperlink{struct_r_s___flags_type_def_a98c9a17358406818f3017a2997787c3f}{MessageHandled}}\ =\ \ \ \mbox{\hyperlink{group___m_o_d_b_u_s___c_m_d___p_r_o_c_e_s_s___f_u_n_c_t_i_o_n_s_ga9c6ab159edb8dda6548b2228773ce919}{MB\_Process\_Write\_Miltuple\_Regs}}(hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6a3f47a1a3476d6e9df997e1dc9da8c4}{pMessagePtr}});}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00093}00093\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}(hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6fa98c2955d01e07dc59f73d072bb37e}{f}}.\mbox{\hyperlink{struct_r_s___flags_type_def_a98c9a17358406818f3017a2997787c3f}{MessageHandled}})\ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00094}00094\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00095}00095\ \ \ \ \ \ \ \ \ \ \ hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6fa98c2955d01e07dc59f73d072bb37e}{f}}.\mbox{\hyperlink{struct_r_s___flags_type_def_a4f26eda2d03a726d98fa6623f1abb814}{DataUpdated}}\ =\ 1;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00096}00096\ \ \ \ \ \ \ \ \ \ \ hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6fa98c2955d01e07dc59f73d072bb37e}{f}}.\mbox{\hyperlink{struct_r_s___flags_type_def_a5f8d7960b41717c6edb84fc7bfc06d41}{EchoResponse}}\ =\ 1;\ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00097}00097\ \ \ \ \ \ \ \ \ \ \ hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a495a29011412451e53459f9e1513814d}{RS\_Message\_Size}}\ =\ 6;\ \textcolor{comment}{//\ echo\ response\ if\ write\ ok\ (withous\ data\ bytes)}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00098}00098\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00099}00099\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00100}00100\ \ \ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00101}00101\ \ \ \ \ \ \ \textcolor{keywordflow}{case}\ \mbox{\hyperlink{group___m_o_d_b_u_s___m_e_s_s_a_g_e___d_e_f_i_n_e_s_gga38d42495bf262b70048e6d6a7af175d2a37ddf147e08b6d205319c31e6750d47c}{FC\_R\_DEVICE\_ID}}:}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00102}00102\ \ \ \ \ \ \ \ \ hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6fa98c2955d01e07dc59f73d072bb37e}{f}}.\mbox{\hyperlink{struct_r_s___flags_type_def_a98c9a17358406818f3017a2997787c3f}{MessageHandled}}\ =\ \ \ \mbox{\hyperlink{group___m_o_d_b_u_s___c_m_d___p_r_o_c_e_s_s___f_u_n_c_t_i_o_n_s_ga279ce6d9d175a43714862dc6661e7096}{MB\_Process\_Read\_Device\_Identifications}}(hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6a3f47a1a3476d6e9df997e1dc9da8c4}{pMessagePtr}});}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00103}00103\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00104}00104\ \ \ \ \ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00105}00105\ \ \ \ \ \ \ \textcolor{comment}{//\ Добавить\ в\ switch-\/case\ после\ других\ case:}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00106}00106\ \ \ \ \ \ \ \textcolor{keywordflow}{case}\ \mbox{\hyperlink{group___m_o_d_b_u_s___m_e_s_s_a_g_e___d_e_f_i_n_e_s_gga38d42495bf262b70048e6d6a7af175d2aa6423de9e908dc38ce9f1c8027ad72ec}{FC\_R\_DIAGNOSTICS}}:}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00107}00107\ \ \ \ \ \ \ \ \ \ \ hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6fa98c2955d01e07dc59f73d072bb37e}{f}}.\mbox{\hyperlink{struct_r_s___flags_type_def_a98c9a17358406818f3017a2997787c3f}{MessageHandled}}\ =\ \mbox{\hyperlink{group___m_o_d_b_u_s___c_m_d___p_r_o_c_e_s_s___f_u_n_c_t_i_o_n_s_ga6bbfc53b20b4698a08d79851b5db65f0}{MB\_Process\_Diagnostics}}(hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6a3f47a1a3476d6e9df997e1dc9da8c4}{pMessagePtr}});}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00108}00108\ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00109}00109\ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00110}00110\ \ \ \ \ \ \ \textcolor{comment}{/*\ unknown\ func\ code\ */}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00111}00111\ \ \ \ \ \ \ \textcolor{keywordflow}{default}:\ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00112}00112\ \ \ \ \ \ \ \ \ modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a3dab5eaf3a1dd5719b8bfec1adad0d39}{Except\_Code}}\ =\ 0x01;\ \textcolor{comment}{/*\ set\ exception\ code:\ illegal\ function\ */}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00113}00113\ \ \ \ \ \}\ \ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00114}00114\ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00115}00115\ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00116}00116\ \ \ \ \ \textcolor{comment}{//\ Проверяем\ режим\ устройства\ -\/\ если\ Listen\ Only,\ не\ обрабатываем\ команды}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00117}00117\ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{group___m_o_d_b_u_s___d_a_t_a___a_c_c_e_s_s___f_u_n_c_t_i_o_n_s_gae7b613f24e9e3d9d95a789c404a3a485}{MB\_GetDeviceMode}}()\ ==\ MODBUS\_LISTEN\_ONLY\_MODE)}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00118}00118\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00119}00119\ \ \ \ \ \ \ \mbox{\hyperlink{group___m_o_d_b_u_s___d_a_t_a___a_c_c_e_s_s___f_u_n_c_t_i_o_n_s_gabf80c0e24a0ed3736338218c003d001d}{MB\_Diagnostics\_SlaveNoResponseCnt}}();}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00120}00120\ \ \ \ \ \ \ hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a8bbcb263ae7a61790b559bcb55cd9aa9}{RS\_STATUS}}\ =\ RS\_SKIP;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00121}00121\ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_gab43a3b93c85adee5e3c561922d7ea2ef}{RS\_Handle\_Receive\_Start}}(hmodbus,\ modbus\_msg);;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00122}00122\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00123}00123\ \ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00124}00124\ \ \ \ \ \textcolor{comment}{//\ Проверяем\ статус\ обработки\ запроса}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00125}00125\ \ \ \ \ \textcolor{keywordflow}{if}(hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6fa98c2955d01e07dc59f73d072bb37e}{f}}.\mbox{\hyperlink{struct_r_s___flags_type_def_a98c9a17358406818f3017a2997787c3f}{MessageHandled}}\ ==\ 0)}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00126}00126\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00127}00127\ \ \ \ \ \ \ \mbox{\hyperlink{group___m_o_d_b_u_s___d_a_t_a___a_c_c_e_s_s___f_u_n_c_t_i_o_n_s_ga82e0bf0c4452c25bf3f05a20abb7cc74}{MB\_Diagnostics\_ExceptionErrorCnt}}();}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00128}00128\ \ \ \ \ \ \ \mbox{\hyperlink{group___r_s___d_e_b_u_g_ga8017fb05a56a1b667244f1f786fa9c57}{TrackerCnt\_Warn}}(hmodbus-\/>rs\_err);}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00129}00129\ \ \ \ \ \ \ modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a176d779ab0d7fd06a4303e6e6acb6ca9}{FuncCode}}\ |=\ \mbox{\hyperlink{group___m_o_d_b_u_s___m_e_s_s_a_g_e___d_e_f_i_n_e_s_ga822b0fd9ae9ff25dfa6748473e8e8627}{FC\_ERR\_VALUES\_START}};}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00130}00130\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00131}00131\ \ \ \ \ \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00132}00132\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00133}00133\ \ \ \ \ \ \ \mbox{\hyperlink{group___r_s___d_e_b_u_g_ga23de0006aa08984cfeddb6aa5e512fa1}{TrackerCnt\_Ok}}(hmodbus-\/>rs\_err);}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00134}00134\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00135}00135\ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00136}00136\ \ \ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00137}00137\ \ \ \}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00138}00138\ \ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00139}00139\ \ \ \textcolor{comment}{//\ if\ we\ need\ response\ -\/\ check\ that\ transmit\ isnt\ busy}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00140}00140\ \ \ \textcolor{keywordflow}{if}(\ RS\_Is\_TX\_Busy(hmodbus)\ )\ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00141}00141\ \ \ \ \ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga1ffe808b3640f253b1783295d6990962}{RS\_Abort}}(hmodbus,\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ggab7c55bd8bb15b0eecc8c525019d4a1cca95c6ce0fee466ba98e43213d001ecc16}{ABORT\_TX}});\ \ \ \ \textcolor{comment}{//\ if\ tx\ busy\ -\/\ set\ it\ free}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00142}00142\ \ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00143}00143\ \ \ \textcolor{comment}{//\ Transmit\ right\ there,\ or\ sets\ (fDeferredResponse)\ to\ transmit\ response\ in\ main\ code\ \ }}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00144}00144\ \ \ \textcolor{keywordflow}{if}(hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6fa98c2955d01e07dc59f73d072bb37e}{f}}.\mbox{\hyperlink{struct_r_s___flags_type_def_a63ea1ac11725b29af72afb2942766633}{DeferredResponse}}\ ==\ 0)}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00145}00145\ \ \ \{}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00146}00146\ \ \ \ \ MB\_RES\ =\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga330f6cfcdaab1f239054c0d91be3c5bc}{RS\_Handle\_Transmit\_Start}}(hmodbus,\ modbus\_msg);}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00147}00147\ \ \ \}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00148}00148\ \ \ \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00149}00149\ \ \ \{}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00150}00150\ \ \ \ \ \mbox{\hyperlink{group___r_s___t_o_o_l_s_gab43a3b93c85adee5e3c561922d7ea2ef}{RS\_Handle\_Receive\_Start}}(hmodbus,\ modbus\_msg);}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00151}00151\ \ \ \ \ hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6fa98c2955d01e07dc59f73d072bb37e}{f}}.\mbox{\hyperlink{struct_r_s___flags_type_def_a63ea1ac11725b29af72afb2942766633}{DeferredResponse}}\ =\ 0;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00152}00152\ \ \ \}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00153}00153\ \ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00154}00154\ \ \ hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a8bbcb263ae7a61790b559bcb55cd9aa9}{RS\_STATUS}}\ =\ MB\_RES;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00155}00155\ \ \ \textcolor{keywordflow}{return}\ MB\_RES;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00156}00156\ \}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00157}00157\ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00158}00158\ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00159}00159\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00160}00160\ \textcolor{comment}{/**\ }}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00161}00161\ \textcolor{comment}{\ \ *\ @brief\ \ \ \ Сбор\ сообщения\ в\ буфер\ UART\ в\ режиме\ слейв\ (фрейм\ слейва\ из\ msg\ -\/>\ uart).}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00162}00162\ \textcolor{comment}{\ \ *\ @param\ \ \ \ hmodbus\ \ \ \ \ \ \ \ \ \ \ Указатель\ на\ хендлер\ RS.}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00163}00163\ \textcolor{comment}{\ \ *\ @param\ \ \ \ modbus\_msg\ \ \ \ \ \ \ \ Указатель\ на\ структуру\ сообщения.}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00164}00164\ \textcolor{comment}{\ \ *\ @param\ \ \ \ modbus\_uart\_buff\ \ Указатель\ на\ буффер\ UART.}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00165}00165\ \textcolor{comment}{\ \ *\ @return\ \ \ RS\_RES\ \ \ \ \ \ \ \ Статус\ о\ результате\ заполнения\ буфера.}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00166}00166\ \textcolor{comment}{\ \ */}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00167}\mbox{\hyperlink{group___m_o_d_b_u_s___s_l_a_v_e_ga1c73cfdcbe7bc6076f62a4ec9c211eee}{00167}}\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga727154b368397b4796aa892de12a2289}{RS\_StatusTypeDef}}\ \mbox{\hyperlink{group___m_o_d_b_u_s___s_l_a_v_e_ga1c73cfdcbe7bc6076f62a4ec9c211eee}{MB\_Slave\_Collect\_Message}}(\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\_HandleTypeDef}}\ *hmodbus,\ \mbox{\hyperlink{struct_r_s___msg_type_def}{RS\_MsgTypeDef}}\ *modbus\_msg,\ uint8\_t\ *modbus\_uart\_buff)}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00168}00168\ \{}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00169}00169\ \ \ \textcolor{keywordtype}{int}\ ind\ =\ 0;\ \textcolor{comment}{//\ ind\ for\ modbus-\/uart\ buffer}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00170}00170\ \ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00171}00171\ \ \ \textcolor{keywordflow}{if}(hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6fa98c2955d01e07dc59f73d072bb37e}{f}}.\mbox{\hyperlink{struct_r_s___flags_type_def_a5f8d7960b41717c6edb84fc7bfc06d41}{EchoResponse}}\ \&\&\ hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6fa98c2955d01e07dc59f73d072bb37e}{f}}.\mbox{\hyperlink{struct_r_s___flags_type_def_a98c9a17358406818f3017a2997787c3f}{MessageHandled}})\ \ \textcolor{comment}{//\ if\ echo\ response\ need}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00172}00172\ \ \ \ \ ind\ =\ hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a495a29011412451e53459f9e1513814d}{RS\_Message\_Size}};}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00173}00173\ \ \ \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00174}00174\ \ \ \{}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00175}00175\ \ \ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/INFO\ ABOUT\ DATA/MESSAGE-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00176}00176\ \textcolor{preprocessor}{\#ifdef\ MODBUS\_PROTOCOL\_TCP}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00177}00177\ \ \ \ \ modbus\_uart\_buff[ind++]\ =\ modbus\_msg-\/>TransactionID\ >>\ 8;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00178}00178\ \ \ \ \ modbus\_uart\_buff[ind++]\ =\ modbus\_msg-\/>TransactionID\&\ 0xFF;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00179}00179\ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00180}00180\ \ \ \ \ modbus\_uart\_buff[ind++]\ =\ modbus\_msg-\/>ProtocolID\ >>\ 8;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00181}00181\ \ \ \ \ modbus\_uart\_buff[ind++]\ =\ modbus\_msg-\/>ProtocolID\&\ 0xFF;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00182}00182\ \ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00183}00183\ \ \ \ \ modbus\_uart\_buff[ind++]\ =\ modbus\_msg-\/>PDULength\ >>\ 8;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00184}00184\ \ \ \ \ modbus\_uart\_buff[ind++]\ =\ modbus\_msg-\/>PDULength\&\ 0xFF;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00185}00185\ \textcolor{preprocessor}{\#endif\ }}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00186}00186\ \ \ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/[first\ bytes]-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00187}00187\ \ \ \ \ \textcolor{comment}{//\ set\ ID\ of\ message/user}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00188}00188\ \ \ \ \ modbus\_uart\_buff[ind++]\ =\ modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a277ed439b65aedbf03bd112c073e6a32}{MbAddr}};\ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00189}00189\ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00190}00190\ \ \ \ \ \textcolor{comment}{//\ set\ dat\ or\ err\ response}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00191}00191\ \ \ \ \ modbus\_uart\_buff[ind++]\ =\ modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a176d779ab0d7fd06a4303e6e6acb6ca9}{FuncCode}};\ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00192}00192\ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00193}00193\ \ \ \ \ \textcolor{keywordflow}{if}\ (modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a176d779ab0d7fd06a4303e6e6acb6ca9}{FuncCode}}\ <\ \mbox{\hyperlink{group___m_o_d_b_u_s___m_e_s_s_a_g_e___d_e_f_i_n_e_s_ga822b0fd9ae9ff25dfa6748473e8e8627}{FC\_ERR\_VALUES\_START}})\ \textcolor{comment}{//\ if\ no\ error\ occur}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00194}00194\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00195}00195\ \ \ \ \ \ \ \textcolor{comment}{//\ fill\ modbus\ header}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00196}00196\ \ \ \ \ \ \ \textcolor{keywordflow}{if}(0)\ \{\}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00197}00197\ \textcolor{preprocessor}{\#ifdef\ MODBUS\_ENABLE\_DEVICE\_IDENTIFICATIONS}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00198}00198\ \ \ \ \ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}(modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a176d779ab0d7fd06a4303e6e6acb6ca9}{FuncCode}}\ ==\ \mbox{\hyperlink{group___m_o_d_b_u_s___m_e_s_s_a_g_e___d_e_f_i_n_e_s_gga38d42495bf262b70048e6d6a7af175d2a37ddf147e08b6d205319c31e6750d47c}{FC\_R\_DEVICE\_ID}})\ \textcolor{comment}{//\ devide\ identifications\ header}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00199}00199\ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00200}00200\ \ \ \ \ \ \ \ \ modbus\_uart\_buff[ind++]\ =\ modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a51c020dacb24e4ffcff28b1d3c6a01ae}{DevId}}.\mbox{\hyperlink{struct_m_b___dev_id_msg_type_def_aefb693da9f6b86a6da833c4177302092}{MEI\_Type}};}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00201}00201\ \ \ \ \ \ \ \ \ modbus\_uart\_buff[ind++]\ =\ modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a51c020dacb24e4ffcff28b1d3c6a01ae}{DevId}}.ReadDevId;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00202}00202\ \ \ \ \ \ \ \ \ modbus\_uart\_buff[ind++]\ =\ modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a51c020dacb24e4ffcff28b1d3c6a01ae}{DevId}}.\mbox{\hyperlink{struct_m_b___dev_id_msg_type_def_a1ef4b6db2785f723b26b0d9abe6f371e}{Conformity}};}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00203}00203\ \ \ \ \ \ \ \ \ modbus\_uart\_buff[ind++]\ =\ modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a51c020dacb24e4ffcff28b1d3c6a01ae}{DevId}}.MoreFollows;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00204}00204\ \ \ \ \ \ \ \ \ modbus\_uart\_buff[ind++]\ =\ modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a51c020dacb24e4ffcff28b1d3c6a01ae}{DevId}}.NextObjId;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00205}00205\ \ \ \ \ \ \ \ \ modbus\_uart\_buff[ind++]\ =\ modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a51c020dacb24e4ffcff28b1d3c6a01ae}{DevId}}.NumbOfObj;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00206}00206\ \ \ \ \ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00207}00207\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a5c69bf212dc5e7dc2eaa50971e27e2a6}{ByteCnt}}\ >\ \mbox{\hyperlink{group___m_o_d_b_u_s___m_e_s_s_a_g_e___d_e_f_i_n_e_s_gaf55149bc1f05cf18af067a302e31e3f9}{DATA\_SIZE}}*2)\ \textcolor{comment}{//\ if\ ByteCnt\ less\ than\ DATA\_SIZE}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00208}00208\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00209}00209\ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{group___r_s___d_e_b_u_g_ga49af29ab3927cad105c1d2b018a767e9}{TrackerCnt\_Err}}(hmodbus-\/>rs\_err);}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00210}00210\ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ RS\_COLLECT\_MSG\_ERR;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00211}00211\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00212}00212\ \ \ \ \ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00213}00213\ \ \ \ \ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00214}00214\ \ \ \ \ \ \ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/DATA-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00215}00215\ \ \ \ \ \ \ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/[data\ bytes]-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00216}00216\ \ \ \ \ \ \ \ \ uint8\_t\ *tmp\_data\_addr\ =\ (uint8\_t\ *)modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_aacbc6754621bd84742cd6c2ba65ad094}{MbData}};}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00217}00217\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keywordtype}{int}\ i\ =\ 0;\ i\ <\ modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a5c69bf212dc5e7dc2eaa50971e27e2a6}{ByteCnt}};\ i++)\ \textcolor{comment}{//\ filling\ buffer\ with\ data}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00218}00218\ \ \ \ \ \ \ \ \ \{\ \textcolor{comment}{//\ set\ data}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00219}00219\ \ \ \ \ \ \ \ \ \ \ modbus\_uart\_buff[ind++]\ =\ *tmp\_data\_addr;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00220}00220\ \ \ \ \ \ \ \ \ \ \ tmp\_data\_addr++;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00221}00221\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00222}00222\ \ \ \ \ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00223}00223\ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00224}00224\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//MODBUS\_ENABLE\_DEVICE\_IDENTIFICATIONS}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00225}00225\ \textcolor{preprocessor}{\#ifdef\ MODBUS\_ENABLE\_DIAGNOSTICS}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00226}00226\ \ \ \ \ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}(modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a176d779ab0d7fd06a4303e6e6acb6ca9}{FuncCode}}\ ==\ \mbox{\hyperlink{group___m_o_d_b_u_s___m_e_s_s_a_g_e___d_e_f_i_n_e_s_gga38d42495bf262b70048e6d6a7af175d2aa6423de9e908dc38ce9f1c8027ad72ec}{FC\_R\_DIAGNOSTICS}})}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00227}00227\ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00228}00228\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Diagnostics\ special\ format:\ [SubFunc\_HI][SubFunc\_LO][Data\_HI][Data\_LO]}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00229}00229\ \ \ \ \ \ \ \ \ modbus\_uart\_buff[ind++]\ =\ modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_aacbc6754621bd84742cd6c2ba65ad094}{MbData}}[0]\ >>\ 8;\ \ \ \textcolor{comment}{//\ Sub-\/function\ HI}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00230}00230\ \ \ \ \ \ \ \ \ modbus\_uart\_buff[ind++]\ =\ modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_aacbc6754621bd84742cd6c2ba65ad094}{MbData}}[0]\ \&\ 0xFF;\ \textcolor{comment}{//\ Sub-\/function\ LO}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00231}00231\ \ \ \ \ \ \ \ \ modbus\_uart\_buff[ind++]\ =\ modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_aacbc6754621bd84742cd6c2ba65ad094}{MbData}}[1]\ >>\ 8;\ \ \ \textcolor{comment}{//\ Data\ HI}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00232}00232\ \ \ \ \ \ \ \ \ modbus\_uart\_buff[ind++]\ =\ modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_aacbc6754621bd84742cd6c2ba65ad094}{MbData}}[1]\ \&\ 0xFF;\ \textcolor{comment}{//\ Data\ LO}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00233}00233\ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00234}00234\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//MODBUS\_ENABLE\_DIAGNOSTICS}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00235}00235\ \ \ \ \ \ \ \textcolor{keywordflow}{else}\ \textcolor{comment}{//\ modbus\ data\ header}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00236}00236\ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00237}00237\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ set\ size\ of\ received\ data}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00238}00238\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a5c69bf212dc5e7dc2eaa50971e27e2a6}{ByteCnt}}\ <=\ \mbox{\hyperlink{group___m_o_d_b_u_s___m_e_s_s_a_g_e___d_e_f_i_n_e_s_gaf55149bc1f05cf18af067a302e31e3f9}{DATA\_SIZE}}*2)\ \textcolor{comment}{//\ if\ ByteCnt\ less\ than\ DATA\_SIZE}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00239}00239\ \ \ \ \ \ \ \ \ \ \ modbus\_uart\_buff[ind++]\ =\ modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a5c69bf212dc5e7dc2eaa50971e27e2a6}{ByteCnt}};}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00240}00240\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{else}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ otherwise\ return\ data\_size\ err}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00241}00241\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00242}00242\ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{group___r_s___d_e_b_u_g_ga49af29ab3927cad105c1d2b018a767e9}{TrackerCnt\_Err}}(hmodbus-\/>rs\_err);}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00243}00243\ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ RS\_COLLECT\_MSG\_ERR;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00244}00244\ \ \ \ \ \ \ \ \ \}\ \ \ \ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00245}00245\ \ \ \ \ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00246}00246\ \ \ \ \ \ \ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/DATA-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00247}00247\ \ \ \ \ \ \ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/[data\ bytes]-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00248}00248\ \ \ \ \ \ \ \ \ uint16\_t\ *tmp\_data\_addr\ =\ (uint16\_t\ *)modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_aacbc6754621bd84742cd6c2ba65ad094}{MbData}};}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00249}00249\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keywordtype}{int}\ i\ =\ 0;\ i\ <\ modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a5c69bf212dc5e7dc2eaa50971e27e2a6}{ByteCnt}};\ i++)\ \textcolor{comment}{//\ filling\ buffer\ with\ data}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00250}00250\ \ \ \ \ \ \ \ \ \{\ \textcolor{comment}{//\ set\ data}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00251}00251\ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (i\%2\ ==\ 0)\ \ \ \textcolor{comment}{//\ HI\ byte}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00252}00252\ \ \ \ \ \ \ \ \ \ \ \ \ modbus\_uart\_buff[ind++]\ =\ (*tmp\_data\_addr)>>8;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00253}00253\ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{else}\ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ LO\ byte}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00254}00254\ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00255}00255\ \ \ \ \ \ \ \ \ \ \ \ \ modbus\_uart\_buff[ind++]\ =\ *tmp\_data\_addr;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00256}00256\ \ \ \ \ \ \ \ \ \ \ \ \ tmp\_data\_addr++;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00257}00257\ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00258}00258\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00259}00259\ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00260}00260\ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00261}00261\ \ \ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00262}00262\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00263}00263\ \ \ \ \ \textcolor{keywordflow}{else}\ \ \textcolor{comment}{//\ if\ some\ error\ occur}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00264}00264\ \ \ \ \ \{\ \ \ \ \ \textcolor{comment}{//\ send\ expection\ code}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00265}00265\ \ \ \ \ \ \ modbus\_uart\_buff[ind++]\ =\ modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a3dab5eaf3a1dd5719b8bfec1adad0d39}{Except\_Code}};}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00266}00266\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00267}00267\ \ \ \}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00268}00268\ \ \ \textcolor{keywordflow}{if}(ind\ <\ 0)}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00269}00269\ \ \ \ \ \textcolor{keywordflow}{return}\ RS\_COLLECT\_MSG\_ERR;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00270}00270\ \ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00271}00271\ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/CRC-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00272}00272\ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/[last\ 16\ bytes]-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00273}00273\ \textcolor{preprocessor}{\#ifndef\ MODBUS\_PROTOCOL\_TCP}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00274}00274\ \ \ \textcolor{comment}{//\ calc\ crc\ of\ received\ data}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00275}00275\ \ \ uint16\_t\ CRC\_VALUE\ =\ crc16(modbus\_uart\_buff,\ ind);}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00276}00276\ \ \ \textcolor{comment}{//\ write\ crc\ to\ message\ structure\ and\ modbus-\/uart\ buffer}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00277}00277\ \ \ modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a423ab838d4c113fd6392452fd44dc1c0}{MbCRC}}\ =\ CRC\_VALUE;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00278}00278\ \ \ modbus\_uart\_buff[ind++]\ =\ CRC\_VALUE;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00279}00279\ \ \ modbus\_uart\_buff[ind++]\ =\ CRC\_VALUE\ >>\ 8;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00280}00280\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00281}00281\ \ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00282}00282\ \ \ hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a495a29011412451e53459f9e1513814d}{RS\_Message\_Size}}\ =\ ind;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00283}00283\ \ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00284}00284\ \ \ \textcolor{keywordflow}{return}\ RS\_OK;\ \textcolor{comment}{//\ returns\ ok}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00285}00285\ \}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00286}00286\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00287}00287\ \textcolor{comment}{/**\ }}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00288}00288\ \textcolor{comment}{\ \ *\ @brief\ \ \ \ Определить\ размер\ модбас\ запроса\ (СЛЕЙВ\ версия).}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00289}00289\ \textcolor{comment}{\ \ *\ @param\ \ \ \ hRS\ \ \ \ \ \ \ \ \ \ \ Указатель\ на\ хендлер\ RS.}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00290}00290\ \textcolor{comment}{\ \ *\ @param\ \ \ \ rx\_data\_size\ \ Указатель\ на\ переменную\ для\ записи\ кол-\/ва\ байт\ для\ принятия.}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00291}00291\ \textcolor{comment}{\ \ *\ @return\ \ \ RS\_RES\ \ \ \ \ \ \ \ Статус\ о\ корректности\ рассчета\ кол-\/ва\ байт\ для\ принятия.}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00292}00292\ \textcolor{comment}{\ \ *\ @details\ \ Определение\ сколько\ байтов\ надо\ принять\ по\ протоколу.}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00293}00293\ \textcolor{comment}{\ \ */}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00294}\mbox{\hyperlink{modbus__slave_8c_a79e3f84b9daba8a42c8ca6026133acc5}{00294}}\ \textcolor{keyword}{static}\ \textcolor{keywordtype}{int}\ \mbox{\hyperlink{modbus__slave_8c_a79e3f84b9daba8a42c8ca6026133acc5}{MB\_Define\_Size\_of\_Function}}(\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\_HandleTypeDef}}\ *hmodbus,\ \mbox{\hyperlink{struct_r_s___msg_type_def}{RS\_MsgTypeDef}}\ *modbus\_msg)}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00295}00295\ \{\ \ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00296}00296\ \ \ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga727154b368397b4796aa892de12a2289}{RS\_StatusTypeDef}}\ MB\_RES\ =\ 0;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00297}00297\ \ \ \textcolor{keywordtype}{int}\ mb\_func\_size\ =\ 0;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00298}00298\ \ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00299}00299\ \ \ \textcolor{keywordflow}{if}\ (modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a176d779ab0d7fd06a4303e6e6acb6ca9}{FuncCode}}\ ==\ \mbox{\hyperlink{group___m_o_d_b_u_s___m_e_s_s_a_g_e___d_e_f_i_n_e_s_gga38d42495bf262b70048e6d6a7af175d2aa6423de9e908dc38ce9f1c8027ad72ec}{FC\_R\_DIAGNOSTICS}})}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00300}00300\ \ \ \{}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00301}00301\ \ \ \ \ mb\_func\_size\ =\ 1;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00302}00302\ \ \ \}\ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00303}00303\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}(modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a176d779ab0d7fd06a4303e6e6acb6ca9}{FuncCode}}\ ==\ \mbox{\hyperlink{group___m_o_d_b_u_s___m_e_s_s_a_g_e___d_e_f_i_n_e_s_gga38d42495bf262b70048e6d6a7af175d2a37ddf147e08b6d205319c31e6750d47c}{FC\_R\_DEVICE\_ID}})}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00304}00304\ \ \ \{}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00305}00305\ \ \ \ \ mb\_func\_size\ =\ 0;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00306}00306\ \ \ \}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00307}00307\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ ((modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a176d779ab0d7fd06a4303e6e6acb6ca9}{FuncCode}}\ \&\ \string~\mbox{\hyperlink{group___m_o_d_b_u_s___m_e_s_s_a_g_e___d_e_f_i_n_e_s_ga822b0fd9ae9ff25dfa6748473e8e8627}{FC\_ERR\_VALUES\_START}})\ <\ 0x0F)}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00308}00308\ \ \ \{}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00309}00309\ \ \ \ \ mb\_func\_size\ =\ 1;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00310}00310\ \ \ \}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00311}00311\ \ \ \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00312}00312\ \ \ \{}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00313}00313\ \ \ \ \ mb\_func\_size\ =\ modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a5c69bf212dc5e7dc2eaa50971e27e2a6}{ByteCnt}}\ +\ 2;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00314}00314\ \ \ \}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00315}00315\ \ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00316}00316\ \ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00317}00317\ \ \ mb\_func\_size\ =\ \mbox{\hyperlink{group___m_o_d_b_u_s___m_e_s_s_a_g_e___d_e_f_i_n_e_s_ga18eb6d0d9fdb6274341e892e2b41d88b}{RX\_FIRST\_PART\_SIZE}}\ +\ mb\_func\_size;\ \textcolor{comment}{//\ size\ of\ whole\ message}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00318}00318\ \ \ \textcolor{keywordflow}{return}\ mb\_func\_size;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00319}00319\ \}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00320}00320\ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00321}00321\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00322}00322\ \textcolor{comment}{/**\ }}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00323}00323\ \textcolor{comment}{\ \ *\ @brief\ \ \ \ Парс\ сообщения\ в\ режиме\ слейв\ (фрейм\ мастера\ из\ uart\ -\/>\ msg).}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00324}00324\ \textcolor{comment}{\ \ *\ @param\ \ \ \ hmodbus\ \ \ \ \ \ \ \ \ \ \ Указатель\ на\ хендлер\ RS.}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00325}00325\ \textcolor{comment}{\ \ *\ @param\ \ \ \ modbus\_msg\ \ \ \ \ \ \ \ Указатель\ на\ структуру\ сообщения.}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00326}00326\ \textcolor{comment}{\ \ *\ @param\ \ \ \ modbus\_uart\_buff\ \ Указатель\ на\ буффер\ UART.}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00327}00327\ \textcolor{comment}{\ \ *\ @return\ \ \ RS\_RES\ \ \ \ \ \ \ \ Статус\ о\ результате\ заполнения\ структуры.}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00328}00328\ \textcolor{comment}{\ \ *\ @details\ \ \ \ Заполнение\ структуры\ сообщения\ из\ буффера\ UART.}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00329}00329\ \textcolor{comment}{\ \ */}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00330}\mbox{\hyperlink{group___m_o_d_b_u_s___s_l_a_v_e_gadc281b1044c4ae345d10db6497846cef}{00330}}\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga727154b368397b4796aa892de12a2289}{RS\_StatusTypeDef}}\ \mbox{\hyperlink{group___m_o_d_b_u_s___s_l_a_v_e_gadc281b1044c4ae345d10db6497846cef}{MB\_Slave\_Parse\_Message}}(\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\_HandleTypeDef}}\ *hmodbus,\ \mbox{\hyperlink{struct_r_s___msg_type_def}{RS\_MsgTypeDef}}\ *modbus\_msg,\ uint8\_t\ *modbus\_uart\_buff)}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00331}00331\ \{}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00332}00332\ \ \ uint32\_t\ check\_empty\_buff;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00333}00333\ \ \ \textcolor{keywordtype}{int}\ ind\ =\ 0;\ \textcolor{comment}{//\ ind\ for\ modbus-\/uart\ buffer}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00334}00334\ \ \ hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6fa98c2955d01e07dc59f73d072bb37e}{f}}.\mbox{\hyperlink{struct_r_s___flags_type_def_a1513dc1265334c20a82b55b1090024c8}{RX\_Continue}}\ =\ 0;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00335}00335\ \ \ \textcolor{keywordtype}{int}\ expected\_size\ =\ 0;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00336}00336\ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/INFO\ ABOUT\ DATA/MESSAGE-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00337}00337\ \textcolor{preprocessor}{\#ifdef\ MODBUS\_PROTOCOL\_TCP}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00338}00338\ \ \ modbus\_msg-\/>TransactionID\ \ =modbus\_uart\_buff[ind++]<<8;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00339}00339\ \ \ modbus\_msg-\/>TransactionID\ \ |=modbus\_uart\_buff[ind++];}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00340}00340\ \ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00341}00341\ \ \ modbus\_msg-\/>ProtocolID\ =modbus\_uart\_buff[ind++]<<8;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00342}00342\ \ \ modbus\_msg-\/>ProtocolID\ |=modbus\_uart\_buff[ind++];}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00343}00343\ \ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00344}00344\ \ \ modbus\_msg-\/>PDULength\ \ =modbus\_uart\_buff[ind++]<<8;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00345}00345\ \ \ modbus\_msg-\/>PDULength\ \ |=modbus\_uart\_buff[ind++];}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00346}00346\ \textcolor{preprocessor}{\#endif\ }}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00347}00347\ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/[first\ bits]-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00348}00348\ \ \ \textcolor{comment}{//\ get\ ID\ of\ message/user}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00349}00349\ \ \ \textcolor{keywordflow}{if}(modbus\_uart\_buff[ind]\ !=\ hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a01e2c95a23aa3eed1f002e2329a10942}{ID}})}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00350}00350\ \ \ \{}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00351}00351\ \ \ \ \ modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a277ed439b65aedbf03bd112c073e6a32}{MbAddr}}\ =\ 0;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00352}00352\ \ \ \ \ ind++;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00353}00353\ \ \ \}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00354}00354\ \ \ \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00355}00355\ \ \ \{}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00356}00356\ \ \ \ \ modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a277ed439b65aedbf03bd112c073e6a32}{MbAddr}}\ =\ modbus\_uart\_buff[ind++];}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00357}00357\ \ \ \}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00358}00358\ \ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00359}00359\ \ \ \textcolor{comment}{//\ get\ func\ code}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00360}00360\ \ \ modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a176d779ab0d7fd06a4303e6e6acb6ca9}{FuncCode}}\ =\ modbus\_uart\_buff[ind++];}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00361}00361\ \ \ \textcolor{keywordflow}{if}(modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a176d779ab0d7fd06a4303e6e6acb6ca9}{FuncCode}}\ \&\ \mbox{\hyperlink{group___m_o_d_b_u_s___m_e_s_s_a_g_e___d_e_f_i_n_e_s_ga822b0fd9ae9ff25dfa6748473e8e8627}{FC\_ERR\_VALUES\_START}})\ \textcolor{comment}{//\ явная\ херня}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00362}00362\ \ \ \{}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00363}00363\ \ \ \ \ \mbox{\hyperlink{group___m_o_d_b_u_s___d_a_t_a___a_c_c_e_s_s___f_u_n_c_t_i_o_n_s_ga2585ebac184f7fa56059c81419c614b9}{MB\_Diagnostics\_SlaveNAKCnt}}();}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00364}00364\ \ \ \ \ modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a277ed439b65aedbf03bd112c073e6a32}{MbAddr}}\ =\ 0;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00365}00365\ \ \ \ \ \textcolor{keywordflow}{return}\ RS\_SKIP;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00366}00366\ \ \ \}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00367}00367\ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00368}00368\ \ \ \textcolor{keywordflow}{if}(0)\ \{\}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00369}00369\ \textcolor{preprocessor}{\#ifdef\ MODBUS\_ENABLE\_DEVICE\_IDENTIFICATIONS}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00370}00370\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}(modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a176d779ab0d7fd06a4303e6e6acb6ca9}{FuncCode}}\ ==\ \mbox{\hyperlink{group___m_o_d_b_u_s___m_e_s_s_a_g_e___d_e_f_i_n_e_s_gga38d42495bf262b70048e6d6a7af175d2a37ddf147e08b6d205319c31e6750d47c}{FC\_R\_DEVICE\_ID}})\ \textcolor{comment}{//\ if\ it\ device\ identifications\ request}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00371}00371\ \ \ \{}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00372}00372\ \ \ \ \ modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a51c020dacb24e4ffcff28b1d3c6a01ae}{DevId}}.\mbox{\hyperlink{struct_m_b___dev_id_msg_type_def_aefb693da9f6b86a6da833c4177302092}{MEI\_Type}}\ =\ modbus\_uart\_buff[ind++];}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00373}00373\ \ \ \ \ modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a51c020dacb24e4ffcff28b1d3c6a01ae}{DevId}}.ReadDevId\ =\ modbus\_uart\_buff[ind++];}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00374}00374\ \ \ \ \ modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a51c020dacb24e4ffcff28b1d3c6a01ae}{DevId}}.NextObjId\ =\ modbus\_uart\_buff[ind++];}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00375}00375\ \ \ \ \ modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a5c69bf212dc5e7dc2eaa50971e27e2a6}{ByteCnt}}\ =\ 0;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00376}00376\ \ \ \}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00377}00377\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//MODBUS\_ENABLE\_DEVICE\_IDENTIFICATIONS}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00378}00378\ \textcolor{preprocessor}{\#ifdef\ MODBUS\_ENABLE\_DIAGNOSTICS}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00379}00379\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}(modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a176d779ab0d7fd06a4303e6e6acb6ca9}{FuncCode}}\ ==\ \mbox{\hyperlink{group___m_o_d_b_u_s___m_e_s_s_a_g_e___d_e_f_i_n_e_s_gga38d42495bf262b70048e6d6a7af175d2aa6423de9e908dc38ce9f1c8027ad72ec}{FC\_R\_DIAGNOSTICS}})}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00380}00380\ \ \ \{}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00381}00381\ \ \ \ \ \textcolor{comment}{//\ Diagnostics:\ читаем\ 4\ байта\ в\ MbData[0]\ и\ MbData[1]}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00382}00382\ \ \ \ \ \textcolor{comment}{//\ Sub-\/function}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00383}00383\ \ \ \ \ modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_aacbc6754621bd84742cd6c2ba65ad094}{MbData}}[0]\ =\ modbus\_uart\_buff[ind++]\ <<\ 8;\ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00384}00384\ \ \ \ \ modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_aacbc6754621bd84742cd6c2ba65ad094}{MbData}}[0]\ |=\ modbus\_uart\_buff[ind++];}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00385}00385\ \ \ \ \ \textcolor{comment}{//\ Data}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00386}00386\ \ \ \ \ modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_aacbc6754621bd84742cd6c2ba65ad094}{MbData}}[1]\ =\ modbus\_uart\_buff[ind++]\ <<\ 8;\ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00387}00387\ \ \ \ \ modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_aacbc6754621bd84742cd6c2ba65ad094}{MbData}}[1]\ |=\ modbus\_uart\_buff[ind++];}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00388}00388\ \ \ \ \ modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_af99048a71119ba4c17772bd5544b3eef}{Addr}}\ =\ 0;\ \ \ \ \ \textcolor{comment}{//\ не\ использует\ Addr}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00389}00389\ \ \ \ \ modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a1ccb2bf492218a6ae3a5b6ad5cd4c82f}{Qnt}}\ =\ 0;\ \ \ \ \ \ \textcolor{comment}{//\ не\ использует\ Qnt}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00390}00390\ \ \ \}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00391}00391\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//MODBUS\_ENABLE\_DIAGNOSTICS}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00392}00392\ \ \ \textcolor{keywordflow}{else}\ \textcolor{comment}{//\ if\ its\ classic\ modbus\ request}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00393}00393\ \ \ \{}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00394}00394\ \ \ \ \ \textcolor{comment}{//\ get\ address\ from\ CMD}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00395}00395\ \ \ \ \ modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_af99048a71119ba4c17772bd5544b3eef}{Addr}}\ =\ modbus\_uart\_buff[ind++]\ <<\ 8;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00396}00396\ \ \ \ \ modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_af99048a71119ba4c17772bd5544b3eef}{Addr}}\ |=\ modbus\_uart\_buff[ind++];}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00397}00397\ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00398}00398\ \ \ \ \ \textcolor{comment}{//\ get\ address\ from\ CMD}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00399}00399\ \ \ \ \ modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a1ccb2bf492218a6ae3a5b6ad5cd4c82f}{Qnt}}\ =\ modbus\_uart\_buff[ind++]\ <<\ 8;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00400}00400\ \ \ \ \ modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a1ccb2bf492218a6ae3a5b6ad5cd4c82f}{Qnt}}\ |=\ modbus\_uart\_buff[ind++];}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00401}00401\ \ \ \}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00402}00402\ \ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00403}00403\ \ \ \textcolor{keywordflow}{if}((hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6a3f47a1a3476d6e9df997e1dc9da8c4}{pMessagePtr}}-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a176d779ab0d7fd06a4303e6e6acb6ca9}{FuncCode}}\ ==\ 0x0F)\ ||\ (hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6a3f47a1a3476d6e9df997e1dc9da8c4}{pMessagePtr}}-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a176d779ab0d7fd06a4303e6e6acb6ca9}{FuncCode}}\ ==\ 0x10))}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00404}00404\ \ \ \ \ hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6a3f47a1a3476d6e9df997e1dc9da8c4}{pMessagePtr}}-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a5c69bf212dc5e7dc2eaa50971e27e2a6}{ByteCnt}}\ =\ modbus\_uart\_buff[ind++];}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00405}00405\ \ \ \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00406}00406\ \ \ \ \ hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6a3f47a1a3476d6e9df997e1dc9da8c4}{pMessagePtr}}-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a5c69bf212dc5e7dc2eaa50971e27e2a6}{ByteCnt}}\ =\ 0;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00407}00407\ \ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00408}00408\ \ \ expected\_size\ =\ \mbox{\hyperlink{modbus__slave_8c_a79e3f84b9daba8a42c8ca6026133acc5}{MB\_Define\_Size\_of\_Function}}(hmodbus,\ modbus\_msg);}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00409}00409\ \ \ \textcolor{comment}{//\ если\ размер\ меньше\ ожидаемого\ -\/\ продолжаем\ принимать}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00410}00410\ \ \ \textcolor{keywordflow}{if}(hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a495a29011412451e53459f9e1513814d}{RS\_Message\_Size}}\ <\ expected\_size)}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00411}00411\ \ \ \{}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00412}00412\ \ \ \ \ hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6fa98c2955d01e07dc59f73d072bb37e}{f}}.\mbox{\hyperlink{struct_r_s___flags_type_def_a1513dc1265334c20a82b55b1090024c8}{RX\_Continue}}\ =\ 1;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00413}00413\ \ \ \ \ \textcolor{keywordflow}{return}\ RS\_SKIP;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00414}00414\ \ \ \}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00415}00415\ \ \ \textcolor{comment}{//\ если\ больше\ Ошибка}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00416}00416\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (hmodbus-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a495a29011412451e53459f9e1513814d}{RS\_Message\_Size}}\ >\ expected\_size)}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00417}00417\ \ \ \{}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00418}00418\ \ \ \ \ \mbox{\hyperlink{group___m_o_d_b_u_s___d_a_t_a___a_c_c_e_s_s___f_u_n_c_t_i_o_n_s_ga10f9e4dd9f3dda4bb0f66c323d6b29d7}{MB\_Diagnostics\_CommunicationErrorCnt}}();}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00419}00419\ \ \ \ \ \textcolor{keywordflow}{return}\ RS\_PARSE\_MSG\_ERR;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00420}00420\ \ \ \}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00421}00421\ \ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00422}00422\ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/DATA-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00423}00423\ \ \ \textcolor{comment}{//\ \ \ \ \ \ \ \ \ \ \ \ (optional)}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00424}00424\ \ \ \textcolor{keywordflow}{if}\ (modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a5c69bf212dc5e7dc2eaa50971e27e2a6}{ByteCnt}}\ !=\ 0)}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00425}00425\ \ \ \{}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00426}00426\ \ \ \ \ \textcolor{comment}{//check\ that\ data\ size\ is\ correct}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00427}00427\ \ \ \ \ \textcolor{keywordflow}{if}\ (modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a5c69bf212dc5e7dc2eaa50971e27e2a6}{ByteCnt}}\ >\ \mbox{\hyperlink{group___m_o_d_b_u_s___m_e_s_s_a_g_e___d_e_f_i_n_e_s_gaf55149bc1f05cf18af067a302e31e3f9}{DATA\_SIZE}}*2)}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00428}00428\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00429}00429\ \ \ \ \ \ \ \mbox{\hyperlink{group___r_s___d_e_b_u_g_ga49af29ab3927cad105c1d2b018a767e9}{TrackerCnt\_Err}}(hmodbus-\/>rs\_err);}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00430}00430\ \ \ \ \ \ \ modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a176d779ab0d7fd06a4303e6e6acb6ca9}{FuncCode}}\ |=\ \mbox{\hyperlink{group___m_o_d_b_u_s___m_e_s_s_a_g_e___d_e_f_i_n_e_s_ga822b0fd9ae9ff25dfa6748473e8e8627}{FC\_ERR\_VALUES\_START}};}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00431}00431\ \ \ \ \ \ \ \mbox{\hyperlink{group___m_o_d_b_u_s___d_a_t_a___a_c_c_e_s_s___f_u_n_c_t_i_o_n_s_ga10f9e4dd9f3dda4bb0f66c323d6b29d7}{MB\_Diagnostics\_CommunicationErrorCnt}}();}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00432}00432\ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ RS\_PARSE\_MSG\_ERR;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00433}00433\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00434}00434\ \ \ \ \ uint16\_t\ *tmp\_data\_addr\ =\ (uint16\_t\ *)modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_aacbc6754621bd84742cd6c2ba65ad094}{MbData}};}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00435}00435\ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keywordtype}{int}\ i\ =\ 0;\ i\ <\ modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a5c69bf212dc5e7dc2eaa50971e27e2a6}{ByteCnt}};\ i++)}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00436}00436\ \ \ \ \ \{\ \textcolor{comment}{//\ set\ data}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00437}00437\ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (i\%2\ ==\ 0)}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00438}00438\ \ \ \ \ \ \ \ \ *tmp\_data\_addr\ =\ ((uint16\_t)modbus\_uart\_buff[ind++]\ <<\ 8);}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00439}00439\ \ \ \ \ \ \ \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00440}00440\ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00441}00441\ \ \ \ \ \ \ \ \ *tmp\_data\_addr\ |=\ modbus\_uart\_buff[ind++];}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00442}00442\ \ \ \ \ \ \ \ \ tmp\_data\_addr++;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00443}00443\ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00444}00444\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00445}00445\ \ \ \}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00446}00446\ \ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00447}00447\ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/CRC-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00448}00448\ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/[last\ 16\ bits]-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00449}00449\ \textcolor{preprocessor}{\#ifndef\ MODBUS\_PROTOCOL\_TCP}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00450}00450\ \ \ \textcolor{comment}{//\ calc\ crc\ of\ received\ data}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00451}00451\ \ \ uint16\_t\ CRC\_VALUE\ =\ crc16(modbus\_uart\_buff,\ ind);}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00452}00452\ \ \ \textcolor{comment}{//\ get\ crc\ of\ received\ data}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00453}00453\ \ \ modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a423ab838d4c113fd6392452fd44dc1c0}{MbCRC}}\ =\ modbus\_uart\_buff[ind++];}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00454}00454\ \ \ modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a423ab838d4c113fd6392452fd44dc1c0}{MbCRC}}\ |=\ modbus\_uart\_buff[ind++]\ <<\ 8;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00455}00455\ \ \ \textcolor{comment}{//\ compare\ crc}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00456}00456\ \ \ \textcolor{keywordflow}{if}\ (modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a423ab838d4c113fd6392452fd44dc1c0}{MbCRC}}\ !=\ CRC\_VALUE)}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00457}00457\ \ \ \{}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00458}00458\ \ \ \ \ \mbox{\hyperlink{group___m_o_d_b_u_s___d_a_t_a___a_c_c_e_s_s___f_u_n_c_t_i_o_n_s_ga10f9e4dd9f3dda4bb0f66c323d6b29d7}{MB\_Diagnostics\_CommunicationErrorCnt}}();}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00459}00459\ \ \ \ \ \mbox{\hyperlink{group___r_s___d_e_b_u_g_ga49af29ab3927cad105c1d2b018a767e9}{TrackerCnt\_Err}}(hmodbus-\/>rs\_err);}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00460}00460\ \ \ \ \ modbus\_msg-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a176d779ab0d7fd06a4303e6e6acb6ca9}{FuncCode}}\ |=\ \mbox{\hyperlink{group___m_o_d_b_u_s___m_e_s_s_a_g_e___d_e_f_i_n_e_s_ga822b0fd9ae9ff25dfa6748473e8e8627}{FC\_ERR\_VALUES\_START}};}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00461}00461\ \ \ \}\ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00462}00462\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00463}00463\ \ \ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00464}00464\ \ \ \textcolor{keywordflow}{return}\ RS\_OK;}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00465}00465\ \}}
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00466}00466\ }
\DoxyCodeLine{\Hypertarget{modbus__slave_8c_source_l00467}00467\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//MODBUS\_ENABLE\_SLAVE}}

\end{DoxyCode}
