MCPcopy Create free account
hub / github.com/Seeed-Studio/Seeed_Arduino_CAN / exec

Method exec

src/can-serial.cpp:139–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137}
138
139INT8U Can232::exec() {
140 lw232LastErr = parseAndRunCommand();
141 switch (lw232LastErr) {
142 case LW232_OK:
143 Serial.write(LW232_RET_ASCII_OK);
144 break;
145 case LW232_OK_SMALL:
146 Serial.write(LW232_RET_ASCII_OK_SMALL);
147 Serial.write(LW232_RET_ASCII_OK);
148 break;
149 case LW232_OK_BIG:
150 Serial.write(LW232_RET_ASCII_OK_BIG);
151 Serial.write(LW232_RET_ASCII_OK);
152 break;
153 case LW232_ERR_NOT_IMPLEMENTED:
154 // Choose behavior: will it fail or not when not implemented command comes in. Some can monitors might be affected by this selection.
155 Serial.write(LW232_RET_ASCII_ERROR);
156 //Serial.write(LW232_RET_ASCII_OK);
157 break;
158 default:
159 Serial.write(LW232_RET_ASCII_ERROR);
160 }
161 return 0;
162}
163
164INT8U Can232::parseAndRunCommand() {
165 INT8U ret = LW232_OK;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected