|
@@ -78,7 +78,7 @@ static shellmatta_retCode_t shellmatta_processDataInt(shellmatta_handle_t ha
|
|
utils_terminateInput(inst);
|
|
utils_terminateInput(inst);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- /** -# poll shellmatta ymomde to send out the request to the sender */
|
|
|
|
|
|
+ /** -# poll shellmatta ymomdem to send out the request to the sender */
|
|
if(SHELLMATTA_YMODEM_WAIT_FOR_START == inst->ymodem.state)
|
|
if(SHELLMATTA_YMODEM_WAIT_FOR_START == inst->ymodem.state)
|
|
{
|
|
{
|
|
(void)shellmatta_ymodem_poll(handle);
|
|
(void)shellmatta_ymodem_poll(handle);
|
|
@@ -501,7 +501,6 @@ shellmatta_retCode_t shellmatta_doInit(
|
|
|
|
|
|
#ifdef SHELLMATTA_TRANSPORT
|
|
#ifdef SHELLMATTA_TRANSPORT
|
|
/* init transport layer */
|
|
/* init transport layer */
|
|
- inst->transportEnabled = true;
|
|
|
|
inst->transportBusyMark = 0u;
|
|
inst->transportBusyMark = 0u;
|
|
shellmatta_transport_init(&inst->transportLayer, inst->write);
|
|
shellmatta_transport_init(&inst->transportLayer, inst->write);
|
|
#endif
|
|
#endif
|
|
@@ -796,51 +795,44 @@ shellmatta_retCode_t shellmatta_processData(shellmatta_handle_t handle,
|
|
&& (SHELLMATTA_MAGIC == inst->magic))
|
|
&& (SHELLMATTA_MAGIC == inst->magic))
|
|
{
|
|
{
|
|
#ifdef SHELLMATTA_TRANSPORT
|
|
#ifdef SHELLMATTA_TRANSPORT
|
|
- if (inst->transportEnabled)
|
|
|
|
|
|
+ for (i = inst->transportBusyMark; i < size; i ++)
|
|
{
|
|
{
|
|
- for (i = inst->transportBusyMark; i < size; i ++)
|
|
|
|
|
|
+ ret = shellmatta_transport_process(&inst->transportLayer, data[i], &tmpData, &tmpSize);
|
|
|
|
+ if (SHELLMATTA_OK == ret)
|
|
{
|
|
{
|
|
- ret = shellmatta_transport_process(&inst->transportLayer, data[i], &tmpData, &tmpSize);
|
|
|
|
- if (SHELLMATTA_OK == ret)
|
|
|
|
- {
|
|
|
|
- ret = shellmatta_processDataInt(handle, tmpData, tmpSize);
|
|
|
|
- processingDone = true;
|
|
|
|
|
|
+ ret = shellmatta_processDataInt(handle, tmpData, tmpSize);
|
|
|
|
+ processingDone = true;
|
|
|
|
|
|
- if (SHELLMATTA_BUSY == ret)
|
|
|
|
- {
|
|
|
|
- inst->transportBusyMark = i;
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- inst->transportBusyMark = 0u;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else if (SHELLMATTA_ERROR == ret)
|
|
|
|
|
|
+ if (SHELLMATTA_BUSY == ret)
|
|
{
|
|
{
|
|
- utils_writeEcho(inst, "crc error\r\n", 11);
|
|
|
|
- utils_terminateInput(inst);
|
|
|
|
|
|
+ inst->transportBusyMark = i;
|
|
|
|
+ break;
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- /* nothing to do - transport layer busy */
|
|
|
|
|
|
+ inst->transportBusyMark = 0u;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
- /*! -# call the internal processing at least once - for continued and busy commands */
|
|
|
|
- if (true != processingDone)
|
|
|
|
|
|
+ else if (SHELLMATTA_ERROR == ret)
|
|
{
|
|
{
|
|
- ret = shellmatta_processDataInt(handle, tmpData, 0);
|
|
|
|
|
|
+ utils_writeEcho(inst, "crc error\r\n", 11);
|
|
|
|
+ utils_terminateInput(inst);
|
|
}
|
|
}
|
|
-
|
|
|
|
- if (false == inst->transportLayer.disableAutoFlush)
|
|
|
|
|
|
+ else
|
|
{
|
|
{
|
|
- (void)shellmatta_transport_flush(handle);
|
|
|
|
|
|
+ /* nothing to do - transport layer busy */
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- else
|
|
|
|
|
|
+
|
|
|
|
+ /*! -# call the internal processing at least once - for continued and busy commands */
|
|
|
|
+ if (true != processingDone)
|
|
|
|
+ {
|
|
|
|
+ ret = shellmatta_processDataInt(handle, tmpData, 0);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (false == inst->transportLayer.disableAutoFlush)
|
|
{
|
|
{
|
|
- ret = shellmatta_processDataInt(handle, data, size);
|
|
|
|
|
|
+ (void)shellmatta_transport_flush(handle);
|
|
}
|
|
}
|
|
#else
|
|
#else
|
|
ret = shellmatta_processDataInt(handle, data, size);
|
|
ret = shellmatta_processDataInt(handle, data, size);
|