herald  2.0.0
beacon_payload_data_supplier.h
1 // Copyright 2020-2021 Herald Project Contributors
2 // SPDX-License-Identifier: Apache-2.0
3 //
4 
5 #ifndef HERALD_BEACON_PAYLOAD_DATA_SUPPLIER_H
6 #define HERALD_BEACON_PAYLOAD_DATA_SUPPLIER_H
7 
8 #include "../extended/extended_data.h"
9 #include "../payload_data_supplier.h"
10 #include "../../datatype/payload_timestamp.h"
11 
12 #include <optional>
13 #include <cstdint>
14 
15 namespace herald {
16 namespace payload {
17 namespace beacon {
18 
19 using namespace herald::payload::extended;
20 using namespace herald::datatype;
21 
22 using MYUINT32 = unsigned long;
23 
25 public:
26  BeaconPayloadDataSupplier() = default;
27  virtual ~BeaconPayloadDataSupplier() = default;
28 };
29 
31 public:
32  ConcreteBeaconPayloadDataSupplierV1(std::uint16_t countryCode, std::uint16_t stateCode,
33  MYUINT32 code, ConcreteExtendedDataV1 extendedData);
34  // ConcreteBeaconPayloadDataSupplierV1(uint16_t countryCode, uint16_t stateCode,
35  // unsigned int code, ConcreteExtendedDataV1 extendedData);
36  ConcreteBeaconPayloadDataSupplierV1(std::uint16_t countryCode, std::uint16_t stateCode,
37  MYUINT32 code);
39 
40  PayloadData legacyPayload(const PayloadTimestamp timestamp, const Device& device);
41  PayloadData payload(const PayloadTimestamp timestamp, const Device& device);
42  PayloadData payload(const PayloadTimestamp timestamp);
43  // std::vector<PayloadData> payload(const Data& data);
44 
45 private:
46  uint16_t country;
47  uint16_t state;
48  MYUINT32 code;
49  ConcreteExtendedDataV1 extendedData;
50 
51  PayloadData mPayload;
52 };
53 
54 }
55 }
56 }
57 
58 #endif
Generic abstraction of a particular local proximate device type.
Definition: device.h:27
Definition: payload_data.h:13
Definition: beacon_payload_data_supplier.h:24
Definition: beacon_payload_data_supplier.h:30
Contains all low-level Herald datatype implementations.
Definition: base64_string.h:14
Acts as a non-global memory arena for arbitrary classes.
Definition: aggregates.h:15
Definition: payload_timestamp.h:13