6271632944
* Add and remove compiler warning compile options
Add some new compiler warnings. Some of those does not build clean so
ignore them for now. This also helps if some user use those options so
we ignore those for them also.
Also remove following ignores as they do not produce any warnings:
- Wno-attributes
- Wno-long-long
- Wno-implicit-fallthrough
* Fix -Wmissing-declarations compiler warnings
Fix new -Wmissing-declarations compiler warnings. I tried to look which
should be in headers and which should be static. Might be that some
statics should be in header as it is not easy to choose if something
should be exported or not.
* Fix -Wmissing-field-initializers compiler warnings
If we use { { 0 } } compiler thinks we might have mean that we only
meant initialize first member of struct or have forgotton to add second
one. We could do { { 0 }, 0 } but we can just do { 0 } which tells
compiler that hey just intialize this whole thing to zero.
* tests: Fix couple -Wfloat-conversion warnings
Add f prefix to floating point numbers to get some double to float
warnings away.
* ci: Make warnings as errors with cmake main build
To keep repo more clean from warnings use Werror flag when building main
project.
Windows should need -DCMAKE_C_FLAGS="/WX" but we have not ignore errors
for that yet so let's not yet take it in use.
* ci: Build also tests in matrix build
Enable also tests to be builded in our main matrix build. This way tests
will be builded also with clang and in future also with MSVC. We also
keep build very clean now as all warnings as catched.
With this we can also take out -Werror from compile_options as we add
that in CI. It is not good practice to keep that option always on. It
makes development lot harder. See example this blog post [1].
[1]: https://embeddedartistry.com/blog/2017/05/22/werror-is-not-your-friend/
* getevent: Deprecate getevent_encode_apdu()
Steve suggested that we should deprecate getevent_encode_apdu() [1].
Suggested-by: Steve Karg
[1]: https://github.com/bacnet-stack/bacnet-stack/pull/718#discussion_r1715821735
---------
Co-authored-by: Kari Argillander <kari.argillander@fidelix.com>
95 lines
2.5 KiB
C
95 lines
2.5 KiB
C
/**
|
|
* @file
|
|
* @brief BACnet GetEventNotification encode and decode functions
|
|
* @author Steve Karg <skarg@users.sourceforge.net>
|
|
* @date 2012
|
|
* @copyright SPDX-License-Identifier: MIT
|
|
*/
|
|
#ifndef BACNET_GET_EVENT_H
|
|
#define BACNET_GET_EVENT_H
|
|
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
/* BACnet Stack defines - first */
|
|
#include "bacnet/bacdef.h"
|
|
/* BACnet Stack API */
|
|
#include "bacnet/timestamp.h"
|
|
#include "bacnet/event.h"
|
|
|
|
struct BACnet_Get_Event_Information_Data;
|
|
typedef struct BACnet_Get_Event_Information_Data {
|
|
BACNET_OBJECT_ID objectIdentifier;
|
|
BACNET_EVENT_STATE eventState;
|
|
BACNET_BIT_STRING acknowledgedTransitions;
|
|
BACNET_TIMESTAMP eventTimeStamps[3];
|
|
BACNET_NOTIFY_TYPE notifyType;
|
|
BACNET_BIT_STRING eventEnable;
|
|
uint32_t eventPriorities[3];
|
|
struct BACnet_Get_Event_Information_Data *next;
|
|
} BACNET_GET_EVENT_INFORMATION_DATA;
|
|
|
|
/* return 0 if no active event at this index
|
|
return -1 if end of list
|
|
return +1 if active event */
|
|
typedef int (
|
|
*get_event_info_function) (
|
|
unsigned index,
|
|
BACNET_GET_EVENT_INFORMATION_DATA * getevent_data);
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif /* __cplusplus */
|
|
|
|
BACNET_STACK_EXPORT
|
|
int getevent_apdu_encode(
|
|
uint8_t *apdu,
|
|
BACNET_OBJECT_ID *lastReceivedObjectIdentifier);
|
|
|
|
BACNET_STACK_DEPRECATED("Use getevent_apdu_encode() instead")
|
|
BACNET_STACK_EXPORT
|
|
int getevent_encode_apdu(
|
|
uint8_t * apdu,
|
|
uint8_t invoke_id,
|
|
BACNET_OBJECT_ID * lastReceivedObjectIdentifier);
|
|
|
|
BACNET_STACK_EXPORT
|
|
size_t getevent_service_request_encode(
|
|
uint8_t *apdu, size_t apdu_size,
|
|
BACNET_OBJECT_ID *data);
|
|
|
|
BACNET_STACK_EXPORT
|
|
int getevent_decode_service_request(
|
|
uint8_t * apdu,
|
|
unsigned apdu_len,
|
|
BACNET_OBJECT_ID * object_id);
|
|
|
|
BACNET_STACK_EXPORT
|
|
int getevent_ack_encode_apdu_init(
|
|
uint8_t * apdu,
|
|
size_t max_apdu,
|
|
uint8_t invoke_id);
|
|
|
|
BACNET_STACK_EXPORT
|
|
int getevent_ack_encode_apdu_data(
|
|
uint8_t * apdu,
|
|
size_t max_apdu,
|
|
BACNET_GET_EVENT_INFORMATION_DATA * get_event_data);
|
|
|
|
BACNET_STACK_EXPORT
|
|
int getevent_ack_encode_apdu_end(
|
|
uint8_t * apdu,
|
|
size_t max_apdu,
|
|
bool moreEvents);
|
|
|
|
BACNET_STACK_EXPORT
|
|
int getevent_ack_decode_service_request(
|
|
uint8_t * apdu,
|
|
int apdu_len, /* total length of the apdu */
|
|
BACNET_GET_EVENT_INFORMATION_DATA * get_event_data,
|
|
bool * moreEvents);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif /* __cplusplus */
|
|
#endif
|