-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from tlm-solutions/feature/prometheus-exporter
Prometheus exporter for Layer 2 Lower MAC
- Loading branch information
Showing
20 changed files
with
740 additions
and
368 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
/cmake-build-release | ||
.idea | ||
/result | ||
/.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright (C) 2024 Transit Live Mapping Solutionss | ||
* All rights reserved. | ||
* | ||
* Authors: | ||
* Marenz Schmidl | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "burst_type.hpp" | ||
#include "l2/timebase_counter.hpp" | ||
#include <cstdint> | ||
#include <optional> | ||
#include <ostream> | ||
#include <vector> | ||
|
||
enum DownlinkUsage { CommonControl, Unallocated, AssignedControl, CommonAndAssignedControl, Traffic }; | ||
|
||
struct AccessAssignmentChannel { | ||
DownlinkUsage downlink_usage; | ||
std::optional<int> downlink_traffic_usage_marker; | ||
|
||
AccessAssignmentChannel() = delete; | ||
AccessAssignmentChannel(BurstType burst_type, const TimebaseCounter& time, const std::vector<uint8_t>& data); | ||
|
||
friend auto operator<<(std::ostream& stream, const AccessAssignmentChannel& aac) -> std::ostream&; | ||
}; | ||
|
||
auto operator<<(std::ostream& stream, const AccessAssignmentChannel& aac) -> std::ostream&; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright (C) 2024 Transit Live Mapping Solutions | ||
* All rights reserved. | ||
* | ||
* Authors: | ||
* Marenz Schmidl | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "burst_type.hpp" | ||
#include "l2/timebase_counter.hpp" | ||
#include <cstdint> | ||
#include <vector> | ||
|
||
struct BroadcastSynchronizationChannel { | ||
public: | ||
uint8_t system_code = 0; | ||
uint32_t color_code = 0; | ||
TimebaseCounter time{}; | ||
uint8_t sharing_mode = 0; | ||
uint8_t time_slot_reserved_frames = 0; | ||
uint8_t up_lane_dtx = 0; | ||
uint8_t frame_18_extension = 0; | ||
|
||
uint32_t scrambling_code = 0; | ||
|
||
uint32_t mobile_country_code = 0; | ||
uint32_t mobile_network_code = 0; | ||
uint8_t dNwrk_broadcast_broadcast_supported = 0; | ||
uint8_t dNwrk_broadcast_enquiry_supported = 0; | ||
uint8_t cell_load_ca = 0; | ||
uint8_t late_entry_supported = 0; | ||
|
||
BroadcastSynchronizationChannel() = default; | ||
BroadcastSynchronizationChannel(const BurstType burst_type, const std::vector<uint8_t>& data); | ||
|
||
friend auto operator<<(std::ostream& stream, const BroadcastSynchronizationChannel& bsc) -> std::ostream&; | ||
}; | ||
|
||
auto operator<<(std::ostream& stream, const BroadcastSynchronizationChannel& bsc) -> std::ostream&; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Copyright (C) 2024 Transit Live Mapping Solutions | ||
* All rights reserved. | ||
* | ||
* Authors: | ||
* Marenz Schmidl | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <cstdint> | ||
#include <ostream> | ||
#include <tuple> | ||
|
||
class TimebaseCounter { | ||
private: | ||
uint16_t time_slot_ = 1; | ||
uint16_t frame_number_ = 1; | ||
uint16_t multi_frame_number_ = 1; | ||
|
||
public: | ||
TimebaseCounter() = default; | ||
TimebaseCounter(const uint16_t time_slot, const uint16_t frame_number, const uint16_t multi_frame_number) | ||
: time_slot_(time_slot) | ||
, frame_number_(frame_number) | ||
, multi_frame_number_(multi_frame_number){}; | ||
|
||
[[nodiscard]] auto time_slot() const noexcept -> uint16_t { return time_slot_; }; | ||
[[nodiscard]] auto frame_number() const noexcept -> uint16_t { return frame_number_; }; | ||
[[nodiscard]] auto multi_frame_number() const noexcept -> uint16_t { return multi_frame_number_; }; | ||
/// convert the slot and frame numbers into a single value | ||
[[nodiscard]] auto count() const noexcept -> unsigned { | ||
return (time_slot_ - 1) + 4 * (frame_number_ - 1) + 4 * 18 * (multi_frame_number_ - 1); | ||
} | ||
|
||
[[nodiscard]] auto operator==(const TimebaseCounter& other) const noexcept -> bool { | ||
return std::tie(time_slot_, frame_number_, multi_frame_number_) == | ||
std::tie(other.time_slot_, other.frame_number_, other.multi_frame_number_); | ||
}; | ||
|
||
[[nodiscard]] auto operator!=(const TimebaseCounter& other) const noexcept -> bool { return !(*this == other); } | ||
|
||
auto increment() noexcept -> void; | ||
|
||
friend auto operator<<(std::ostream& stream, const TimebaseCounter& tc) -> std::ostream&; | ||
}; | ||
|
||
auto operator<<(std::ostream& stream, const TimebaseCounter& tc) -> std::ostream&; |
Oops, something went wrong.