cb243c36a8
* Change MIT license texts to SPDX-License-Identifier SPDX-License-Identifier is much easier to understand and grep than license text so use that instead. * Change GPL exception license texts to SPDX-License-Identifier SPDX-License-Identifier is much easier to understand and grep than license text so use that instead. * Change misc license texts to SPDX-License-Identifier There are some external code in repo which are not licenses as most of the stuff in this repo. We still want every file to have SPDX identifier to easily grep licenses. * Add currently used license files Even though Bacnet-Stack is using SPDX identifiers we still need to give those license files with source. For this reason add all license files to license/ folder. SPDX has also files which would make same thing but this is style which example Linux kernel is using and it is quite clear so I choose that one for now. I choosed not yet bring CC-PDDC as that is not right license for those files. --------- Co-authored-by: Kari Argillander <kari.argillander@fidelix.com>
48 lines
1.3 KiB
C
48 lines
1.3 KiB
C
/**************************************************************************
|
|
*
|
|
* Copyright (C) 2005 Steve Karg <skarg@users.sourceforge.net>
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*********************************************************************/
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <errno.h>
|
|
#include "bacnet/config.h"
|
|
#include "bacnet/basic/tsm/tsm.h"
|
|
#include "bacnet/bacdef.h"
|
|
#include "bacnet/bacdcode.h"
|
|
#include "bacnet/whois.h"
|
|
#include "bacnet/iam.h"
|
|
#include "bacnet/basic/object/device.h"
|
|
#include "bacnet/basic/services.h"
|
|
#include "bacnet/basic/tsm/tsm.h"
|
|
|
|
bool Send_I_Am_Flag = true;
|
|
|
|
void handler_who_is(
|
|
uint8_t *service_request, uint16_t service_len, BACNET_ADDRESS *src)
|
|
{
|
|
int len = 0;
|
|
int32_t low_limit = 0;
|
|
int32_t high_limit = 0;
|
|
int32_t target_device;
|
|
|
|
(void)src;
|
|
len = whois_decode_service_request(
|
|
service_request, service_len, &low_limit, &high_limit);
|
|
if (len == 0) {
|
|
Send_I_Am_Flag = true;
|
|
} else if (len != BACNET_STATUS_ERROR) {
|
|
/* is my device id within the limits? */
|
|
target_device = Device_Object_Instance_Number();
|
|
if ((target_device >= low_limit) && (target_device <= high_limit)) {
|
|
Send_I_Am_Flag = true;
|
|
}
|
|
}
|
|
|
|
return;
|
|
}
|