compare node concerned
@@ -329,6 +329,25 @@ ll_service_t *Recep_GetConcernedLLService(header_t *header)
}
return NULL;
}
+/******************************************************************************
+ * @brief Parse msg to find a service concerne
+ * @param header of message
+ * @return None
+ ******************************************************************************/
+static inline error_return_t Recep_NodeCompare(uint16_t ID)
+{
+ uint16_t compare = 0;
+
+ if ((ID > (8 * ctx.Decay)))
+ {
+ compare = ((ID - 1) - ((8 * ctx.Decay)));
+ if ((ctx.Mask[compare / 8] & (1 << (compare % 8))) != 0)
+ {
+ return SUCCEED;
+ }
+ }
+ return FAILED;
+}
/******************************************************************************
* @brief Parse msg to find a service concerne
* @param header of message
@@ -337,6 +356,7 @@ ll_service_t *Recep_GetConcernedLLService(header_t *header)
luos_localhost_t Recep_NodeConcerned(header_t *header)
{
uint16_t i = 0;
+
// Find if we are concerned by this message.
switch (header->target_mode)
{
@@ -344,13 +364,10 @@ luos_localhost_t Recep_NodeConcerned(header_t *header)
ctx.rx.status.rx_error = false;
case ID:
// Check all ll_service id
- for (i = 0; i < ctx.ll_service_number; i++)
- {
- if ((header->target == ctx.ll_service_table[i].id))
+ if (Recep_NodeCompare(header->target) == SUCCEED)
{
return LOCALHOST;
}
- }
break;
case TYPE:
// Check all ll_service type
