feat add control_framework, read json file OK

This commit is contained in:
Liu_Weichao
2022-11-24 10:46:54 +08:00
parent 2a8a11849d
commit bc47ae644f
13 changed files with 144 additions and 112 deletions

View File

@@ -18,6 +18,31 @@
* @date 2022.9.27
*/
#include <control.h>
void ControlOmronTest(void)
{
uint16_t read_data_length = 0;
uint8_t read_data[1024] = {0};
ControlProtocolType fins_protocol = ControlProtocolFind();
if (NULL == fins_protocol) {
printf("%s get fins protocol %p failed\n", __func__, fins_protocol);
return;
}
printf("%s get fins protocol %p successfull\n", __func__, fins_protocol);
if (CONTROL_REGISTERED == fins_protocol->protocol_status) {
ControlProtocolOpen(fins_protocol);
PrivTaskDelay(10000);
for (int i = 0; i < 10; i ++) {
read_data_length = ControlProtocolRead(fins_protocol, read_data, sizeof(read_data));
printf("%s read [%d] fins data %d using receipe file\n", __func__, i, read_data_length);
}
//ControlProtocolClose(fins_protocol);
}
}
PRIV_SHELL_CMD_FUNCTION(ControlOmronTest, Omron Plc FINS Demo, PRIV_SHELL_CMD_MAIN_ATTR);