You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#1 On what purpose why do your team not use semaphore lock when received a U frame and before send response? For I see when you used that way in Master-side like this: if (buffer[2] == 0x43) { /* Check for TESTFR_ACT message */
DEBUG_PRINT("Send TESTFR_CON\n");
#if (CONFIG_USE_SEMAPHORES == 1)
Semaphore_wait(self->socketWriteLock);
#endif
writeToSocket(self, TESTFR_CON_MSG, TESTFR_CON_MSG_SIZE);
#if (CONFIG_USE_SEMAPHORES == 1)
Semaphore_post(self->socketWriteLock);
#endif
}
#2 May I suggest when handleMessage use in cs104_slave mode, if S frame was received set if (buffer[2] == 0x01 && buffer[3] == 0x00) ,it will be better than just judge buffer[2] == 0x01
#3 when processing U or S Frame, is it better to judge the size of the message first?
if (msgSize > 6) {
DEBUG_PRINT("Received U msg more than 6 bytes!");
return false;
}
The text was updated successfully, but these errors were encountered:
#1 On what purpose why do your team not use semaphore lock when received a U frame and before send response? For I see when you used that way in Master-side like this:
if (buffer[2] == 0x43) { /* Check for TESTFR_ACT message */
DEBUG_PRINT("Send TESTFR_CON\n");
#if (CONFIG_USE_SEMAPHORES == 1)
Semaphore_wait(self->socketWriteLock);
#endif
writeToSocket(self, TESTFR_CON_MSG, TESTFR_CON_MSG_SIZE);
#if (CONFIG_USE_SEMAPHORES == 1)
Semaphore_post(self->socketWriteLock);
#endif
}
#2 May I suggest when handleMessage use in cs104_slave mode, if S frame was received set if (buffer[2] == 0x01 && buffer[3] == 0x00) ,it will be better than just judge buffer[2] == 0x01
#3 when processing U or S Frame, is it better to judge the size of the message first?
if (msgSize > 6) {
DEBUG_PRINT("Received U msg more than 6 bytes!");
return false;
}
The text was updated successfully, but these errors were encountered: