Files
bacnet_stack/src/bacnet/datalink/automac.h
T
Kari Argillander f806c5829b Run clang-format and enable CI check for it (#755)
* pre-commit: Update and enable clang-format check

There is newer version from clang-format so use that. We do not yet want
18 as that is little bit too new.

* Format some thing by hand which clang-format "breaks"

Clang-format will format some things little bit off in some cases.
Format some things by hand so we get cleaner end result.

* Run clang-format with

```
pre-commit run --all-files clang-format
```

We have already in previously checked places where clang-format does not
make good format and ignored those (hopefully most of the things).

---------

Co-authored-by: Kari Argillander <kari.argillander@fidelix.com>
2024-08-30 11:20:58 -05:00

51 lines
1.3 KiB
C

/**
* @file
* @brief BACnet MS/TP Auto MAC address functionality
* @author Steve Karg <skarg@users.sourceforge.net>
* @date 2011
* @copyright SPDX-License-Identifier: MIT
* @defgroup DLMSTP BACnet MS/TP DataLink Network Layer
* @ingroup DataLink
*/
#ifndef BACNET_AUTOMAC_H
#define BACNET_AUTOMAC_H
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
/* BACnet Stack defines - first */
#include "bacnet/bacdef.h"
/* starting number available for AutoMAC */
#define MSTP_MAC_SLOTS_OFFSET 32
/* total number of slots */
#define MSTP_MAC_SLOTS_MAX 128
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
void automac_init(void);
bool automac_free_address_valid(uint8_t mac);
uint8_t automac_free_address_count(void);
uint8_t automac_free_address_mac(uint8_t count);
uint8_t automac_free_address_random(void);
void automac_pfm_set(uint8_t mac);
void automac_token_set(uint8_t mac);
void automac_emitter_set(uint8_t mac);
uint8_t automac_next_station(uint8_t mac);
uint8_t automac_address(void);
void automac_address_set(uint8_t mac);
void automac_address_init(void);
uint16_t automac_time_slot(void);
bool automac_pfm_cycle_complete(void);
bool automac_enabled(void);
void automac_enabled_set(bool status);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif